Merge "Skip writing metrics to disk if it's entirely composed of no_report_metric" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3f57b16deb
@@ -503,7 +503,8 @@ void StatsLogProcessor::flushIfNecessaryLocked(
|
|||||||
void StatsLogProcessor::WriteDataToDiskLocked(const ConfigKey& key,
|
void StatsLogProcessor::WriteDataToDiskLocked(const ConfigKey& key,
|
||||||
const int64_t timestampNs,
|
const int64_t timestampNs,
|
||||||
const DumpReportReason dumpReportReason) {
|
const DumpReportReason dumpReportReason) {
|
||||||
if (mMetricsManagers.find(key) == mMetricsManagers.end()) {
|
if (mMetricsManagers.find(key) == mMetricsManagers.end() ||
|
||||||
|
!mMetricsManagers.find(key)->second->shouldWriteToDisk()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ProtoOutputStream proto;
|
ProtoOutputStream proto;
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ public:
|
|||||||
return !mAllowedPkg.empty();
|
return !mAllowedPkg.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool shouldWriteToDisk() const {
|
||||||
|
return mNoReportMetricIds.size() != mAllMetricProducers.size();
|
||||||
|
}
|
||||||
|
|
||||||
void dumpStates(FILE* out, bool verbose);
|
void dumpStates(FILE* out, bool verbose);
|
||||||
|
|
||||||
inline bool isInTtl(const int64_t timestampNs) const {
|
inline bool isInTtl(const int64_t timestampNs) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user