18 expectedCalculationInterval_(expectedCalculationInterval)
20 setNewTimeWindowForRecentResults(timeWindowForRecentResults);
87 long long latestSampleCount;
88 double latestValueSum;
89 double latestValueSumOfSquares;
90 double latestValueMin;
91 double latestValueMax;
94 double latestLastLatchedSampleValue;
107 latestSnapshotTime = currentTime;
110 lastCalculationTime_ = currentTime;
150 for (
unsigned int idx = 0; idx <
binCount_; ++idx) {
178 double sigSquared = squareAvg - avg*avg;
179 if(sigSquared > 0.0) {
193 if (recentDuration > 0) {
208 double sigSquared = squareAvg - avg*avg;
209 if(sigSquared > 0.0) {
237 for (
unsigned int idx = 0; idx <
binCount_; ++idx) {
315 static_cast<unsigned int>(
374 for (uint32_t idx = 0; idx <
binCount_; ++idx) {
375 if (sourceBinId >= binCount_) {sourceBinId = 0;}
TimePoint_t getCurrentTime()
double workingLastSampleValue_
utils::Duration_t intervalForRecentStats_
utils::Duration_t recentDuration_
std::vector< utils::TimePoint_t > binSnapshotTime_
void setNewTimeWindowForRecentResults(const utils::Duration_t &interval)
double recentValueSumOfSquares_
double lastLatchedValueRate_
double recentValueSumOfSquares
utils::Duration_t recentDuration
void addSample(const double &value=1)
std::vector< uint64_t > recentBinnedSampleCounts
double recentValueAverage
std::vector< uint64_t > binSampleCount_
void getStats(Stats &stats) const
std::vector< double > binValueSum_
std::vector< utils::TimePoint_t > recentBinnedSnapshotTimes
const utils::Duration_t expectedCalculationInterval_
std::vector< utils::Duration_t > binDuration_
double lastLatchedSampleValue_
std::vector< double > binValueMax_
boost::mutex accumulationMutex_
void calculateStatistics(const utils::TimePoint_t ¤tTime=utils::getCurrentTime())
utils::Duration_t fullDuration
utils::Duration_t fullDuration_
boost::posix_time::time_duration Duration_t
const T & max(const T &a, const T &b)
double fullValueSumOfSquares
uint64_t fullSampleCount_
double fullValueSumOfSquares_
boost::posix_time::ptime TimePoint_t
std::vector< double > recentBinnedValueSums
utils::TimePoint_t lastCalculationTime_
boost::mutex resultsMutex_
double recentValueAverage_
uint64_t workingSampleCount_
uint64_t recentSampleCount
std::vector< utils::Duration_t > recentBinnedDurations
double durationToSeconds(Duration_t const &)
void addSampleIfLarger(const double &value)
double workingValueSumOfSquares_
uint64_t recentSampleCount_
MonitoredQuantity(utils::Duration_t expectedCalculationInterval, utils::Duration_t timeWindowForRecentResults)
std::vector< double > binValueMin_
std::vector< double > binValueSumOfSquares_