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

Commit 54db2eb0 authored by yro's avatar yro Committed by android-build-merger
Browse files

Merge "Skip writing metrics to disk if it's entirely composed of...

Merge "Skip writing metrics to disk if it's entirely composed of no_report_metric" into pi-dev am: 3f57b16d
am: ef16759c

Change-Id: I68f6ff7f259acd0ac43c7e34bf259e35bcc2fd1a
parents 715b5be1 ef16759c
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 {