![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <trafficgraphdata.h>
Public Types | |
enum | GraphRange { Range_5m, Range_10m, Range_15m, Range_30m, Range_1h, Range_2h, Range_3h, Range_6h, Range_12h, Range_24h } |
typedef QQueue< TrafficSample > | SampleQueue |
typedef QHash< GraphRange, SampleQueue > | SampleQueueMap |
Public Member Functions | |
TrafficGraphData (GraphRange range) | |
bool | update (const TrafficSample &trafficSample) |
bool | update (quint64 totalBytesRecv, quint64 totalBytesSent) |
void | switchRange (GraphRange newRange) |
SampleQueue | getRangeQueue (GraphRange range) |
SampleQueue | getCurrentRangeQueue () |
SampleQueue | getCurrentRangeQueueWithAverageBandwidth () |
void | clear () |
void | setLastBytes (quint64 nLastBytesIn, quint64 nLastBytesOut) |
Static Public Attributes | |
static const int | RangeMinutes [] = {5,10,15,30,60,120,180,360,720,1440} |
static const int | DESIRED_DATA_SAMPLES = 800 |
static const int | SMALLEST_SAMPLE_PERIOD |
Private Member Functions | |
void | update (GraphRange range, const TrafficSample &trafficSample) |
void | tryAddingSampleToStash (GraphRange range) |
void | tryUpdateNextWithLast2Samples (GraphRange range, GraphRange nextRange) |
void | tryUpdateNextWithLast3Samples (GraphRange range, GraphRange nextRange) |
SampleQueue | sumEach2Samples (const SampleQueue &rangeQueue) |
SampleQueue | sumEach3Samples (const SampleQueue &rangeQueue, GraphRange range) |
float | converSampletoBandwith (float dataAmount) |
TrafficGraphData (const TrafficGraphData &that) | |
TrafficGraphData & | operator= (TrafficGraphData const &) |
Private Attributes | |
SampleQueueMap | sampleMap |
SampleQueueMap | sampleStash |
GraphRange | currentGraphRange |
int | currentSampleCounter |
quint64 | nLastBytesIn |
quint64 | nLastBytesOut |
Static Private Attributes | |
static const int | DesiredQueueSizes [] |
Definition at line 31 of file trafficgraphdata.h.
typedef QQueue<TrafficSample> TrafficGraphData::SampleQueue |
Definition at line 52 of file trafficgraphdata.h.
typedef QHash<GraphRange,SampleQueue> TrafficGraphData::SampleQueueMap |
Definition at line 53 of file trafficgraphdata.h.
Enumerator | |
---|---|
Range_5m | |
Range_10m | |
Range_15m | |
Range_30m | |
Range_1h | |
Range_2h | |
Range_3h | |
Range_6h | |
Range_12h | |
Range_24h |
Definition at line 34 of file trafficgraphdata.h.
TrafficGraphData::TrafficGraphData | ( | GraphRange | range | ) |
Definition at line 21 of file trafficgraphdata.cpp.
|
private |
void TrafficGraphData::clear | ( | ) |
Definition at line 262 of file trafficgraphdata.cpp.
Referenced by TrafficGraphWidget::clear().
|
private |
Definition at line 240 of file trafficgraphdata.cpp.
Referenced by getCurrentRangeQueueWithAverageBandwidth().
TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueue | ( | ) |
Definition at line 232 of file trafficgraphdata.cpp.
TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueueWithAverageBandwidth | ( | ) |
Definition at line 252 of file trafficgraphdata.cpp.
Referenced by TrafficGraphWidget::paintEvent(), and TrafficGraphWidget::updateRates().
TrafficGraphData::SampleQueue TrafficGraphData::getRangeQueue | ( | GraphRange | range | ) |
Definition at line 167 of file trafficgraphdata.cpp.
Referenced by getCurrentRangeQueue(), and getCurrentRangeQueueWithAverageBandwidth().
|
private |
void TrafficGraphData::setLastBytes | ( | quint64 | nLastBytesIn, |
quint64 | nLastBytesOut | ||
) |
Definition at line 53 of file trafficgraphdata.cpp.
Referenced by TrafficGraphWidget::clear(), and TrafficGraphWidget::setClientModel().
|
private |
Definition at line 126 of file trafficgraphdata.cpp.
Referenced by getRangeQueue().
|
private |
Definition at line 138 of file trafficgraphdata.cpp.
Referenced by getRangeQueue().
void TrafficGraphData::switchRange | ( | GraphRange | newRange | ) |
Definition at line 120 of file trafficgraphdata.cpp.
Referenced by TrafficGraphWidget::setGraphRangeMins().
|
private |
Definition at line 29 of file trafficgraphdata.cpp.
Referenced by update().
|
private |
Definition at line 37 of file trafficgraphdata.cpp.
Referenced by update().
|
private |
Definition at line 45 of file trafficgraphdata.cpp.
Referenced by update().
bool TrafficGraphData::update | ( | const TrafficSample & | trafficSample | ) |
Definition at line 68 of file trafficgraphdata.cpp.
Referenced by tryUpdateNextWithLast2Samples(), tryUpdateNextWithLast3Samples(), update(), and TrafficGraphWidget::updateRates().
bool TrafficGraphData::update | ( | quint64 | totalBytesRecv, |
quint64 | totalBytesSent | ||
) |
Definition at line 59 of file trafficgraphdata.cpp.
|
private |
Definition at line 81 of file trafficgraphdata.cpp.
|
private |
Definition at line 71 of file trafficgraphdata.h.
Referenced by converSampletoBandwith(), getCurrentRangeQueue(), getCurrentRangeQueueWithAverageBandwidth(), switchRange(), and update().
|
private |
Definition at line 72 of file trafficgraphdata.h.
Referenced by clear(), switchRange(), and update().
|
static |
Definition at line 49 of file trafficgraphdata.h.
Referenced by getCurrentRangeQueue(), getCurrentRangeQueueWithAverageBandwidth(), TrafficGraphWidget::paintPath(), and sumEach3Samples().
|
staticprivate |
Definition at line 66 of file trafficgraphdata.h.
Referenced by tryAddingSampleToStash(), tryUpdateNextWithLast2Samples(), and update().
|
private |
Definition at line 74 of file trafficgraphdata.h.
Referenced by clear(), setLastBytes(), and update().
|
private |
Definition at line 75 of file trafficgraphdata.h.
Referenced by clear(), setLastBytes(), and update().
|
static |
Definition at line 48 of file trafficgraphdata.h.
Referenced by converSampletoBandwith(), RPCConsole::setTrafficGraphRange(), and update().
|
private |
Definition at line 68 of file trafficgraphdata.h.
Referenced by clear(), getRangeQueue(), tryAddingSampleToStash(), tryUpdateNextWithLast2Samples(), and update().
|
private |
Definition at line 69 of file trafficgraphdata.h.
Referenced by sumEach3Samples(), tryAddingSampleToStash(), and tryUpdateNextWithLast3Samples().
|
static |
Definition at line 50 of file trafficgraphdata.h.
Referenced by converSampletoBandwith(), and TrafficGraphWidget::TrafficGraphWidget().