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

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

Merge "Skip writing metrics to disk if it's entirely composed of no_report_metric" into pi-dev

parents 7c3c4d38 028091cb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -503,7 +503,8 @@ void StatsLogProcessor::flushIfNecessaryLocked(
void StatsLogProcessor::WriteDataToDiskLocked(const ConfigKey& key,
                                              const int64_t timestampNs,
                                              const DumpReportReason dumpReportReason) {
    if (mMetricsManagers.find(key) == mMetricsManagers.end()) {
    if (mMetricsManagers.find(key) == mMetricsManagers.end() ||
        !mMetricsManagers.find(key)->second->shouldWriteToDisk()) {
        return;
    }
    ProtoOutputStream proto;
+4 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@ public:
        return !mAllowedPkg.empty();
    }

    bool shouldWriteToDisk() const {
        return mNoReportMetricIds.size() != mAllMetricProducers.size();
    }

    void dumpStates(FILE* out, bool verbose);

    inline bool isInTtl(const int64_t timestampNs) const {