From 61f869e7bbf6be5e8bd5a93fe8d77d4aeb63678d Mon Sep 17 00:00:00 2001 From: Tej Singh Date: Fri, 12 Jun 2020 17:25:17 -0700 Subject: [PATCH] Incident dump does not include current bucket This is to avoid value metrics skipping buckets due to DUMP_REPORT_REQUESTED, since if the metric needs to include the current bucket under time constraints and needs to pull, it will drop the bucket since it cannot pull. Test: atest statsd_test Bug: 158879346 Change-Id: Ia61e69530456ce2b3530add03ec6e068ffb25fb5 --- cmds/statsd/src/StatsService.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp index 47bab2947aaf0..6f952f637506c 100644 --- a/cmds/statsd/src/StatsService.cpp +++ b/cmds/statsd/src/StatsService.cpp @@ -267,8 +267,11 @@ void StatsService::dumpIncidentSection(int out) { for (const ConfigKey& configKey : mConfigManager->GetAllConfigKeys()) { uint64_t reportsListToken = proto.start(FIELD_TYPE_MESSAGE | FIELD_COUNT_REPEATED | FIELD_ID_REPORTS_LIST); + // Don't include the current bucket to avoid skipping buckets. + // If we need to include the current bucket later, consider changing to NO_TIME_CONSTRAINTS + // or other alternatives to avoid skipping buckets for pulled metrics. mProcessor->onDumpReport(configKey, getElapsedRealtimeNs(), - true /* includeCurrentBucket */, false /* erase_data */, + false /* includeCurrentBucket */, false /* erase_data */, ADB_DUMP, FAST, &proto);