Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d82216a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Small fix to anomaly tracker in statsd."

parents 97661735 c189bdcb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ void AnomalyTracker::flushPastBuckets(const int64_t& latestPastBucketNum) {

void AnomalyTracker::addPastBucket(const MetricDimensionKey& key, const int64_t& bucketValue,
                                   const int64_t& bucketNum) {
    if (mNumOfPastBuckets == 0) {
        return;
    }
    flushPastBuckets(bucketNum);

    auto& bucket = mPastBuckets[index(bucketNum)];
@@ -106,6 +109,9 @@ void AnomalyTracker::addPastBucket(const MetricDimensionKey& key, const int64_t&
void AnomalyTracker::addPastBucket(std::shared_ptr<DimToValMap> bucketValues,
                                   const int64_t& bucketNum) {
    VLOG("addPastBucket() called.");
    if (mNumOfPastBuckets == 0) {
        return;
    }
    flushPastBuckets(bucketNum);
    // Replace the oldest bucket with the new bucket we are adding.
    mPastBuckets[index(bucketNum)] = bucketValues;