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

Commit 7489d6af authored by Olivier Gaillard's avatar Olivier Gaillard Committed by Android (Google) Code Review
Browse files

Merge "Tracks the total number of buckets."

parents 523fdc67 f248c0d4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -493,6 +493,11 @@ void StatsdStats::noteInvalidatedBucket(int64_t metricId) {
    getAtomMetricStats(metricId).invalidatedBucket++;
}

void StatsdStats::noteBucketCount(int64_t metricId) {
    lock_guard<std::mutex> lock(mLock);
    getAtomMetricStats(metricId).bucketCount++;
}

void StatsdStats::noteBucketBoundaryDelayNs(int64_t metricId, int64_t timeDelayNs) {
    lock_guard<std::mutex> lock(mLock);
    AtomMetricStats& pullStats = getAtomMetricStats(metricId);
+6 −0
Original line number Diff line number Diff line
@@ -402,6 +402,11 @@ public:
     */
    void noteInvalidatedBucket(int64_t metricId);

    /**
     * Tracks the total number of buckets (include skipped/invalid buckets).
     */
    void noteBucketCount(int64_t metricId);

    /**
     * For pulls at bucket boundaries, it represents the misalignment between the real timestamp and
     * the end of the bucket.
@@ -464,6 +469,7 @@ public:
        int64_t minBucketBoundaryDelayNs = 0;
        int64_t maxBucketBoundaryDelayNs = 0;
        long bucketUnknownCondition = 0;
        long bucketCount = 0;
    } AtomMetricStats;

private:
+1 −0
Original line number Diff line number Diff line
@@ -371,6 +371,7 @@ void CountMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs,
        }
    }

    StatsdStats::getInstance().noteBucketCount(mMetricId);
    // 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>();
+1 −0
Original line number Diff line number Diff line
@@ -601,6 +601,7 @@ void DurationMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs
            whatIt++;
        }
    }
    StatsdStats::getInstance().noteBucketCount(mMetricId);
}

void DurationMetricProducer::dumpStatesLocked(FILE* out, bool verbose) const {
+1 −0
Original line number Diff line number Diff line
@@ -576,6 +576,7 @@ void GaugeMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs,
        }
    }

    StatsdStats::getInstance().noteBucketCount(mMetricId);
    mCurrentSlicedBucket = std::make_shared<DimToGaugeAtomsMap>();
}

Loading