diff options
author | Tej Singh <singhtejinder@google.com> | 2020-09-03 00:55:03 -0700 |
---|---|---|
committer | Tej Singh <singhtejinder@google.com> | 2020-09-16 23:34:22 -0700 |
commit | c0930f64b18fb8d49b39b1ffe54aaf0b373b54d2 (patch) | |
tree | 9339f1d892167c99cf33d20455ba45b6546f609f /cmds/statsd/src/metrics/MetricsManager.cpp | |
parent | 8423c02906161de6b745c92a6a1562345dfb5f5a (diff) |
Partial Config Update: event metric
Step 1. Determines if a metric needs to be updated
Step 2: performs the update. if the metric is replaced, it creates a new
metric. If the metric is preserved, we update the appropriate indices.
In both cases, the appropriate data structures that MetricsManager
relies on are updated.
Test: atest_statsd_test
Bug: 162322294
Change-Id: Iac24e02c70880bb8d0d42bd2da34acf84161ba16
Diffstat (limited to 'cmds/statsd/src/metrics/MetricsManager.cpp')
-rw-r--r-- | cmds/statsd/src/metrics/MetricsManager.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/cmds/statsd/src/metrics/MetricsManager.cpp b/cmds/statsd/src/metrics/MetricsManager.cpp index 39806890c42d..ab0d286d6b29 100644 --- a/cmds/statsd/src/metrics/MetricsManager.cpp +++ b/cmds/statsd/src/metrics/MetricsManager.cpp @@ -206,18 +206,33 @@ bool MetricsManager::updateConfig(const StatsdConfig& config, const int64_t time unordered_map<int64_t, int> newAtomMatchingTrackerMap; vector<sp<ConditionTracker>> newConditionTrackers; unordered_map<int64_t, int> newConditionTrackerMap; + map<int64_t, uint64_t> newStateProtoHashes; + vector<sp<MetricProducer>> newMetricProducers; + unordered_map<int64_t, int> newMetricProducerMap; mTagIds.clear(); + mConditionToMetricMap.clear(); + mTrackerToMetricMap.clear(); mTrackerToConditionMap.clear(); + mActivationAtomTrackerToMetricMap.clear(); + mDeactivationAtomTrackerToMetricMap.clear(); + mMetricIndexesWithActivation.clear(); + mNoReportMetricIds.clear(); mConfigValid = updateStatsdConfig( mConfigKey, config, mUidMap, mPullerManager, anomalyAlarmMonitor, periodicAlarmMonitor, timeBaseNs, currentTimeNs, mAllAtomMatchingTrackers, mAtomMatchingTrackerMap, - mAllConditionTrackers, mConditionTrackerMap, mTagIds, newAtomMatchingTrackers, - newAtomMatchingTrackerMap, newConditionTrackers, newConditionTrackerMap, - mTrackerToConditionMap); + mAllConditionTrackers, mConditionTrackerMap, mAllMetricProducers, mMetricProducerMap, + mStateProtoHashes, mTagIds, newAtomMatchingTrackers, newAtomMatchingTrackerMap, + newConditionTrackers, newConditionTrackerMap, newMetricProducers, newMetricProducerMap, + mConditionToMetricMap, mTrackerToMetricMap, mTrackerToConditionMap, + mActivationAtomTrackerToMetricMap, mDeactivationAtomTrackerToMetricMap, + mMetricIndexesWithActivation, newStateProtoHashes, mNoReportMetricIds); mAllAtomMatchingTrackers = newAtomMatchingTrackers; mAtomMatchingTrackerMap = newAtomMatchingTrackerMap; mAllConditionTrackers = newConditionTrackers; mConditionTrackerMap = newConditionTrackerMap; + mAllMetricProducers = newMetricProducers; + mMetricProducerMap = newMetricProducerMap; + mStateProtoHashes = newStateProtoHashes; return mConfigValid; } |