Loading cmds/statsd/src/metrics/CountMetricProducer.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -319,10 +319,11 @@ void CountMetricProducer::flushIfNeededLocked(const int64_t& eventTimeNs) { return; } flushCurrentBucketLocked(eventTimeNs, eventTimeNs); // Setup the bucket start time and number. int64_t numBucketsForward = 1 + (eventTimeNs - currentBucketEndTimeNs) / mBucketSizeNs; mCurrentBucketStartTimeNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; int64_t nextBucketNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; flushCurrentBucketLocked(eventTimeNs, nextBucketNs); mCurrentBucketNum += numBucketsForward; VLOG("metric %lld: new bucket start time: %lld", (long long)mMetricId, (long long)mCurrentBucketStartTimeNs); Loading Loading @@ -375,6 +376,7 @@ void CountMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs, // Only resets the counters, but doesn't setup the times nor numbers. // (Do not clear since the old one is still referenced in mAnomalyTrackers). mCurrentSlicedCounter = std::make_shared<DimToValMap>(); mCurrentBucketStartTimeNs = nextBucketStartTimeNs; } // Rough estimate of CountMetricProducer buffer stored. This number will be Loading cmds/statsd/src/metrics/DurationMetricProducer.cpp +4 −19 Original line number Diff line number Diff line Loading @@ -559,26 +559,10 @@ void DurationMetricProducer::flushIfNeededLocked(const int64_t& eventTimeNs) { return; } VLOG("flushing..........."); for (auto whatIt = mCurrentSlicedDurationTrackerMap.begin(); whatIt != mCurrentSlicedDurationTrackerMap.end();) { for (auto it = whatIt->second.begin(); it != whatIt->second.end();) { if (it->second->flushIfNeeded(eventTimeNs, &mPastBuckets)) { VLOG("erase bucket for key %s %s", whatIt->first.toString().c_str(), it->first.toString().c_str()); it = whatIt->second.erase(it); } else { ++it; } } if (whatIt->second.empty()) { whatIt = mCurrentSlicedDurationTrackerMap.erase(whatIt); } else { whatIt++; } } int numBucketsForward = 1 + (eventTimeNs - currentBucketEndTimeNs) / mBucketSizeNs; mCurrentBucketStartTimeNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; int64_t nextBucketNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; flushCurrentBucketLocked(eventTimeNs, nextBucketNs); mCurrentBucketNum += numBucketsForward; } Loading @@ -602,6 +586,7 @@ void DurationMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs } } StatsdStats::getInstance().noteBucketCount(mMetricId); mCurrentBucketStartTimeNs = nextBucketStartTimeNs; } void DurationMetricProducer::dumpStatesLocked(FILE* out, bool verbose) const { Loading cmds/statsd/src/metrics/GaugeMetricProducer.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -529,11 +529,11 @@ void GaugeMetricProducer::flushIfNeededLocked(const int64_t& eventTimeNs) { return; } flushCurrentBucketLocked(eventTimeNs, eventTimeNs); // Adjusts the bucket start and end times. int64_t numBucketsForward = 1 + (eventTimeNs - currentBucketEndTimeNs) / mBucketSizeNs; mCurrentBucketStartTimeNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; int64_t nextBucketNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; flushCurrentBucketLocked(eventTimeNs, nextBucketNs); mCurrentBucketNum += numBucketsForward; VLOG("Gauge metric %lld: new bucket start time: %lld", (long long)mMetricId, (long long)mCurrentBucketStartTimeNs); Loading Loading @@ -578,6 +578,7 @@ void GaugeMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs, StatsdStats::getInstance().noteBucketCount(mMetricId); mCurrentSlicedBucket = std::make_shared<DimToGaugeAtomsMap>(); mCurrentBucketStartTimeNs = nextBucketStartTimeNs; } size_t GaugeMetricProducer::byteSizeLocked() const { Loading cmds/statsd/src/metrics/ValueMetricProducer.h +1 −1 File changed.Contains only whitespace changes. Show changes Loading
cmds/statsd/src/metrics/CountMetricProducer.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -319,10 +319,11 @@ void CountMetricProducer::flushIfNeededLocked(const int64_t& eventTimeNs) { return; } flushCurrentBucketLocked(eventTimeNs, eventTimeNs); // Setup the bucket start time and number. int64_t numBucketsForward = 1 + (eventTimeNs - currentBucketEndTimeNs) / mBucketSizeNs; mCurrentBucketStartTimeNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; int64_t nextBucketNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; flushCurrentBucketLocked(eventTimeNs, nextBucketNs); mCurrentBucketNum += numBucketsForward; VLOG("metric %lld: new bucket start time: %lld", (long long)mMetricId, (long long)mCurrentBucketStartTimeNs); Loading Loading @@ -375,6 +376,7 @@ void CountMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs, // Only resets the counters, but doesn't setup the times nor numbers. // (Do not clear since the old one is still referenced in mAnomalyTrackers). mCurrentSlicedCounter = std::make_shared<DimToValMap>(); mCurrentBucketStartTimeNs = nextBucketStartTimeNs; } // Rough estimate of CountMetricProducer buffer stored. This number will be Loading
cmds/statsd/src/metrics/DurationMetricProducer.cpp +4 −19 Original line number Diff line number Diff line Loading @@ -559,26 +559,10 @@ void DurationMetricProducer::flushIfNeededLocked(const int64_t& eventTimeNs) { return; } VLOG("flushing..........."); for (auto whatIt = mCurrentSlicedDurationTrackerMap.begin(); whatIt != mCurrentSlicedDurationTrackerMap.end();) { for (auto it = whatIt->second.begin(); it != whatIt->second.end();) { if (it->second->flushIfNeeded(eventTimeNs, &mPastBuckets)) { VLOG("erase bucket for key %s %s", whatIt->first.toString().c_str(), it->first.toString().c_str()); it = whatIt->second.erase(it); } else { ++it; } } if (whatIt->second.empty()) { whatIt = mCurrentSlicedDurationTrackerMap.erase(whatIt); } else { whatIt++; } } int numBucketsForward = 1 + (eventTimeNs - currentBucketEndTimeNs) / mBucketSizeNs; mCurrentBucketStartTimeNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; int64_t nextBucketNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; flushCurrentBucketLocked(eventTimeNs, nextBucketNs); mCurrentBucketNum += numBucketsForward; } Loading @@ -602,6 +586,7 @@ void DurationMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs } } StatsdStats::getInstance().noteBucketCount(mMetricId); mCurrentBucketStartTimeNs = nextBucketStartTimeNs; } void DurationMetricProducer::dumpStatesLocked(FILE* out, bool verbose) const { Loading
cmds/statsd/src/metrics/GaugeMetricProducer.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -529,11 +529,11 @@ void GaugeMetricProducer::flushIfNeededLocked(const int64_t& eventTimeNs) { return; } flushCurrentBucketLocked(eventTimeNs, eventTimeNs); // Adjusts the bucket start and end times. int64_t numBucketsForward = 1 + (eventTimeNs - currentBucketEndTimeNs) / mBucketSizeNs; mCurrentBucketStartTimeNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; int64_t nextBucketNs = currentBucketEndTimeNs + (numBucketsForward - 1) * mBucketSizeNs; flushCurrentBucketLocked(eventTimeNs, nextBucketNs); mCurrentBucketNum += numBucketsForward; VLOG("Gauge metric %lld: new bucket start time: %lld", (long long)mMetricId, (long long)mCurrentBucketStartTimeNs); Loading Loading @@ -578,6 +578,7 @@ void GaugeMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs, StatsdStats::getInstance().noteBucketCount(mMetricId); mCurrentSlicedBucket = std::make_shared<DimToGaugeAtomsMap>(); mCurrentBucketStartTimeNs = nextBucketStartTimeNs; } size_t GaugeMetricProducer::byteSizeLocked() const { Loading
cmds/statsd/src/metrics/ValueMetricProducer.h +1 −1 File changed.Contains only whitespace changes. Show changes