summaryrefslogtreecommitdiff
path: root/cmds/statsd/src/metrics/MetricsManager.cpp
diff options
context:
space:
mode:
authorTej Singh <singhtejinder@google.com>2019-06-24 11:58:23 -0700
committerTej Singh <singhtejinder@google.com>2019-06-25 13:52:58 -0700
commit16ca28fc8ebc47a7863dc3c3e6c7048a4be04ba8 (patch)
tree3cc2437c071f4a385634af36939010197e32f90a /cmds/statsd/src/metrics/MetricsManager.cpp
parent2c824e3a7ae4c2c130f6cdf5543a385e59c2acfd (diff)
StatsdStats: improve activation time logging
Add logging to record whenever the 10 second guardrail for sending active configs changed broadcast is met, so that we know when the broadcast would not have been sent. Add activation time for configs that are active when the device boots. This will help determine whether or not statsd thinks configs are active and will help debug issues like b/133809948 Bug: 133809948 Test: bit statsd_test:* Test: manually rebooted to make sure activation time was logged Change-Id: Ifa72202bc52485e4953e49d78dffea685cc3d1e7
Diffstat (limited to 'cmds/statsd/src/metrics/MetricsManager.cpp')
-rw-r--r--cmds/statsd/src/metrics/MetricsManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds/statsd/src/metrics/MetricsManager.cpp b/cmds/statsd/src/metrics/MetricsManager.cpp
index 207a7dd87215..963205ee56f4 100644
--- a/cmds/statsd/src/metrics/MetricsManager.cpp
+++ b/cmds/statsd/src/metrics/MetricsManager.cpp
@@ -521,6 +521,10 @@ void MetricsManager::loadActiveConfig(const ActiveConfig& config, int64_t curren
if (metric->getMetricId() == activeMetric.id()) {
VLOG("Setting active metric: %lld", (long long)metric->getMetricId());
metric->loadActiveMetric(activeMetric, currentTimeNs);
+ if (!mIsActive && metric->isActive()) {
+ StatsdStats::getInstance().noteActiveStatusChanged(mConfigKey,
+ /*activate=*/ true);
+ }
mIsActive |= metric->isActive();
}
}