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

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

Merge "Track the number of buckets dropped."

parents c63d6c2a 320952bf
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -443,6 +443,11 @@ void StatsdStats::noteBadValueType(int metricId) {
    getAtomMetricStats(metricId).badValueType++;
    getAtomMetricStats(metricId).badValueType++;
}
}


void StatsdStats::noteBucketDropped(int metricId) {
    lock_guard<std::mutex> lock(mLock);
    getAtomMetricStats(metricId).bucketDropped++;
}

void StatsdStats::noteConditionChangeInNextBucket(int metricId) {
void StatsdStats::noteConditionChangeInNextBucket(int metricId) {
    lock_guard<std::mutex> lock(mLock);
    lock_guard<std::mutex> lock(mLock);
    getAtomMetricStats(metricId).conditionChangeInNextBucket++;
    getAtomMetricStats(metricId).conditionChangeInNextBucket++;
+6 −0
Original line number Original line Diff line number Diff line
@@ -359,6 +359,11 @@ public:
     */
     */
    void noteBadValueType(int atomId);
    void noteBadValueType(int atomId);


    /**
     * Buckets were dropped due to reclaim memory.
     */
    void noteBucketDropped(int metricId);

    /**
    /**
     * A condition change was too late, arrived in the wrong bucket and was skipped
     * A condition change was too late, arrived in the wrong bucket and was skipped
     */
     */
@@ -414,6 +419,7 @@ public:
        long badValueType = 0;
        long badValueType = 0;
        long conditionChangeInNextBucket = 0;
        long conditionChangeInNextBucket = 0;
        long invalidatedBucket = 0;
        long invalidatedBucket = 0;
        long bucketDropped = 0;
    } AtomMetricStats;
    } AtomMetricStats;


private:
private:
+1 −0
Original line number Original line Diff line number Diff line
@@ -243,6 +243,7 @@ void CountMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs,


void CountMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
void CountMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
    flushIfNeededLocked(dropTimeNs);
    flushIfNeededLocked(dropTimeNs);
    StatsdStats::getInstance().noteBucketDropped(mMetricId);
    mPastBuckets.clear();
    mPastBuckets.clear();
}
}


+1 −0
Original line number Original line Diff line number Diff line
@@ -444,6 +444,7 @@ void DurationMetricProducer::onConditionChangedLocked(const bool conditionMet,


void DurationMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
void DurationMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
    flushIfNeededLocked(dropTimeNs);
    flushIfNeededLocked(dropTimeNs);
    StatsdStats::getInstance().noteBucketDropped(mMetricId);
    mPastBuckets.clear();
    mPastBuckets.clear();
}
}


+1 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ EventMetricProducer::~EventMetricProducer() {


void EventMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
void EventMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
    mProto->clear();
    mProto->clear();
    StatsdStats::getInstance().noteBucketDropped(mMetricId);
}
}


void EventMetricProducer::onSlicedConditionMayChangeLocked(bool overallCondition,
void EventMetricProducer::onSlicedConditionMayChangeLocked(bool overallCondition,
Loading