summaryrefslogtreecommitdiff
path: root/cmds/statsd/src/metrics/MetricsManager.cpp
diff options
context:
space:
mode:
authorBookatz <bookatz@google.com>2018-09-20 17:17:49 -0700
committerBookatz <bookatz@google.com>2018-11-05 18:52:49 -0800
commitff71cadecc43ff034be0500ca0232873bf7212c6 (patch)
tree0d816d0dd36c527239e3b4ec6aff9f6b8cdaead4 /cmds/statsd/src/metrics/MetricsManager.cpp
parent5f106c8ee5dcacd2f30a2644b6fdf3caa2116e2d (diff)
Statsd can dump data as proto to bugreport
* Creates an incident section for statsd data. * Allows dump to output statsd data, in proto format. * Hooks up two statsd outputs to bugreports: -statsd report data in proto format -statsd metadata (statsdstats) in text format The incident section does not import stats_log.proto because that turns out to be extremely difficult: stats_log.proto imports atoms.proto, which imports more things and is enormous and causes all sorts of problems. atoms.proto was purposefully never compiled in AOSP, so to retain that feature, the incident section uses 'bytes' instead of an actual message. Since this isn't ever read in AOSP (other than testing), this should be fine. Bug: 115678461 Test: take a bug report and confirm valid proto Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests#testDumpsysStats Change-Id: I1c370af7678d1dc7440ce299ea5ea4da6d33832b
Diffstat (limited to 'cmds/statsd/src/metrics/MetricsManager.cpp')
-rw-r--r--cmds/statsd/src/metrics/MetricsManager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmds/statsd/src/metrics/MetricsManager.cpp b/cmds/statsd/src/metrics/MetricsManager.cpp
index f85ba1f93e8c..4244d5bed23b 100644
--- a/cmds/statsd/src/metrics/MetricsManager.cpp
+++ b/cmds/statsd/src/metrics/MetricsManager.cpp
@@ -197,6 +197,7 @@ void MetricsManager::dropData(const int64_t dropTimeNs) {
void MetricsManager::onDumpReport(const int64_t dumpTimeStampNs,
const bool include_current_partial_bucket,
+ const bool erase_data,
std::set<string> *str_set,
ProtoOutputStream* protoOutput) {
VLOG("=========================Metric Reports Start==========================");
@@ -206,11 +207,11 @@ void MetricsManager::onDumpReport(const int64_t dumpTimeStampNs,
uint64_t token = protoOutput->start(
FIELD_TYPE_MESSAGE | FIELD_COUNT_REPEATED | FIELD_ID_METRICS);
if (mHashStringsInReport) {
- producer->onDumpReport(dumpTimeStampNs, include_current_partial_bucket, str_set,
- protoOutput);
+ producer->onDumpReport(dumpTimeStampNs, include_current_partial_bucket, erase_data,
+ str_set, protoOutput);
} else {
- producer->onDumpReport(dumpTimeStampNs, include_current_partial_bucket, nullptr,
- protoOutput);
+ producer->onDumpReport(dumpTimeStampNs, include_current_partial_bucket, erase_data,
+ nullptr, protoOutput);
}
protoOutput->end(token);
} else {