From 572a176d481c329b370ce52e7bec1a49ed76c225 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 1 Dec 2009 12:02:24 +0100 Subject: change time type from double to int64_t * grapher/Graph.hxx (Graph): Change variables holding the time limits of the displayed graph from double to int64_t. * grapher/Graph.cxx (Graph::draw): Do calculations of time differences using int64_t. (Graph::getExtents, Graph::setExtents): Change left and right arguments to int64_t. * grapher/GraphData.hxx (GraphDataBase): Change time type to int64_t. (GraphDataBase::elementAsString): New function. (GraphData::elementAsString): Implementation of that function. * grapher/StapParser.cxx (parseData): Parse time values from the stap script as 64 bit values. --- grapher/GraphData.hxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'grapher/GraphData.hxx') diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx index 0e26fb4d..e06ffdb8 100644 --- a/grapher/GraphData.hxx +++ b/grapher/GraphData.hxx @@ -1,6 +1,9 @@ #ifndef SYSTEMTAP_GRAPHDATA_HXX #define SYSTEMTAP_GRAPHDATA_HXX 1 +#include + +#include #include #include #include @@ -18,12 +21,13 @@ namespace systemtap DOT, EVENT }; - typedef boost::circular_buffer TimeList; + typedef boost::circular_buffer TimeList; GraphDataBase(TimeList::capacity_type cap = 50000) : scale(1.0), style(BAR), times(cap) { color[0] = 0.0; color[1] = 1.0; color[2] = 0.0; } + virtual std::string elementAsString(size_t element) = 0; // size of grid square at "normal" viewing double scale; double color[3]; @@ -44,6 +48,12 @@ namespace systemtap : GraphDataBase(cap), data(cap) { } + std::string elementAsString(size_t element) + { + std::ostringstream stream; + stream << data[element]; + return stream.str(); + } DataList data; }; struct CSVData -- cgit