Home
last modified time | relevance | path

Searched refs:MetricDimensionKey (Results 1 – 25 of 43) sorted by relevance

12

/aosp12/packages/modules/StatsD/statsd/src/anomaly/
H A DAnomalyTracker.h62 void addPastBucket(const MetricDimensionKey& key, const int64_t& bucketValue,
68 bool detectAnomaly(const int64_t& currBucketNum, const MetricDimensionKey& key,
80 int64_t metricId, const MetricDimensionKey& key,
89 int64_t getSumOverPastBuckets(const MetricDimensionKey& key) const;
92 int64_t getPastBucketValue(const MetricDimensionKey& key, const int64_t& bucketNum) const;
102 uint32_t getRefractoryPeriodEndsSec(const MetricDimensionKey& key) const { in getRefractoryPeriodEndsSec()
116 virtual void startAlarm(const MetricDimensionKey& dimensionKey, const int64_t& eventTime) { in startAlarm()
123 virtual void stopAlarm(const MetricDimensionKey& dimensionKey, const int64_t& timestampNs) { in stopAlarm()
154 virtual uint32_t getAlarmTimestampSec(const MetricDimensionKey& dimensionKey) const { in getAlarmTimestampSec()
186 unordered_map<MetricDimensionKey, uint32_t> mRefractoryPeriodEndsSec;
[all …]
H A DAnomalyTracker.cpp92 void AnomalyTracker::addPastBucket(const MetricDimensionKey& key, in addPastBucket()
151 void AnomalyTracker::subtractValueFromSum(const MetricDimensionKey& key, in subtractValueFromSum()
173 int64_t AnomalyTracker::getPastBucketValue(const MetricDimensionKey& key, in getPastBucketValue()
189 int64_t AnomalyTracker::getSumOverPastBuckets(const MetricDimensionKey& key) const { in getSumOverPastBuckets()
198 const MetricDimensionKey& key, in detectAnomaly()
210 const MetricDimensionKey& key, int64_t metricValue) { in declareAnomaly()
242 const MetricDimensionKey& key, in detectAndDeclareAnomaly()
250 const MetricDimensionKey& key) const { in isInRefractoryPeriod()
267 void AnomalyTracker::informSubscribers(const MetricDimensionKey& key, int64_t metric_id, in informSubscribers()
316 MetricDimensionKey metricKey = loadMetricDimensionKeyFromProto( in loadAlertMetadata()
H A DDurationAnomalyTracker.h37 void startAlarm(const MetricDimensionKey& dimensionKey, const int64_t& eventTime) override;
42 void stopAlarm(const MetricDimensionKey& dimensionKey, const int64_t& timestampNs) override;
57 uint32_t getAlarmTimestampSec(const MetricDimensionKey& dimensionKey) const override { in getAlarmTimestampSec()
64 std::unordered_map<MetricDimensionKey, sp<const InternalAlarm>> mAlarms;
H A DDurationAnomalyTracker.cpp38 void DurationAnomalyTracker::startAlarm(const MetricDimensionKey& dimensionKey, in startAlarm()
59 void DurationAnomalyTracker::stopAlarm(const MetricDimensionKey& dimensionKey, in stopAlarm()
96 unordered_map<MetricDimensionKey, sp<const InternalAlarm>> matchedAlarms; in informAlarmsFired()
/aosp12/packages/modules/StatsD/statsd/src/
H A DHashableDimensionKey.h98 class MetricDimensionKey {
100 explicit MetricDimensionKey(const HashableDimensionKey& dimensionKeyInWhat, in MetricDimensionKey() function
104 MetricDimensionKey(){}; in MetricDimensionKey() function
106 MetricDimensionKey(const MetricDimensionKey& that) in MetricDimensionKey() function
110 MetricDimensionKey& operator=(const MetricDimensionKey& from) = default;
134 bool operator==(const MetricDimensionKey& that) const;
136 bool operator<(const MetricDimensionKey& that) const;
230 using android::os::statsd::MetricDimensionKey;
240 struct hash<MetricDimensionKey> {
241 std::size_t operator()(const MetricDimensionKey& key) const {
H A Dmetadata_util.h24 void writeMetricDimensionKeyToMetadataDimensionKey(const MetricDimensionKey& metricKey,
25 metadata::MetricDimensionKey* metadataMetricKey);
27 MetricDimensionKey loadMetricDimensionKeyFromProto(
28 const metadata::MetricDimensionKey& metricDimensionKey);
H A Dmetadata_util.cpp54 const MetricDimensionKey& metricKey, in writeMetricDimensionKeyToMetadataDimensionKey()
55 metadata::MetricDimensionKey* metadataMetricKey) { in writeMetricDimensionKeyToMetadataDimensionKey()
106 MetricDimensionKey loadMetricDimensionKeyFromProto( in loadMetricDimensionKeyFromProto()
107 const metadata::MetricDimensionKey& metricDimensionKey) { in loadMetricDimensionKeyFromProto()
116 MetricDimensionKey metricKey(dimKeyInWhat, stateValues); in loadMetricDimensionKeyFromProto()
H A Dstats_util.h38 const MetricDimensionKey DEFAULT_METRIC_DIMENSION_KEY = MetricDimensionKey();
42 typedef std::unordered_map<MetricDimensionKey, int64_t> DimToValMap;
H A DHashableDimensionKey.cpp351 bool MetricDimensionKey::operator==(const MetricDimensionKey& that) const { in operator ==()
356 string MetricDimensionKey::toString() const { in toString()
360 bool MetricDimensionKey::operator<(const MetricDimensionKey& that) const { in operator <()
/aosp12/packages/modules/StatsD/statsd/tests/
H A Dmetadata_util_test.cpp52 MetricDimensionKey dimKey(dim, dim2); in TEST()
54 metadata::MetricDimensionKey metadataDimKey; in TEST()
57 MetricDimensionKey loadedDimKey = loadMetricDimensionKeyFromProto(metadataDimKey); in TEST()
60 ASSERT_EQ(std::hash<MetricDimensionKey>{}(loadedDimKey), in TEST()
61 std::hash<MetricDimensionKey>{}(dimKey)); in TEST()
/aosp12/packages/modules/StatsD/statsd/tests/anomaly/
H A DAnomalyTracker_test.cpp39 MetricDimensionKey getMockMetricDimensionKey(int key, string value) { in getMockMetricDimensionKey()
43 return MetricDimensionKey(dim, DEFAULT_DIMENSION_KEY); in getMockMetricDimensionKey()
62 const MetricDimensionKey& key) { in getBucketValue()
76 for (const MetricDimensionKey& key : trueList) { in detectAnomaliesPass()
81 for (const MetricDimensionKey& key : falseList) { in detectAnomaliesPass()
131 MetricDimensionKey keyA = getMockMetricDimensionKey(1, "a"); in TEST()
132 MetricDimensionKey keyB = getMockMetricDimensionKey(1, "b"); in TEST()
133 MetricDimensionKey keyC = getMockMetricDimensionKey(1, "c"); in TEST()
276 MetricDimensionKey keyA = getMockMetricDimensionKey(1, "a"); in TEST()
277 MetricDimensionKey keyB = getMockMetricDimensionKey(1, "b"); in TEST()
[all …]
/aosp12/packages/modules/StatsD/statsd/tests/metrics/
H A DMaxDurationTracker_test.cpp46 const MetricDimensionKey eventKey = getMockedMetricDimensionKey(TagId, 0, "1");
60 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
93 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
127 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
166 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
202 MetricDimensionKey eventKey = getMockedMetricDimensionKey(TagId, 1, "1"); in TEST()
226 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
247 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
297 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
382 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
[all …]
H A DOringDurationTracker_test.cpp57 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
89 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
120 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
148 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
191 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
230 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
269 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
306 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
470 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
519 unordered_map<MetricDimensionKey, vector<DurationBucket>> buckets; in TEST()
[all …]
H A Dmetrics_test_helper.cpp37 MetricDimensionKey getMockedMetricDimensionKey(int tagId, int key, string value) { in getMockedMetricDimensionKey()
38 return MetricDimensionKey(getMockedDimensionKey(tagId, key, value), DEFAULT_DIMENSION_KEY); in getMockedMetricDimensionKey()
41 MetricDimensionKey getMockedStateDimensionKey(int tagId, int key, int64_t value) { in getMockedStateDimensionKey()
42 return MetricDimensionKey(DEFAULT_DIMENSION_KEY, in getMockedStateDimensionKey()
H A Dmetrics_test_helper.h52 MetricDimensionKey getMockedMetricDimensionKey(int tagId, int key, std::string value);
55 MetricDimensionKey getMockedStateDimensionKey(int tagId, int key, int64_t value);
/aosp12/packages/modules/StatsD/statsd/src/metrics/duration_helper/
H A DDurationTracker.h71 DurationTracker(const ConfigKey& key, const int64_t& id, const MetricDimensionKey& eventKey, in DurationTracker()
116 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>* output) = 0;
122 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>* output) = 0;
183 void addPastBucketToAnomalyTrackers(const MetricDimensionKey eventKey, in addPastBucketToAnomalyTrackers()
208 void setEventKey(const MetricDimensionKey& eventKey) { in setEventKey()
242 MetricDimensionKey mEventKey;
H A DMaxDurationTracker.h31 MaxDurationTracker(const ConfigKey& key, const int64_t& id, const MetricDimensionKey& eventKey,
47 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>* output) override;
50 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>*) override;
H A DOringDurationTracker.h30 const MetricDimensionKey& eventKey, sp<ConditionWizard> wizard,
52 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>* output) override;
55 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>* output) override;
H A DOringDurationTracker.cpp28 const ConfigKey& key, const int64_t& id, const MetricDimensionKey& eventKey, in OringDurationTracker()
136 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>>* output) { in flushCurrentBucket() argument
172 (*output)[MetricDimensionKey(mEventKey.getDimensionKeyInWhat(), durationIt.first)] in flushCurrentBucket()
184 MetricDimensionKey(mEventKey.getDimensionKeyInWhat(), durationIt.first), in flushCurrentBucket()
228 unordered_map<MetricDimensionKey, vector<DurationBucket>>* output) { in flushIfNeeded() argument
/aosp12/packages/modules/StatsD/statsd/src/metrics/
H A DDurationMetricProducer.h74 const size_t matcherIndex, const MetricDimensionKey& eventKey,
85 void handleStartEvent(const MetricDimensionKey& eventKey, const ConditionKey& conditionKeys,
171 std::unordered_map<MetricDimensionKey, std::vector<DurationBucket>> mPastBuckets;
179 const MetricDimensionKey& eventKey) const;
182 bool hitGuardRailLocked(const MetricDimensionKey& newKey);
H A DValueMetricProducer.h101 const size_t matcherIndex, const MetricDimensionKey& eventKey,
244 std::unordered_map<MetricDimensionKey, CurrentValueBucket> mCurrentSlicedBucket;
249 std::unordered_map<MetricDimensionKey, int64_t> mCurrentFullBucket;
252 std::unordered_map<MetricDimensionKey, std::vector<PastValueBucket>> mPastBuckets;
257 bool hitGuardRailLocked(const MetricDimensionKey& newKey);
261 bool hitFullBucketGuardRailLocked(const MetricDimensionKey& newKey);
H A DGaugeMetricProducer.h50 typedef std::unordered_map<MetricDimensionKey, std::vector<GaugeAtom>>
106 const size_t matcherIndex, const MetricDimensionKey& eventKey,
179 std::unordered_map<MetricDimensionKey, std::vector<GaugeBucket>> mPastBuckets;
205 bool hitGuardRailLocked(const MetricDimensionKey& newKey);
H A DCountMetricProducer.h66 const size_t matcherIndex, const MetricDimensionKey& eventKey,
116 std::unordered_map<MetricDimensionKey, std::vector<CountBucket>> mPastBuckets;
127 bool hitGuardRailLocked(const MetricDimensionKey& newKey);
/aosp12/packages/modules/StatsD/statsd/src/subscriber/
H A DSubscriberReporter.h75 const MetricDimensionKey& dimKey) const;
93 const MetricDimensionKey& dimKey) const;
/aosp12/packages/modules/StatsD/statsd/tests/e2e/
H A DAnomaly_count_e2e_test.cpp90 MetricDimensionKey dimensionKey1(whatKey1, DEFAULT_DIMENSION_KEY); in TEST()
95 MetricDimensionKey dimensionKey2(whatKey2, DEFAULT_DIMENSION_KEY); in TEST()
201 MetricDimensionKey dimensionKey1(whatKey1, DEFAULT_DIMENSION_KEY); in TEST()
297 MetricDimensionKey dimensionKey1(whatKey1, DEFAULT_DIMENSION_KEY); in TEST()
325 metadata::MetricDimensionKey metadataDimKey = keyedData.dimension_key(); in TEST()
360 MetricDimensionKey dimensionKey1(whatKey1, DEFAULT_DIMENSION_KEY); in TEST()

12