Merge "Skip writing metrics to disk if it's entirely composed of no_report_metric" into pi-dev
This commit is contained in:
commit
3f57b16deb
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user