Loading cmds/statsd/src/metrics/CountMetricProducer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -122,11 +122,11 @@ CountMetricProducer::~CountMetricProducer() { } void CountMetricProducer::onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, int oldState, int newState) { const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState) { VLOG("CountMetric %lld onStateChanged time %lld, State%d, key %s, %d -> %d", (long long)mMetricId, (long long)eventTimeNs, atomId, primaryKey.toString().c_str(), oldState, newState); oldState.mValue.int_value, newState.mValue.int_value); } void CountMetricProducer::dumpStatesLocked(FILE* out, bool verbose) const { Loading cmds/statsd/src/metrics/CountMetricProducer.h +2 −2 Original line number Diff line number Diff line Loading @@ -53,8 +53,8 @@ public: virtual ~CountMetricProducer(); void onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, int oldState, int newState) override; const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState) override; protected: void onMatchedLogEventInternalLocked( Loading cmds/statsd/src/metrics/DurationMetricProducer.cpp +5 −6 Original line number Diff line number Diff line Loading @@ -161,13 +161,12 @@ sp<AnomalyTracker> DurationMetricProducer::addAnomalyTracker( void DurationMetricProducer::onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, const int32_t oldState, const int32_t newState) { // Create a FieldValue object to hold the new state. FieldValue value; value.mValue.setInt(newState); const FieldValue& oldState, const FieldValue& newState) { // Check if this metric has a StateMap. If so, map the new state value to // the correct state group id. mapStateValue(atomId, &value); FieldValue newStateCopy = newState; mapStateValue(atomId, &newStateCopy); flushIfNeededLocked(eventTimeNs); Loading @@ -185,7 +184,7 @@ void DurationMetricProducer::onStateChanged(const int64_t eventTimeNs, const int if (!containsLinkedStateValues(whatIt.first, primaryKey, mMetric2StateLinks, atomId)) { continue; } whatIt.second->onStateChanged(eventTimeNs, atomId, value); whatIt.second->onStateChanged(eventTimeNs, atomId, newStateCopy); } } Loading cmds/statsd/src/metrics/DurationMetricProducer.h +2 −2 Original line number Diff line number Diff line Loading @@ -55,8 +55,8 @@ public: const sp<AlarmMonitor>& anomalyAlarmMonitor) override; void onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, const int32_t oldState, const int32_t newState) override; const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState) override; protected: void onMatchedLogEventLocked(const size_t matcherIndex, const LogEvent& event) override; Loading cmds/statsd/src/metrics/MetricProducer.h +2 −2 Original line number Diff line number Diff line Loading @@ -182,8 +182,8 @@ public: }; void onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, const int32_t oldState, const int32_t newState){}; const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState){}; // Output the metrics data to [protoOutput]. All metrics reports end with the same timestamp. // This method clears all the past buckets. Loading Loading
cmds/statsd/src/metrics/CountMetricProducer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -122,11 +122,11 @@ CountMetricProducer::~CountMetricProducer() { } void CountMetricProducer::onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, int oldState, int newState) { const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState) { VLOG("CountMetric %lld onStateChanged time %lld, State%d, key %s, %d -> %d", (long long)mMetricId, (long long)eventTimeNs, atomId, primaryKey.toString().c_str(), oldState, newState); oldState.mValue.int_value, newState.mValue.int_value); } void CountMetricProducer::dumpStatesLocked(FILE* out, bool verbose) const { Loading
cmds/statsd/src/metrics/CountMetricProducer.h +2 −2 Original line number Diff line number Diff line Loading @@ -53,8 +53,8 @@ public: virtual ~CountMetricProducer(); void onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, int oldState, int newState) override; const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState) override; protected: void onMatchedLogEventInternalLocked( Loading
cmds/statsd/src/metrics/DurationMetricProducer.cpp +5 −6 Original line number Diff line number Diff line Loading @@ -161,13 +161,12 @@ sp<AnomalyTracker> DurationMetricProducer::addAnomalyTracker( void DurationMetricProducer::onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, const int32_t oldState, const int32_t newState) { // Create a FieldValue object to hold the new state. FieldValue value; value.mValue.setInt(newState); const FieldValue& oldState, const FieldValue& newState) { // Check if this metric has a StateMap. If so, map the new state value to // the correct state group id. mapStateValue(atomId, &value); FieldValue newStateCopy = newState; mapStateValue(atomId, &newStateCopy); flushIfNeededLocked(eventTimeNs); Loading @@ -185,7 +184,7 @@ void DurationMetricProducer::onStateChanged(const int64_t eventTimeNs, const int if (!containsLinkedStateValues(whatIt.first, primaryKey, mMetric2StateLinks, atomId)) { continue; } whatIt.second->onStateChanged(eventTimeNs, atomId, value); whatIt.second->onStateChanged(eventTimeNs, atomId, newStateCopy); } } Loading
cmds/statsd/src/metrics/DurationMetricProducer.h +2 −2 Original line number Diff line number Diff line Loading @@ -55,8 +55,8 @@ public: const sp<AlarmMonitor>& anomalyAlarmMonitor) override; void onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, const int32_t oldState, const int32_t newState) override; const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState) override; protected: void onMatchedLogEventLocked(const size_t matcherIndex, const LogEvent& event) override; Loading
cmds/statsd/src/metrics/MetricProducer.h +2 −2 Original line number Diff line number Diff line Loading @@ -182,8 +182,8 @@ public: }; void onStateChanged(const int64_t eventTimeNs, const int32_t atomId, const HashableDimensionKey& primaryKey, const int32_t oldState, const int32_t newState){}; const HashableDimensionKey& primaryKey, const FieldValue& oldState, const FieldValue& newState){}; // Output the metrics data to [protoOutput]. All metrics reports end with the same timestamp. // This method clears all the past buckets. Loading