Statsd config TTL
Roughly check the config every hour to see whether the ttl expired.
If so, read the config from disk and recreate the metric manager.
Test: statsd test
BUG: b/77274363
Change-Id: I16838afe5bbe966c3a0f638869751f9b59a5a259
diff --git a/cmds/statsd/src/metrics/EventMetricProducer.cpp b/cmds/statsd/src/metrics/EventMetricProducer.cpp
index 42a5a3a..d55cb3f 100644
--- a/cmds/statsd/src/metrics/EventMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/EventMetricProducer.cpp
@@ -54,7 +54,7 @@
EventMetricProducer::EventMetricProducer(const ConfigKey& key, const EventMetric& metric,
const int conditionIndex,
const sp<ConditionWizard>& wizard,
- const uint64_t startTimeNs)
+ const int64_t startTimeNs)
: MetricProducer(metric.id(), key, startTimeNs, conditionIndex, wizard) {
if (metric.links().size() > 0) {
for (const auto& link : metric.links()) {
@@ -75,12 +75,12 @@
VLOG("~EventMetricProducer() called");
}
-void EventMetricProducer::dropDataLocked(const uint64_t dropTimeNs) {
+void EventMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
mProto->clear();
}
void EventMetricProducer::onSlicedConditionMayChangeLocked(bool overallCondition,
- const uint64_t eventTime) {
+ const int64_t eventTime) {
}
std::unique_ptr<std::vector<uint8_t>> serializeProtoLocked(ProtoOutputStream& protoOutput) {
@@ -100,7 +100,7 @@
return buffer;
}
-void EventMetricProducer::onDumpReportLocked(const uint64_t dumpTimeNs,
+void EventMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs,
ProtoOutputStream* protoOutput) {
if (mProto->size() <= 0) {
return;
@@ -119,7 +119,7 @@
}
void EventMetricProducer::onConditionChangedLocked(const bool conditionMet,
- const uint64_t eventTime) {
+ const int64_t eventTime) {
VLOG("Metric %lld onConditionChanged", (long long)mMetricId);
mCondition = conditionMet;
}