Some fixes in StatsdStats, and add some unit tests
+ Add timestamp for when metric data is reported.
Test: statsd_test
Change-Id: Ief5ec5172feed4ec74b7422b77cf69ec8361ef2f
diff --git a/cmds/statsd/src/StatsLogProcessor.cpp b/cmds/statsd/src/StatsLogProcessor.cpp
index 2690c7e..7f4d67a 100644
--- a/cmds/statsd/src/StatsLogProcessor.cpp
+++ b/cmds/statsd/src/StatsLogProcessor.cpp
@@ -201,6 +201,7 @@
iter.rp()->move(toRead);
}
}
+ StatsdStats::getInstance().noteMetricsReportSent(key);
}
void StatsLogProcessor::OnConfigRemoved(const ConfigKey& key) {
@@ -236,7 +237,7 @@
} else if (totalBytes > kMaxSerializedBytes) { // Too late. We need to start clearing data.
// We ignore the return value so we force each metric producer to clear its contents.
metricsManager->onDumpReport();
- StatsdStats::getInstance().noteDataDrop(key);
+ StatsdStats::getInstance().noteDataDropped(key);
VLOG("StatsD had to toss out metrics for %s", key.ToString().c_str());
}
}