CMSDK  2.0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cmlabs::MovingAverage Class Reference

Public Member Functions

 MovingAverage (uint32 binTimeMS=100, uint16 binCount=600)
 
bool add (double val, uint32 count=1, uint64 time=GetTimeNow())
 
bool getThroughput (uint32 ms, double &valPerSec, double &countPerSec, uint64 now=GetTimeNow())
 
bool getThroughputMulti (uint32 ms1, uint32 ms2, uint32 ms3, double &valPerSec1, double &countPerSec1, double &valPerSec2, double &countPerSec2, double &valPerSec3, double &countPerSec3, uint64 now=GetTimeNow())
 
bool getAverage (uint32 ms, double &val, uint64 &count, uint64 now=GetTimeNow())
 
bool getAverageMulti (uint32 ms1, uint32 ms2, uint32 ms3, double &avg1, uint64 &count1, double &avg2, uint64 &count2, double &avg3, uint64 &count3, uint64 now=GetTimeNow())
 
bool getSum (uint32 ms, double &val, uint64 &count, uint64 now=GetTimeNow())
 
bool getSumMulti (uint32 ms1, uint32 ms2, uint32 ms3, double &sum1, uint64 &count1, double &sum2, uint64 &count2, double &sum3, uint64 &count3, uint64 now=GetTimeNow())
 
bool getTotal (double &val, uint64 &count)
 
std::string getPerfXML (uint32 binMS=1000, uint32 binNum=60)
 
std::string getPerfJSON (uint32 binMS=1000, uint32 binNum=60)
 

Static Public Member Functions

static bool UnitTest ()
 

Protected Member Functions

bool shiftBins (uint64 now)
 

Protected Attributes

StatEntryentries
 
utils::Mutex mutex
 
uint32 binTime
 
uint32 binCount
 
uint32 currentBin
 
uint64 currentBinStart
 
double totalValue
 
uint64 totalCount
 

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