summaryrefslogtreecommitdiffstats
path: root/grapher/GraphData.hxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-01 12:02:24 +0100
committerTim Moore <timoore@redhat.com>2009-12-01 12:30:42 +0100
commit572a176d481c329b370ce52e7bec1a49ed76c225 (patch)
treec4979af7c8089124ee0dd30d63ec14864ea0e9f9 /grapher/GraphData.hxx
parent211c338e54b096a41170c5bac99eaf33959076f2 (diff)
downloadsystemtap-steved-572a176d481c329b370ce52e7bec1a49ed76c225.tar.gz
systemtap-steved-572a176d481c329b370ce52e7bec1a49ed76c225.tar.xz
systemtap-steved-572a176d481c329b370ce52e7bec1a49ed76c225.zip
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.
Diffstat (limited to 'grapher/GraphData.hxx')
-rw-r--r--grapher/GraphData.hxx12
1 files changed, 11 insertions, 1 deletions
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 <stdint.h>
+
+#include <sstream>
#include <string>
#include <utility>
#include <vector>
@@ -18,12 +21,13 @@ namespace systemtap
DOT,
EVENT
};
- typedef boost::circular_buffer<double> TimeList;
+ typedef boost::circular_buffer<int64_t> 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