Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#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) |
quint64 | getLastBytesIn () |
quint64 | getLastBytesOut () |
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 | convertSampleToBandwidth (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 [] |
Detailed Description
Definition at line 31 of file trafficgraphdata.h.
Member Typedef Documentation
◆ SampleQueue
typedef QQueue<TrafficSample> TrafficGraphData::SampleQueue |
Definition at line 52 of file trafficgraphdata.h.
◆ SampleQueueMap
typedef QHash<GraphRange,SampleQueue> TrafficGraphData::SampleQueueMap |
Definition at line 53 of file trafficgraphdata.h.
Member Enumeration Documentation
◆ GraphRange
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.
Constructor & Destructor Documentation
◆ TrafficGraphData() [1/2]
TrafficGraphData::TrafficGraphData | ( | GraphRange | range | ) |
Definition at line 21 of file trafficgraphdata.cpp.
◆ TrafficGraphData() [2/2]
|
private |
Member Function Documentation
◆ clear()
void TrafficGraphData::clear | ( | ) |
Definition at line 263 of file trafficgraphdata.cpp.
References currentSampleCounter, nLastBytesIn, nLastBytesOut, and sampleMap.
Referenced by TrafficGraphWidget::clear().
◆ convertSampleToBandwidth()
|
private |
Definition at line 239 of file trafficgraphdata.cpp.
References currentGraphRange, Range_5m, RangeMinutes, and SMALLEST_SAMPLE_PERIOD.
Referenced by getCurrentRangeQueueWithAverageBandwidth().
◆ getCurrentRangeQueue()
TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueue | ( | ) |
Definition at line 232 of file trafficgraphdata.cpp.
References currentGraphRange, DESIRED_DATA_SAMPLES, and getRangeQueue().
◆ getCurrentRangeQueueWithAverageBandwidth()
TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueueWithAverageBandwidth | ( | ) |
Definition at line 252 of file trafficgraphdata.cpp.
References convertSampleToBandwidth(), currentGraphRange, DESIRED_DATA_SAMPLES, and getRangeQueue().
Referenced by TrafficGraphWidget::paintEvent(), and TrafficGraphWidget::updateRates().
◆ getLastBytesIn()
|
inline |
Definition at line 64 of file trafficgraphdata.h.
References nLastBytesIn.
Referenced by TrafficGraphWidget::paintEvent().
◆ getLastBytesOut()
|
inline |
Definition at line 65 of file trafficgraphdata.h.
References nLastBytesOut.
Referenced by TrafficGraphWidget::paintEvent().
◆ getRangeQueue()
TrafficGraphData::SampleQueue TrafficGraphData::getRangeQueue | ( | GraphRange | range | ) |
Definition at line 175 of file trafficgraphdata.cpp.
References Range_10m, Range_12h, Range_15m, Range_1h, Range_24h, Range_2h, Range_30m, Range_3h, Range_5m, Range_6h, sampleMap, sumEach2Samples(), and sumEach3Samples().
Referenced by getCurrentRangeQueue(), and getCurrentRangeQueueWithAverageBandwidth().
◆ operator=()
|
private |
◆ setLastBytes()
void TrafficGraphData::setLastBytes | ( | quint64 | nLastBytesIn, |
quint64 | nLastBytesOut | ||
) |
Definition at line 53 of file trafficgraphdata.cpp.
References nLastBytesIn, and nLastBytesOut.
Referenced by TrafficGraphWidget::clear(), and TrafficGraphWidget::setClientModel().
◆ sumEach2Samples()
|
private |
Definition at line 134 of file trafficgraphdata.cpp.
Referenced by getRangeQueue().
◆ sumEach3Samples()
|
private |
Definition at line 146 of file trafficgraphdata.cpp.
References DESIRED_DATA_SAMPLES, sampleStash, and sum.
Referenced by getRangeQueue().
◆ switchRange()
void TrafficGraphData::switchRange | ( | GraphRange | newRange | ) |
Definition at line 128 of file trafficgraphdata.cpp.
References currentGraphRange, and currentSampleCounter.
Referenced by TrafficGraphWidget::setGraphRangeMins().
◆ tryAddingSampleToStash()
|
private |
Definition at line 29 of file trafficgraphdata.cpp.
References DesiredQueueSizes, sampleMap, and sampleStash.
Referenced by update().
◆ tryUpdateNextWithLast2Samples()
|
private |
Definition at line 37 of file trafficgraphdata.cpp.
References DesiredQueueSizes, sampleMap, and update().
Referenced by update().
◆ tryUpdateNextWithLast3Samples()
|
private |
Definition at line 45 of file trafficgraphdata.cpp.
References sampleStash, and update().
Referenced by update().
◆ update() [1/3]
bool TrafficGraphData::update | ( | const TrafficSample & | trafficSample | ) |
Definition at line 68 of file trafficgraphdata.cpp.
References currentGraphRange, currentSampleCounter, Range_5m, and RangeMinutes.
Referenced by tryUpdateNextWithLast2Samples(), tryUpdateNextWithLast3Samples(), update(), and TrafficGraphWidget::updateRates().
◆ update() [2/3]
bool TrafficGraphData::update | ( | quint64 | totalBytesRecv, |
quint64 | totalBytesSent | ||
) |
Definition at line 59 of file trafficgraphdata.cpp.
References nLastBytesIn, nLastBytesOut, and update().
◆ update() [3/3]
|
private |
Definition at line 81 of file trafficgraphdata.cpp.
References DesiredQueueSizes, Range_10m, Range_12h, Range_15m, Range_1h, Range_24h, Range_2h, Range_30m, Range_3h, Range_5m, Range_6h, sampleMap, tryAddingSampleToStash(), tryUpdateNextWithLast2Samples(), and tryUpdateNextWithLast3Samples().
Member Data Documentation
◆ currentGraphRange
|
private |
Definition at line 73 of file trafficgraphdata.h.
Referenced by convertSampleToBandwidth(), getCurrentRangeQueue(), getCurrentRangeQueueWithAverageBandwidth(), switchRange(), and update().
◆ currentSampleCounter
|
private |
Definition at line 74 of file trafficgraphdata.h.
Referenced by clear(), switchRange(), and update().
◆ DESIRED_DATA_SAMPLES
|
static |
Definition at line 49 of file trafficgraphdata.h.
Referenced by getCurrentRangeQueue(), getCurrentRangeQueueWithAverageBandwidth(), TrafficGraphWidget::paintPath(), and sumEach3Samples().
◆ DesiredQueueSizes
|
staticprivate |
Definition at line 68 of file trafficgraphdata.h.
Referenced by tryAddingSampleToStash(), tryUpdateNextWithLast2Samples(), and update().
◆ nLastBytesIn
|
private |
Definition at line 76 of file trafficgraphdata.h.
Referenced by clear(), getLastBytesIn(), setLastBytes(), and update().
◆ nLastBytesOut
|
private |
Definition at line 77 of file trafficgraphdata.h.
Referenced by clear(), getLastBytesOut(), setLastBytes(), and update().
◆ RangeMinutes
|
static |
Definition at line 48 of file trafficgraphdata.h.
Referenced by convertSampleToBandwidth(), RPCConsole::setTrafficGraphRange(), and update().
◆ sampleMap
|
private |
Definition at line 70 of file trafficgraphdata.h.
Referenced by clear(), getRangeQueue(), tryAddingSampleToStash(), tryUpdateNextWithLast2Samples(), and update().
◆ sampleStash
|
private |
Definition at line 71 of file trafficgraphdata.h.
Referenced by sumEach3Samples(), tryAddingSampleToStash(), and tryUpdateNextWithLast3Samples().
◆ SMALLEST_SAMPLE_PERIOD
|
static |
Definition at line 50 of file trafficgraphdata.h.
Referenced by convertSampleToBandwidth(), and TrafficGraphWidget::TrafficGraphWidget().
The documentation for this class was generated from the following files:
- src/qt/trafficgraphdata.h
- src/qt/trafficgraphdata.cpp