Loading cmds/statsd/src/external/StatsPullerManager.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -119,9 +119,9 @@ bool StatsPullerManager::PullLocked(int tagId, vector<shared_ptr<LogEvent>>* dat } bool StatsPullerManager::PullerForMatcherExists(int tagId) const { // Vendor pulled atoms might be registered after we parse the config. return isVendorPulledAtom(tagId) || kAllPullAtomInfo.find({.atomTag = tagId}) != kAllPullAtomInfo.end(); // Pulled atoms might be registered after we parse the config, so just make sure the id is in // an appropriate range. return isVendorPulledAtom(tagId) || isPulledAtom(tagId); } void StatsPullerManager::updateAlarmLocked() { Loading cmds/statsd/src/guardrail/StatsdStats.h +6 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,12 @@ public: // Maximum number of pushed atoms statsd stats will track above kMaxPushedAtomId. static const int kMaxNonPlatformPushedAtoms = 100; // Atom id that is the start of the pulled atoms. static const int kPullAtomStartTag = 10000; // Atom id that is the start of vendor atoms. static const int kVendorAtomStartTag = 100000; // Vendor pulled atom start id. static const int32_t kVendorPulledAtomStartTag = 150000; Loading cmds/statsd/src/metrics/metrics_manager_util.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -426,7 +426,6 @@ bool initMetrics(const ConfigKey& key, const StatsdConfig& config, const int64_t config.event_metric_size() + config.gauge_metric_size() + config.value_metric_size(); allMetricProducers.reserve(allMetricsCount); StatsPullerManager statsPullerManager; // Construct map from metric id to metric activation index. The map will be used to determine // the metric activation corresponding to a metric. Loading Loading @@ -661,7 +660,7 @@ bool initMetrics(const ConfigKey& key, const StatsdConfig& config, const int64_t return false; } int atomTagId = *(atomMatcher->getAtomIds().begin()); int pullTagId = statsPullerManager.PullerForMatcherExists(atomTagId) ? atomTagId : -1; int pullTagId = pullerManager->PullerForMatcherExists(atomTagId) ? atomTagId : -1; int conditionIndex = -1; if (metric.has_condition()) { Loading Loading @@ -753,7 +752,7 @@ bool initMetrics(const ConfigKey& key, const StatsdConfig& config, const int64_t return false; } int atomTagId = *(atomMatcher->getAtomIds().begin()); int pullTagId = statsPullerManager.PullerForMatcherExists(atomTagId) ? atomTagId : -1; int pullTagId = pullerManager->PullerForMatcherExists(atomTagId) ? atomTagId : -1; int triggerTrackerIndex; int triggerAtomId = -1; Loading cmds/statsd/src/stats_log_util.h +4 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,10 @@ inline bool isVendorPulledAtom(int atomId) { return atomId >= StatsdStats::kVendorPulledAtomStartTag && atomId < StatsdStats::kMaxAtomTag; } inline bool isPulledAtom(int atomId) { return atomId >= StatsdStats::kPullAtomStartTag && atomId < StatsdStats::kVendorAtomStartTag; } } // namespace statsd } // namespace os } // namespace android Loading
cmds/statsd/src/external/StatsPullerManager.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -119,9 +119,9 @@ bool StatsPullerManager::PullLocked(int tagId, vector<shared_ptr<LogEvent>>* dat } bool StatsPullerManager::PullerForMatcherExists(int tagId) const { // Vendor pulled atoms might be registered after we parse the config. return isVendorPulledAtom(tagId) || kAllPullAtomInfo.find({.atomTag = tagId}) != kAllPullAtomInfo.end(); // Pulled atoms might be registered after we parse the config, so just make sure the id is in // an appropriate range. return isVendorPulledAtom(tagId) || isPulledAtom(tagId); } void StatsPullerManager::updateAlarmLocked() { Loading
cmds/statsd/src/guardrail/StatsdStats.h +6 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,12 @@ public: // Maximum number of pushed atoms statsd stats will track above kMaxPushedAtomId. static const int kMaxNonPlatformPushedAtoms = 100; // Atom id that is the start of the pulled atoms. static const int kPullAtomStartTag = 10000; // Atom id that is the start of vendor atoms. static const int kVendorAtomStartTag = 100000; // Vendor pulled atom start id. static const int32_t kVendorPulledAtomStartTag = 150000; Loading
cmds/statsd/src/metrics/metrics_manager_util.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -426,7 +426,6 @@ bool initMetrics(const ConfigKey& key, const StatsdConfig& config, const int64_t config.event_metric_size() + config.gauge_metric_size() + config.value_metric_size(); allMetricProducers.reserve(allMetricsCount); StatsPullerManager statsPullerManager; // Construct map from metric id to metric activation index. The map will be used to determine // the metric activation corresponding to a metric. Loading Loading @@ -661,7 +660,7 @@ bool initMetrics(const ConfigKey& key, const StatsdConfig& config, const int64_t return false; } int atomTagId = *(atomMatcher->getAtomIds().begin()); int pullTagId = statsPullerManager.PullerForMatcherExists(atomTagId) ? atomTagId : -1; int pullTagId = pullerManager->PullerForMatcherExists(atomTagId) ? atomTagId : -1; int conditionIndex = -1; if (metric.has_condition()) { Loading Loading @@ -753,7 +752,7 @@ bool initMetrics(const ConfigKey& key, const StatsdConfig& config, const int64_t return false; } int atomTagId = *(atomMatcher->getAtomIds().begin()); int pullTagId = statsPullerManager.PullerForMatcherExists(atomTagId) ? atomTagId : -1; int pullTagId = pullerManager->PullerForMatcherExists(atomTagId) ? atomTagId : -1; int triggerTrackerIndex; int triggerAtomId = -1; Loading
cmds/statsd/src/stats_log_util.h +4 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,10 @@ inline bool isVendorPulledAtom(int atomId) { return atomId >= StatsdStats::kVendorPulledAtomStartTag && atomId < StatsdStats::kMaxAtomTag; } inline bool isPulledAtom(int atomId) { return atomId >= StatsdStats::kPullAtomStartTag && atomId < StatsdStats::kVendorAtomStartTag; } } // namespace statsd } // namespace os } // namespace android