Dash Core  0.12.2.1
P2P Digital Currency
TrafficGraphData Class Reference

#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< TrafficSampleSampleQueue
 
typedef QHash< GraphRange, SampleQueueSampleQueueMap
 

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)
 
TrafficGraphDataoperator= (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

Definition at line 52 of file trafficgraphdata.h.

◆ 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]

TrafficGraphData::TrafficGraphData ( const TrafficGraphData that)
private

Member Function Documentation

◆ clear()

void TrafficGraphData::clear ( )

Definition at line 262 of file trafficgraphdata.cpp.

Referenced by TrafficGraphWidget::clear().

◆ converSampletoBandwith()

float TrafficGraphData::converSampletoBandwith ( float  dataAmount)
private

Definition at line 240 of file trafficgraphdata.cpp.

Referenced by getCurrentRangeQueueWithAverageBandwidth().

◆ getCurrentRangeQueue()

TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueue ( )

Definition at line 232 of file trafficgraphdata.cpp.

◆ getCurrentRangeQueueWithAverageBandwidth()

TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueueWithAverageBandwidth ( )

◆ getRangeQueue()

TrafficGraphData::SampleQueue TrafficGraphData::getRangeQueue ( GraphRange  range)

◆ operator=()

TrafficGraphData& TrafficGraphData::operator= ( TrafficGraphData const &  )
private

◆ setLastBytes()

void TrafficGraphData::setLastBytes ( quint64  nLastBytesIn,
quint64  nLastBytesOut 
)

◆ sumEach2Samples()

TrafficGraphData::SampleQueue TrafficGraphData::sumEach2Samples ( const SampleQueue rangeQueue)
private

Definition at line 126 of file trafficgraphdata.cpp.

Referenced by getRangeQueue().

◆ sumEach3Samples()

TrafficGraphData::SampleQueue TrafficGraphData::sumEach3Samples ( const SampleQueue rangeQueue,
GraphRange  range 
)
private

Definition at line 138 of file trafficgraphdata.cpp.

Referenced by getRangeQueue().

◆ switchRange()

void TrafficGraphData::switchRange ( GraphRange  newRange)

Definition at line 120 of file trafficgraphdata.cpp.

Referenced by TrafficGraphWidget::setGraphRangeMins().

◆ tryAddingSampleToStash()

void TrafficGraphData::tryAddingSampleToStash ( GraphRange  range)
private

Definition at line 29 of file trafficgraphdata.cpp.

Referenced by update().

◆ tryUpdateNextWithLast2Samples()

void TrafficGraphData::tryUpdateNextWithLast2Samples ( GraphRange  range,
GraphRange  nextRange 
)
private

Definition at line 37 of file trafficgraphdata.cpp.

Referenced by update().

◆ tryUpdateNextWithLast3Samples()

void TrafficGraphData::tryUpdateNextWithLast3Samples ( GraphRange  range,
GraphRange  nextRange 
)
private

Definition at line 45 of file trafficgraphdata.cpp.

Referenced by update().

◆ update() [1/3]

bool TrafficGraphData::update ( const TrafficSample trafficSample)

◆ update() [2/3]

bool TrafficGraphData::update ( quint64  totalBytesRecv,
quint64  totalBytesSent 
)

Definition at line 59 of file trafficgraphdata.cpp.

◆ update() [3/3]

void TrafficGraphData::update ( GraphRange  range,
const TrafficSample trafficSample 
)
private

Definition at line 81 of file trafficgraphdata.cpp.

Member Data Documentation

◆ currentGraphRange

GraphRange TrafficGraphData::currentGraphRange
private

◆ currentSampleCounter

int TrafficGraphData::currentSampleCounter
private

Definition at line 72 of file trafficgraphdata.h.

Referenced by clear(), switchRange(), and update().

◆ DESIRED_DATA_SAMPLES

const int TrafficGraphData::DESIRED_DATA_SAMPLES = 800
static

◆ DesiredQueueSizes

◆ nLastBytesIn

quint64 TrafficGraphData::nLastBytesIn
private

Definition at line 74 of file trafficgraphdata.h.

Referenced by clear(), setLastBytes(), and update().

◆ nLastBytesOut

quint64 TrafficGraphData::nLastBytesOut
private

Definition at line 75 of file trafficgraphdata.h.

Referenced by clear(), setLastBytes(), and update().

◆ RangeMinutes

const int TrafficGraphData::RangeMinutes = {5,10,15,30,60,120,180,360,720,1440}
static

◆ sampleMap

SampleQueueMap TrafficGraphData::sampleMap
private

◆ sampleStash

SampleQueueMap TrafficGraphData::sampleStash
private

◆ SMALLEST_SAMPLE_PERIOD

const int TrafficGraphData::SMALLEST_SAMPLE_PERIOD
static

The documentation for this class was generated from the following files: