improved RSGraph class. Not finished yet.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7609 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-10-13 22:05:50 +00:00
parent 6e2df7e0de
commit 1757a85e57
6 changed files with 272 additions and 163 deletions

View file

@ -26,6 +26,7 @@
#endif #endif
#include <iostream> #include <iostream>
#include <math.h>
#include <QtGlobal> #include <QtGlobal>
#include <QPainter> #include <QPainter>
#include <QDateTime> #include <QDateTime>
@ -39,6 +40,7 @@ RSGraphSource::RSGraphSource()
_update_period_msecs = 1*1000 ; _update_period_msecs = 1*1000 ;
_time_orig_msecs = QDateTime::currentMSecsSinceEpoch() ; _time_orig_msecs = QDateTime::currentMSecsSinceEpoch() ;
_timer = new QTimer ; _timer = new QTimer ;
QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(update())) ; QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(update())) ;
} }
@ -61,18 +63,31 @@ void RSGraphSource::start()
_timer->start((int)(_update_period_msecs)) ; _timer->start((int)(_update_period_msecs)) ;
} }
int RSGraphSource::n_values() const { return _points.size() ; }
void RSGraphSource::getDataPoints(int index,std::vector<QPointF>& pts) const void RSGraphSource::getDataPoints(int index,std::vector<QPointF>& pts) const
{ {
pts.clear() ; pts.clear() ;
qint64 now = getTime() ; qint64 now = getTime() ;
for(std::list<std::pair<qint64,std::vector<float> > >::const_iterator it = _points.begin();it!=_points.end();++it) std::map<std::string,std::list<std::pair<qint64,float> > >::const_iterator it = _points.begin();
pts.push_back(QPointF( (now - (*it).first)/1000.0f,(*it).second[index])) ;
int n=0;
for(it = _points.begin();it!=_points.end() && n<index;++it,++n) ;
if(n != index)
return ;
for(std::list<std::pair<qint64,float> >::const_iterator it2=it->second.begin();it2!=it->second.end();++it2)
pts.push_back(QPointF( (now - (*it2).first)/1000.0f,(*it2).second)) ;
} }
void RSGraphWidget::addSource(RSGraphSource *gs) void RSGraphWidget::addSource(RSGraphSource *gs)
{ {
_sources.push_back(gs) ; if(_source != NULL)
delete _source ;
_source = gs ;
} }
qint64 RSGraphSource::getTime() const qint64 RSGraphSource::getTime() const
@ -82,27 +97,41 @@ qint64 RSGraphSource::getTime() const
void RSGraphSource::update() void RSGraphSource::update()
{ {
std::vector<float> vals ; std::map<std::string,float> vals ;
getValues(vals) ; getValues(vals) ;
qint64 ms = getTime() ; qint64 ms = getTime() ;
_points.push_back(std::make_pair(ms,vals)) ; for(std::map<std::string,float>::iterator it=vals.begin();it!=vals.end();++it)
{
std::list<std::pair<qint64,float> >& lst(_points[it->first]) ;
//std::cerr << "RSGraphSource::update() Got new data for time " << ms/1000.0 << ", now=" << ms << std::endl; lst.push_back(std::make_pair(ms,it->second)) ;
// eliminate measurements that stand beyond the time limit for(std::list<std::pair<qint64,float> >::iterator it2=lst.begin();it2!=lst.end();)
if( ms - (*it2).first > _time_limit_msecs)
for(std::list<std::pair<qint64,std::vector<float> > >::iterator it=_points.begin();it!=_points.end();)
if( ms - (*it).first > _time_limit_msecs)
{ {
//std::cerr << " removing old value with time " << (*it).first/1000.0f << std::endl; //std::cerr << " removing old value with time " << (*it).first/1000.0f << std::endl;
it = _points.erase(it) ; it2 = lst.erase(it2) ;
} }
else else
break ; break ;
} }
// remove empty lists
for(std::map<std::string,std::list<std::pair<qint64,float> > >::iterator it=_points.begin();it!=_points.end();)
if(it->second.empty())
{
std::map<std::string,std::list<std::pair<qint64,float> > >::iterator tmp(it) ;
++tmp;
_points.erase(it) ;
it=tmp ;
}
else
++it ;
}
void RSGraphSource::setCollectionTimeLimit(qint64 s) { _time_limit_msecs = s ; } void RSGraphSource::setCollectionTimeLimit(qint64 s) { _time_limit_msecs = s ; }
void RSGraphSource::setCollectionTimePeriod(qint64 s) { _update_period_msecs = s ; } void RSGraphSource::setCollectionTimePeriod(qint64 s) { _update_period_msecs = s ; }
@ -115,6 +144,7 @@ void RSGraphWidget::setTimeScale(float pixels_per_second)
RSGraphWidget::RSGraphWidget(QWidget *parent) RSGraphWidget::RSGraphWidget(QWidget *parent)
: QFrame(parent) : QFrame(parent)
{ {
_source =NULL;
_painter = new QPainter(); _painter = new QPainter();
_graphStyle = AreaGraph; _graphStyle = AreaGraph;
@ -122,10 +152,12 @@ RSGraphWidget::RSGraphWidget(QWidget *parent)
_maxPoints = getNumPoints(); _maxPoints = getNumPoints();
_maxValue = MINUSER_SCALE; _maxValue = MINUSER_SCALE;
_flags = 0;
_time_scale = 5.0f ; // in pixels per second. _time_scale = 5.0f ; // in pixels per second.
_timer = new QTimer ; _timer = new QTimer ;
QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(update())) ; QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(update())) ;
_y_scale = 1.0f ;
_timer->start(1000); _timer->start(1000);
} }
@ -133,9 +165,7 @@ RSGraphWidget::RSGraphWidget(QWidget *parent)
RSGraphWidget::~RSGraphWidget() RSGraphWidget::~RSGraphWidget()
{ {
delete _painter; delete _painter;
delete _source ;
for(uint32_t i=0;i<_sources.size();++i)
delete _sources[i] ;
} }
/** Gets the width of the desktop, which is the maximum number of points /** Gets the width of the desktop, which is the maximum number of points
@ -203,8 +233,20 @@ void RSGraphWidget::paintEvent(QPaintEvent *)
void RSGraphWidget::paintData() void RSGraphWidget::paintData()
{ {
/* Convert the bandwidth data points to graph points */ /* Convert the bandwidth data points to graph points */
if(_source == NULL)
return ;
const RSGraphSource& source(*_source) ;
_maxValue = 0.0f ;
for(int i=0;i<source.n_values();++i)
{
std::vector<QPointF> values ;
source.getDataPoints(i,values) ;
QVector<QPointF> points ; QVector<QPointF> points ;
pointsFromData(points) ; pointsFromData(values,points) ;
/* Plot the bandwidth data as area graphs */ /* Plot the bandwidth data as area graphs */
if (_graphStyle == AreaGraph) if (_graphStyle == AreaGraph)
@ -214,30 +256,26 @@ void RSGraphWidget::paintData()
* area graph, we end up outlining the integrals. */ * area graph, we end up outlining the integrals. */
paintLine(points, RSDHT_COLOR); paintLine(points, RSDHT_COLOR);
} }
if(_maxValue > 0.0f)
if(_flags & RSGRAPH_FLAGS_LOG_SCALE_Y)
_y_scale = _rec.height()*0.8 / log(_maxValue) ;
else
_y_scale = _rec.height()*0.8/_maxValue ;
}
/** Returns a list of points on the bandwidth graph based on the supplied set /** Returns a list of points on the bandwidth graph based on the supplied set
* of rsdht or alldht values. */ * of rsdht or alldht values. */
void RSGraphWidget::pointsFromData(QVector<QPointF>& points) void RSGraphWidget::pointsFromData(const std::vector<QPointF>& values,QVector<QPointF>& points)
{ {
points.clear(); points.clear();
int x = _rec.width(); int x = _rec.width();
int y = _rec.height(); int y = _rec.height();
qreal scale = (y - (y/10)) / _maxValue;
qreal currValue;
if(_sources.empty())
return ;
const RSGraphSource& source(*_sources.front()) ;
float time_step = 1.0f ; // number of seconds per pixel float time_step = 1.0f ; // number of seconds per pixel
/* Translate all data points to points on the graph frame */ /* Translate all data points to points on the graph frame */
std::vector<QPointF> values ;
source.getDataPoints(0,values) ;
float last = values.back().x() ; float last = values.back().x() ;
//std::cerr << "Got " << values.size() << " values for index 0" << std::endl; //std::cerr << "Got " << values.size() << " values for index 0" << std::endl;
@ -245,14 +283,16 @@ void RSGraphWidget::pointsFromData(QVector<QPointF>& points)
float last_px = SCALE_WIDTH ; float last_px = SCALE_WIDTH ;
float last_py = 0.0f ; float last_py = 0.0f ;
for (int i = 0; i < values.size(); ++i) for (uint i = 0; i < values.size(); ++i)
{ {
//std::cerr << "Value: (" << values[i].x() << " , " << values[i].y() << ")" << std::endl; //std::cerr << "Value: (" << values[i].x() << " , " << values[i].y() << ")" << std::endl;
// compute point in pixels // compute point in pixels
float px = x - (values[i].x()-last)*_time_scale ; qreal px = x - (values[i].x()-last)*_time_scale ;
float py = y - values[i].y()*scale ; qreal py = y - valueToPixels(values[i].y()) ;
_maxValue = std::max(_maxValue,values[i].y()) ;
if(px >= SCALE_WIDTH && last_px < SCALE_WIDTH) if(px >= SCALE_WIDTH && last_px < SCALE_WIDTH)
{ {
@ -282,6 +322,23 @@ void RSGraphWidget::pointsFromData(QVector<QPointF>& points)
if(i==values.size()-1) if(i==values.size()-1)
points << QPointF(px,y) ; points << QPointF(px,y) ;
} }
}
qreal RSGraphWidget::valueToPixels(qreal val)
{
if(_flags & RSGRAPH_FLAGS_LOG_SCALE_Y)
return log(std::max((qreal)1.0,val))*_y_scale ;
else
return val*_y_scale ;
}
qreal RSGraphWidget::pixelsToValue(qreal val)
{
if(_flags & RSGRAPH_FLAGS_LOG_SCALE_Y)
return exp(val / _y_scale) ;
else
return val/_y_scale ;
} }
/** Plots an integral using the data points in <b>points</b>. The area will be /** Plots an integral using the data points in <b>points</b>. The area will be
@ -346,7 +403,7 @@ QString RSGraphWidget::totalToStr(qreal total)
/** Paints the scale on the graph. */ /** Paints the scale on the graph. */
void RSGraphWidget::paintScale() void RSGraphWidget::paintScale()
{ {
qreal markStep = _maxValue * .25; qreal markStep = valueToPixels(_maxValue) * .25; // in pixels
int top = _rec.y(); int top = _rec.y();
int bottom = _rec.height(); int bottom = _rec.height();
qreal paintStep = (bottom - (bottom/10)) / 4; qreal paintStep = (bottom - (bottom/10)) / 4;
@ -354,15 +411,22 @@ void RSGraphWidget::paintScale()
/* Draw the other marks in their correctly scaled locations */ /* Draw the other marks in their correctly scaled locations */
qreal scale; qreal scale;
qreal pos; qreal pos;
for (int i = 1; i < 5; i++) {
if(_source == NULL)
return ;
QString unit_name = _source->unitName() ;
for (int i = 1; i < 5; i++)
{
pos = bottom - (i * paintStep); pos = bottom - (i * paintStep);
scale = i * markStep;
scale = pixelsToValue(i * markStep);
_painter->setPen(SCALE_COLOR); _painter->setPen(SCALE_COLOR);
_painter->drawText(QPointF(5, pos+FONT_SIZE), _painter->drawText(QPointF(5, pos+FONT_SIZE), tr("%1 %2").arg(scale, 0, 'f', 0).arg(unit_name));
tr("%1 Users").arg(scale, 0, 'f', 0));
_painter->setPen(GRID_COLOR); _painter->setPen(GRID_COLOR);
_painter->drawLine(QPointF(SCALE_WIDTH, pos), _painter->drawLine(QPointF(SCALE_WIDTH, pos), QPointF(_rec.width(), pos));
QPointF(_rec.width(), pos));
} }
/* Draw vertical separator */ /* Draw vertical separator */

View file

@ -23,6 +23,8 @@
#pragma once #pragma once
#include <map>
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QFrame> #include <QFrame>
@ -57,7 +59,7 @@ public:
void stop() ; void stop() ;
void clear() ; void clear() ;
virtual int n_values() const =0; // Method to overload in your own class virtual int n_values() const ;
// Returns the n^th interpolated value at the given time in floating point seconds backward. // Returns the n^th interpolated value at the given time in floating point seconds backward.
virtual void getDataPoints(int index, std::vector<QPointF>& pts) const ; virtual void getDataPoints(int index, std::vector<QPointF>& pts) const ;
@ -68,16 +70,21 @@ public:
// Sets the time period for collecting new values. Units=milliseconds. // Sets the time period for collecting new values. Units=milliseconds.
void setCollectionTimePeriod(qint64 msecs) ; void setCollectionTimePeriod(qint64 msecs) ;
virtual QString unitName() const =0;// overload to give your own unit name (KB/s, Users, etc)
protected slots: protected slots:
// Calls the internal source for a new data points; called by the timer. // Calls the internal source for a new data points; called by the timer. You might want to overload this
// if the collection system needs it. Otherwise, the default method will call getValues()
void update() ; void update() ;
protected: protected:
virtual void getValues(std::vector<float>& values) const = 0 ; // overload this in your own class to fill in the values you want to display. virtual void getValues(std::map<std::string,float>& values) const = 0 ;// overload this in your own class to fill in the values you want to display.
qint64 getTime() const ; // returns time in ms since RS has started qint64 getTime() const ; // returns time in ms since RS has started
std::list<std::pair<qint64,std::vector<float> > > _points ; // Storage of collected events. The string is any string used to represent the collected data.
std::map<std::string, std::list<std::pair<qint64,float> > > _points ;
QTimer *_timer ; QTimer *_timer ;
@ -122,6 +129,8 @@ class RSGraphWidget: public QFrame
/** Sets the graph style used to display bandwidth data. */ /** Sets the graph style used to display bandwidth data. */
void setGraphStyle(GraphStyle style) { _graphStyle = style; } void setGraphStyle(GraphStyle style) { _graphStyle = style; }
void setFlags(uint32_t flag) { _flags |= flag ; }
void resetFlags(uint32_t flag) { _flags &= ~flag ; }
protected: protected:
/** Overloaded QWidget::paintEvent() */ /** Overloaded QWidget::paintEvent() */
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
@ -144,7 +153,7 @@ class RSGraphWidget: public QFrame
QString totalToStr(qreal total); QString totalToStr(qreal total);
/** Returns a list of points on the bandwidth graph based on the supplied set /** Returns a list of points on the bandwidth graph based on the supplied set
* of rsdht or alldht values. */ * of rsdht or alldht values. */
void pointsFromData(QVector<QPointF> & ) ; void pointsFromData(const std::vector<QPointF>& values, QVector<QPointF> &points ) ;
/** Paints a line with the data in <b>points</b>. */ /** Paints a line with the data in <b>points</b>. */
void paintLine(const QVector<QPointF>& points, QColor color, void paintLine(const QVector<QPointF>& points, QColor color,
@ -161,6 +170,10 @@ class RSGraphWidget: public QFrame
/** The maximum data value plotted. */ /** The maximum data value plotted. */
qreal _maxValue; qreal _maxValue;
/** The maximum number of points to store. */ /** The maximum number of points to store. */
qreal _y_scale ;
qreal pixelsToValue(qreal) ;
qreal valueToPixels(qreal) ;
int _maxPoints; int _maxPoints;
qreal _time_scale ; // horizontal scale in pixels per sec. qreal _time_scale ; // horizontal scale in pixels per sec.
@ -172,6 +185,6 @@ class RSGraphWidget: public QFrame
uint32_t _flags ; uint32_t _flags ;
QTimer *_timer ; QTimer *_timer ;
std::vector<RSGraphSource *> _sources ; RSGraphSource *_source ;
}; };

View file

@ -168,13 +168,12 @@ class RttPlot
}; };
RttStatistics::RttStatistics(QWidget *parent) RttStatistics::RttStatistics(QWidget *parent)
: RsAutoUpdatePage(2000,parent)
{ {
setupUi(this) ; setupUi(this) ;
m_bProcessSettings = false; m_bProcessSettings = false;
_tunnel_statistics_F->setWidget( _tst_CW = new RttStatisticsWidget() ) ; _tunnel_statistics_F->setWidget( _tst_CW = new RttStatisticsGraph() ) ;
_tunnel_statistics_F->setWidgetResizable(true); _tunnel_statistics_F->setWidgetResizable(true);
_tunnel_statistics_F->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); _tunnel_statistics_F->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
_tunnel_statistics_F->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); _tunnel_statistics_F->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
@ -218,62 +217,77 @@ void RttStatistics::processSettings(bool bLoad)
} }
void RttGraphSource::getValues(std::map<std::string,float>& vals)
void RttStatistics::updateDisplay()
{ {
std::map<RsPeerId, std::list<RsRttPongResult> > info;
if (!rsRtt)
{
return;
}
std::list<RsPeerId> idList; std::list<RsPeerId> idList;
std::list<RsPeerId>::iterator it;
rsPeers->getOnlineList(idList); rsPeers->getOnlineList(idList);
time_t now = time(NULL); vals.clear() ;
time_t minTS = now;
time_t maxTS = 0;
double maxRTT = 0;
for(it = idList.begin(); it != idList.end(); it++)
{
std::list<RsRttPongResult> results ; std::list<RsRttPongResult> results ;
std::list<RsRttPongResult>::iterator rit;
#define MAX_RESULTS 60 for(std::list<RsPeerId>::const_iterator it(idList.begin());it!=idList.end();++it)
rsRtt->getPongResults(*it, MAX_RESULTS, results); {
rsRtt->getPongResults(*it, 1, results);
for(rit = results.begin(); rit != results.end(); rit++) vals[(*it).toStdString()] = results.front().mRTT ;
{
/* only want maxRTT to include plotted bit */
double dt = now - rit->mTS;
if (dt < MAX_DISPLAY_PERIOD)
{
if (maxRTT < rit->mRTT)
{
maxRTT = rit->mRTT;
}
}
if (minTS > rit->mTS)
{
minTS = rit->mTS;
}
if (maxTS < rit->mTS)
{
maxTS = rit->mTS;
} }
} }
info[*it] = results; //void RttStatistics::updateDisplay()
} //{
// std::map<RsPeerId, std::list<RsRttPongResult> > info;
//
_tst_CW->updateRttStatistics(info, maxRTT, minTS, maxTS); // if (!rsRtt)
_tst_CW->update(); // {
} // return;
// }
//
// std::list<RsPeerId> idList;
// std::list<RsPeerId>::iterator it;
//
// rsPeers->getOnlineList(idList);
//
// time_t now = time(NULL);
// time_t minTS = now;
// time_t maxTS = 0;
// double maxRTT = 0;
//
// for(it = idList.begin(); it != idList.end(); it++)
// {
// std::list<RsRttPongResult> results;
// std::list<RsRttPongResult>::iterator rit;
//
//#define MAX_RESULTS 60
// rsRtt->getPongResults(*it, MAX_RESULTS, results);
//
// for(rit = results.begin(); rit != results.end(); rit++)
// {
// /* only want maxRTT to include plotted bit */
// double dt = now - rit->mTS;
// if (dt < MAX_DISPLAY_PERIOD)
// {
// if (maxRTT < rit->mRTT)
// {
// maxRTT = rit->mRTT;
// }
// }
// if (minTS > rit->mTS)
// {
// minTS = rit->mTS;
// }
// if (maxTS < rit->mTS)
// {
// maxTS = rit->mTS;
// }
// }
//
// info[*it] = results;
// }
//
//
// _tst_CW->updateRttStatistics(info, maxRTT, minTS, maxTS);
// _tst_CW->update();
//}
QString RttStatistics::getPeerName(const RsPeerId& peer_id) QString RttStatistics::getPeerName(const RsPeerId& peer_id)
{ {

View file

@ -25,10 +25,27 @@
#include <retroshare/rsrtt.h> #include <retroshare/rsrtt.h>
#include "ui_RttStatistics.h" #include "ui_RttStatistics.h"
#include "RsAutoUpdatePage.h" #include "RsAutoUpdatePage.h"
#include <gui/common/RSGraphWidget.h>
class RttStatisticsWidget ; class RttStatisticsWidget ;
class RttStatistics: public RsAutoUpdatePage, public Ui::RttStatistics class RttGraphSource: public RSGraphSource
{
public:
RttGraphSource() ;
virtual void getValues(std::map<std::string,float>& vals) ;
};
class RttStatisticsGraph: public RSGraphWidget
{
public:
RttStatisticsGraph()
{
}
};
class RttStatistics: public MainPage, public Ui::RttStatistics
{ {
public: public:
RttStatistics(QWidget *parent = NULL) ; RttStatistics(QWidget *parent = NULL) ;
@ -42,9 +59,7 @@ class RttStatistics: public RsAutoUpdatePage, public Ui::RttStatistics
void processSettings(bool bLoad); void processSettings(bool bLoad);
bool m_bProcessSettings; bool m_bProcessSettings;
virtual void updateDisplay() ; RttStatisticsGraph *_tst_CW ;
RttStatisticsWidget *_tst_CW ;
} ; } ;
class RttStatisticsWidget: public QWidget class RttStatisticsWidget: public QWidget
@ -66,3 +81,6 @@ class RttStatisticsWidget: public QWidget
int maxWidth,maxHeight ; int maxWidth,maxHeight ;
}; };

View file

@ -136,11 +136,8 @@ void StatisticsWindow::initStackedPage()
ui->stackPages->add(grsdlg = new GlobalRouterStatistics(ui->stackPages), ui->stackPages->add(grsdlg = new GlobalRouterStatistics(ui->stackPages),
action = createPageAction(QIcon(IMAGE_GLOBALROUTER), tr("Global Router"), grp)); action = createPageAction(QIcon(IMAGE_GLOBALROUTER), tr("Global Router"), grp));
#ifdef SHOW_RTT_STATISTICS
ui->stackPages->add(rttdlg = new RttStatistics(ui->stackPages), ui->stackPages->add(rttdlg = new RttStatistics(ui->stackPages),
action = createPageAction(QIcon(IMAGE_RTT), tr("RTT Statistics"), grp)); action = createPageAction(QIcon(IMAGE_RTT), tr("RTT Statistics"), grp));
#endif
/*std::cerr << "Looking for interfaces in existing plugins:" << std::endl; /*std::cerr << "Looking for interfaces in existing plugins:" << std::endl;
for(int i = 0;i<rsPlugins->nbPlugins();++i) for(int i = 0;i<rsPlugins->nbPlugins();++i)

View file

@ -33,24 +33,26 @@ class DHTGraphSource: public RSGraphSource
public: public:
virtual int n_values() const virtual int n_values() const
{ {
return 2 ; return 1 ;
} }
virtual void getValues(std::vector<float>& values) const virtual void getValues(std::map<std::string,float>& values) const
{ {
RsConfigNetStatus config; RsConfigNetStatus config;
rsConfig->getConfigNetStatus(config); rsConfig->getConfigNetStatus(config);
if (config.DHTActive && config.netDhtOk) if (config.DHTActive && config.netDhtOk)
{ {
values.push_back(config.netDhtRsNetSize) ; values.insert(std::make_pair(std::string("RS Net size"),(float)config.netDhtRsNetSize)) ;
values.push_back(config.netDhtNetSize) ; //values.insert(std::make_pair(std::string("GLobal Net size"),(float)config.netDhtNetSize)) ;
} }
else else
{ {
values.push_back(0.0f) ; values.insert(std::make_pair(std::string("RS Net size"),0.0f)) ;
values.push_back(0.0f) ; //values.insert(std::make_pair(std::string("GLobal Net size"),0.0f)) ;
} }
} }
virtual QString unitName() const { return tr("users"); }
}; };
/** Default contructor */ /** Default contructor */
@ -65,7 +67,8 @@ DhtGraph::DhtGraph(QWidget *parent)
addSource(src) ; addSource(src) ;
setTimeScale(10.0f) ; setTimeScale(1.0f) ; // 1 pixels per second of time.
resetFlags(RSGRAPH_FLAGS_LOG_SCALE_Y) ;
} }