Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 16 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 17 | #pragma once |
| 18 | |
| 19 | #include <gtest/gtest_prod.h> |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 20 | #include "config/ConfigListener.h" |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 21 | #include "metrics/MetricsManager.h" |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 22 | #include "packages/UidMap.h" |
Chenjie Yu | fa22d65 | 2018-02-05 14:37:48 -0800 | [diff] [blame] | 23 | #include "external/StatsPullerManager.h" |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 24 | |
| 25 | #include "frameworks/base/cmds/statsd/src/statsd_config.pb.h" |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 26 | |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 27 | #include <stdio.h> |
David Chen | 0656b7a | 2017-09-13 15:53:39 -0700 | [diff] [blame] | 28 | #include <unordered_map> |
| 29 | |
Bookatz | 906a35c | 2017-09-20 15:26:44 -0700 | [diff] [blame] | 30 | namespace android { |
| 31 | namespace os { |
| 32 | namespace statsd { |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 33 | |
Chenjie Yu | e36018b | 2018-04-16 15:18:30 -0700 | [diff] [blame] | 34 | // Keep this in sync with DumpReportReason enum in stats_log.proto |
| 35 | enum DumpReportReason { |
| 36 | DEVICE_SHUTDOWN = 1, |
| 37 | CONFIG_UPDATED = 2, |
| 38 | CONFIG_REMOVED = 3, |
| 39 | GET_DATA_CALLED = 4, |
| 40 | ADB_DUMP = 5, |
| 41 | CONFIG_RESET = 6, |
Yangster-mac | 97e7d20 | 2018-10-09 11:05:39 -0700 | [diff] [blame] | 42 | STATSCOMPANION_DIED = 7, |
| 43 | TERMINATION_SIGNAL_RECEIVED = 8 |
Chenjie Yu | e36018b | 2018-04-16 15:18:30 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 46 | class StatsLogProcessor : public ConfigListener { |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 47 | public: |
Chenjie Yu | e221920 | 2018-06-08 10:07:51 -0700 | [diff] [blame] | 48 | StatsLogProcessor(const sp<UidMap>& uidMap, const sp<StatsPullerManager>& pullerManager, |
| 49 | const sp<AlarmMonitor>& anomalyAlarmMonitor, |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 50 | const sp<AlarmMonitor>& subscriberTriggerAlarmMonitor, |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame] | 51 | const int64_t timeBaseNs, |
Tej Singh | 6ede28b | 2019-01-29 17:06:54 -0800 | [diff] [blame] | 52 | const std::function<bool(const ConfigKey&)>& sendBroadcast, |
| 53 | const std::function<bool(const int&, |
| 54 | const vector<int64_t>&)>& sendActivationBroadcast); |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 55 | virtual ~StatsLogProcessor(); |
| 56 | |
Yangster-mac | d40053e | 2018-01-09 16:29:22 -0800 | [diff] [blame] | 57 | void OnLogEvent(LogEvent* event); |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 58 | |
Yangster-mac | c04feba | 2018-04-02 14:37:33 -0700 | [diff] [blame] | 59 | void OnConfigUpdated(const int64_t timestampNs, const ConfigKey& key, |
| 60 | const StatsdConfig& config); |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 61 | void OnConfigRemoved(const ConfigKey& key); |
David Chen | 0656b7a | 2017-09-13 15:53:39 -0700 | [diff] [blame] | 62 | |
Yangster | 7c334a1 | 2017-11-22 14:24:24 -0800 | [diff] [blame] | 63 | size_t GetMetricsSize(const ConfigKey& key) const; |
| 64 | |
Tej Singh | 6ede28b | 2019-01-29 17:06:54 -0800 | [diff] [blame] | 65 | void GetActiveConfigs(const int uid, vector<int64_t>& outActiveConfigs); |
| 66 | |
Yangster-mac | e68f3a5 | 2018-04-04 00:01:43 -0700 | [diff] [blame] | 67 | void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, |
Bookatz | ff71cad | 2018-09-20 17:17:49 -0700 | [diff] [blame] | 68 | const bool include_current_partial_bucket, const bool erase_data, |
Muhammad Qureshi | 3a5ebf5 | 2019-03-28 12:38:21 -0700 | [diff] [blame] | 69 | const DumpReportReason dumpReportReason, |
Olivier Gaillard | 6c75ecd | 2019-02-20 09:57:33 +0000 | [diff] [blame] | 70 | const DumpLatency dumpLatency, |
| 71 | vector<uint8_t>* outData); |
Bookatz | ff71cad | 2018-09-20 17:17:49 -0700 | [diff] [blame] | 72 | void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, |
| 73 | const bool include_current_partial_bucket, const bool erase_data, |
Olivier Gaillard | 6c75ecd | 2019-02-20 09:57:33 +0000 | [diff] [blame] | 74 | const DumpReportReason dumpReportReason, |
| 75 | const DumpLatency dumpLatency, |
| 76 | ProtoOutputStream* proto); |
Bookatz | cc5adef | 2017-11-21 14:36:23 -0800 | [diff] [blame] | 77 | |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 78 | /* Tells MetricsManager that the alarms in alarmSet have fired. Modifies anomaly alarmSet. */ |
Yangster-mac | e2cd6d5 | 2017-11-09 20:38:30 -0800 | [diff] [blame] | 79 | void onAnomalyAlarmFired( |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 80 | const int64_t& timestampNs, |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 81 | unordered_set<sp<const InternalAlarm>, SpHash<InternalAlarm>> alarmSet); |
| 82 | |
| 83 | /* Tells MetricsManager that the alarms in alarmSet have fired. Modifies periodic alarmSet. */ |
| 84 | void onPeriodicAlarmFired( |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 85 | const int64_t& timestampNs, |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 86 | unordered_set<sp<const InternalAlarm>, SpHash<InternalAlarm>> alarmSet); |
yro | 31eb67b | 2017-10-24 13:33:21 -0700 | [diff] [blame] | 87 | |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 88 | /* Flushes data to disk. Data on memory will be gone after written to disk. */ |
Olivier Gaillard | 6c75ecd | 2019-02-20 09:57:33 +0000 | [diff] [blame] | 89 | void WriteDataToDisk(const DumpReportReason dumpReportReason, |
| 90 | const DumpLatency dumpLatency); |
Yangster-mac | 892f3d3 | 2018-05-02 14:16:48 -0700 | [diff] [blame] | 91 | |
Muhammad Qureshi | 844694b | 2019-04-05 10:10:40 -0700 | [diff] [blame^] | 92 | /* Persist configs containing metrics with active activations to disk. */ |
| 93 | void SaveActiveConfigsToDisk(int64_t currentTimeNs); |
Chenjie Yu | c7939cb | 2019-02-04 17:25:45 -0800 | [diff] [blame] | 94 | |
Muhammad Qureshi | 844694b | 2019-04-05 10:10:40 -0700 | [diff] [blame^] | 95 | /* Load configs containing metrics with active activations from disk. */ |
| 96 | void LoadActiveConfigsFromDisk(); |
Chenjie Yu | c7939cb | 2019-02-04 17:25:45 -0800 | [diff] [blame] | 97 | |
Yangster-mac | 892f3d3 | 2018-05-02 14:16:48 -0700 | [diff] [blame] | 98 | // Reset all configs. |
| 99 | void resetConfigs(); |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 100 | |
Yangster-mac | b5bc741 | 2018-01-06 23:17:45 -0800 | [diff] [blame] | 101 | inline sp<UidMap> getUidMap() { |
| 102 | return mUidMap; |
| 103 | } |
| 104 | |
Yao Chen | a80e5c0 | 2018-09-04 13:55:29 -0700 | [diff] [blame] | 105 | void dumpStates(int outFd, bool verbose); |
Yao Chen | 884c8c1 | 2018-01-26 10:36:25 -0800 | [diff] [blame] | 106 | |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame] | 107 | void informPullAlarmFired(const int64_t timestampNs); |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 108 | |
David Chen | d37bc23 | 2018-04-12 18:05:11 -0700 | [diff] [blame] | 109 | int64_t getLastReportTimeNs(const ConfigKey& key); |
| 110 | |
Yao Chen | 876889c | 2018-05-02 11:16:16 -0700 | [diff] [blame] | 111 | inline void setPrintLogs(bool enabled) { |
| 112 | #ifdef VERY_VERBOSE_PRINTING |
| 113 | std::lock_guard<std::mutex> lock(mMetricsMutex); |
| 114 | mPrintAllLogs = enabled; |
| 115 | #endif |
| 116 | } |
| 117 | |
David Chen | 4894490 | 2018-05-03 10:29:11 -0700 | [diff] [blame] | 118 | // Add a specific config key to the possible configs to dump ASAP. |
| 119 | void noteOnDiskData(const ConfigKey& key); |
| 120 | |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 121 | private: |
Yangster-mac | be10ddf | 2018-03-13 15:39:51 -0700 | [diff] [blame] | 122 | // For testing only. |
| 123 | inline sp<AlarmMonitor> getAnomalyAlarmMonitor() const { |
| 124 | return mAnomalyAlarmMonitor; |
| 125 | } |
| 126 | |
Yangster-mac | 684d195 | 2018-03-24 16:47:16 -0700 | [diff] [blame] | 127 | inline sp<AlarmMonitor> getPeriodicAlarmMonitor() const { |
| 128 | return mPeriodicAlarmMonitor; |
| 129 | } |
| 130 | |
Yangster-mac | b0d0628 | 2018-01-05 15:44:07 -0800 | [diff] [blame] | 131 | mutable mutex mMetricsMutex; |
David Chen | 1d7b0cd | 2017-11-15 14:20:04 -0800 | [diff] [blame] | 132 | |
Yao Chen | d10f7b1 | 2017-12-18 12:53:50 -0800 | [diff] [blame] | 133 | std::unordered_map<ConfigKey, sp<MetricsManager>> mMetricsManagers; |
David Chen | de70169 | 2017-10-05 13:16:02 -0700 | [diff] [blame] | 134 | |
David Chen | 1d7b0cd | 2017-11-15 14:20:04 -0800 | [diff] [blame] | 135 | std::unordered_map<ConfigKey, long> mLastBroadcastTimes; |
yro | 69007c8 | 2017-10-26 20:42:57 -0700 | [diff] [blame] | 136 | |
Tej Singh | 6ede28b | 2019-01-29 17:06:54 -0800 | [diff] [blame] | 137 | // Last time we sent a broadcast to this uid that the active configs had changed. |
| 138 | std::unordered_map<int, long> mLastActivationBroadcastTimes; |
| 139 | |
David Chen | d9269e2 | 2017-12-05 13:43:51 -0800 | [diff] [blame] | 140 | // Tracks when we last checked the bytes consumed for each config key. |
| 141 | std::unordered_map<ConfigKey, long> mLastByteSizeTimes; |
| 142 | |
David Chen | 4894490 | 2018-05-03 10:29:11 -0700 | [diff] [blame] | 143 | // Tracks which config keys has metric reports on disk |
| 144 | std::set<ConfigKey> mOnDiskDataConfigs; |
| 145 | |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 146 | sp<UidMap> mUidMap; // Reference to the UidMap to lookup app name and version for each uid. |
yro | 31eb67b | 2017-10-24 13:33:21 -0700 | [diff] [blame] | 147 | |
Chenjie Yu | e221920 | 2018-06-08 10:07:51 -0700 | [diff] [blame] | 148 | sp<StatsPullerManager> mPullerManager; // Reference to StatsPullerManager |
Chenjie Yu | fa22d65 | 2018-02-05 14:37:48 -0800 | [diff] [blame] | 149 | |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 150 | sp<AlarmMonitor> mAnomalyAlarmMonitor; |
| 151 | |
| 152 | sp<AlarmMonitor> mPeriodicAlarmMonitor; |
Yangster-mac | e2cd6d5 | 2017-11-09 20:38:30 -0800 | [diff] [blame] | 153 | |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 154 | void resetIfConfigTtlExpiredLocked(const int64_t timestampNs); |
| 155 | |
| 156 | void OnConfigUpdatedLocked( |
| 157 | const int64_t currentTimestampNs, const ConfigKey& key, const StatsdConfig& config); |
| 158 | |
Tej Singh | 6ede28b | 2019-01-29 17:06:54 -0800 | [diff] [blame] | 159 | void GetActiveConfigsLocked(const int uid, vector<int64_t>& outActiveConfigs); |
| 160 | |
Olivier Gaillard | 6c75ecd | 2019-02-20 09:57:33 +0000 | [diff] [blame] | 161 | void WriteDataToDiskLocked(const DumpReportReason dumpReportReason, |
| 162 | const DumpLatency dumpLatency); |
Yangster-mac | 892f3d3 | 2018-05-02 14:16:48 -0700 | [diff] [blame] | 163 | void WriteDataToDiskLocked(const ConfigKey& key, const int64_t timestampNs, |
Olivier Gaillard | 6c75ecd | 2019-02-20 09:57:33 +0000 | [diff] [blame] | 164 | const DumpReportReason dumpReportReason, |
| 165 | const DumpLatency dumpLatency); |
Yangster-mac | e68f3a5 | 2018-04-04 00:01:43 -0700 | [diff] [blame] | 166 | |
Yao Chen | 9a43b4f | 2019-04-10 10:43:20 -0700 | [diff] [blame] | 167 | void onConfigMetricsReportLocked( |
| 168 | const ConfigKey& key, const int64_t dumpTimeStampNs, |
| 169 | const bool include_current_partial_bucket, const bool erase_data, |
| 170 | const DumpReportReason dumpReportReason, const DumpLatency dumpLatency, |
| 171 | /*if dataSavedToDisk is true, it indicates the caller will write the data to disk |
| 172 | (e.g., before reboot). So no need to further persist local history.*/ |
| 173 | const bool dataSavedToDisk, vector<uint8_t>* proto); |
Yangster-mac | 8617950 | 2018-01-23 15:47:15 -0800 | [diff] [blame] | 174 | |
David Chen | 1d7b0cd | 2017-11-15 14:20:04 -0800 | [diff] [blame] | 175 | /* Check if we should send a broadcast if approaching memory limits and if we're over, we |
| 176 | * actually delete the data. */ |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 177 | void flushIfNecessaryLocked(int64_t timestampNs, const ConfigKey& key, |
Yangster-mac | b0d0628 | 2018-01-05 15:44:07 -0800 | [diff] [blame] | 178 | MetricsManager& metricsManager); |
yro | 31eb67b | 2017-10-24 13:33:21 -0700 | [diff] [blame] | 179 | |
Yangster-mac | d40053e | 2018-01-09 16:29:22 -0800 | [diff] [blame] | 180 | // Maps the isolated uid in the log event to host uid if the log event contains uid fields. |
| 181 | void mapIsolatedUidToHostUidIfNecessaryLocked(LogEvent* event) const; |
| 182 | |
| 183 | // Handler over the isolated uid change event. |
| 184 | void onIsolatedUidChangedEventLocked(const LogEvent& event); |
| 185 | |
Yangster-mac | 892f3d3 | 2018-05-02 14:16:48 -0700 | [diff] [blame] | 186 | // Reset all configs. |
| 187 | void resetConfigsLocked(const int64_t timestampNs); |
| 188 | // Reset the specified configs. |
Yao Chen | 163d260 | 2018-04-10 10:39:53 -0700 | [diff] [blame] | 189 | void resetConfigsLocked(const int64_t timestampNs, const std::vector<ConfigKey>& configs); |
| 190 | |
David Chen | 1d7b0cd | 2017-11-15 14:20:04 -0800 | [diff] [blame] | 191 | // Function used to send a broadcast so that receiver for the config key can call getData |
| 192 | // to retrieve the stored data. |
David Chen | 4894490 | 2018-05-03 10:29:11 -0700 | [diff] [blame] | 193 | std::function<bool(const ConfigKey& key)> mSendBroadcast; |
yro | 69007c8 | 2017-10-26 20:42:57 -0700 | [diff] [blame] | 194 | |
Tej Singh | 6ede28b | 2019-01-29 17:06:54 -0800 | [diff] [blame] | 195 | // Function used to send a broadcast so that receiver can be notified of which configs |
| 196 | // are currently active. |
| 197 | std::function<bool(const int& uid, const vector<int64_t>& configIds)> mSendActivationBroadcast; |
| 198 | |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame] | 199 | const int64_t mTimeBaseNs; |
Chenjie Yu | 85ed838 | 2017-12-14 16:48:54 -0800 | [diff] [blame] | 200 | |
Yao Chen | 163d260 | 2018-04-10 10:39:53 -0700 | [diff] [blame] | 201 | // Largest timestamp of the events that we have processed. |
| 202 | int64_t mLargestTimestampSeen = 0; |
| 203 | |
| 204 | int64_t mLastTimestampSeen = 0; |
| 205 | |
Chenjie Yu | fa22d65 | 2018-02-05 14:37:48 -0800 | [diff] [blame] | 206 | long mLastPullerCacheClearTimeSec = 0; |
| 207 | |
Tej Singh | 42f9e06 | 2018-11-09 10:01:00 -0800 | [diff] [blame] | 208 | // Last time we wrote data to disk. |
| 209 | int64_t mLastWriteTimeNs = 0; |
| 210 | |
jianjin | 996f40d | 2019-03-29 13:53:48 -0700 | [diff] [blame] | 211 | // Last time we wrote active metrics to disk. |
| 212 | int64_t mLastActiveMetricsWriteNs = 0; |
| 213 | |
Yao Chen | 876889c | 2018-05-02 11:16:16 -0700 | [diff] [blame] | 214 | #ifdef VERY_VERBOSE_PRINTING |
| 215 | bool mPrintAllLogs = false; |
| 216 | #endif |
| 217 | |
Yao Chen | 163d260 | 2018-04-10 10:39:53 -0700 | [diff] [blame] | 218 | FRIEND_TEST(StatsLogProcessorTest, TestOutOfOrderLogs); |
David Chen | d9269e2 | 2017-12-05 13:43:51 -0800 | [diff] [blame] | 219 | FRIEND_TEST(StatsLogProcessorTest, TestRateLimitByteSize); |
| 220 | FRIEND_TEST(StatsLogProcessorTest, TestRateLimitBroadcast); |
| 221 | FRIEND_TEST(StatsLogProcessorTest, TestDropWhenByteSizeTooLarge); |
Chenjie Yu | c7939cb | 2019-02-04 17:25:45 -0800 | [diff] [blame] | 222 | FRIEND_TEST(StatsLogProcessorTest, TestActiveConfigMetricDiskWriteRead); |
Chenjie Yu | a9a310e | 2019-02-06 13:40:10 -0800 | [diff] [blame] | 223 | FRIEND_TEST(StatsLogProcessorTest, TestActivationOnBoot); |
Muhammad Qureshi | 844694b | 2019-04-05 10:10:40 -0700 | [diff] [blame^] | 224 | FRIEND_TEST(StatsLogProcessorTest, TestActivationOnBootMultipleActivations); |
Chenjie Yu | c7939cb | 2019-02-04 17:25:45 -0800 | [diff] [blame] | 225 | |
Yao Chen | 8a8d16c | 2018-02-08 14:50:40 -0800 | [diff] [blame] | 226 | FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForSumDuration1); |
| 227 | FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForSumDuration2); |
| 228 | FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForSumDuration3); |
| 229 | FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForMaxDuration1); |
| 230 | FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForMaxDuration2); |
| 231 | FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForMaxDuration3); |
| 232 | FRIEND_TEST(MetricConditionLinkE2eTest, TestMultiplePredicatesAndLinks1); |
| 233 | FRIEND_TEST(MetricConditionLinkE2eTest, TestMultiplePredicatesAndLinks2); |
Yangster-mac | e06cfd7 | 2018-03-10 23:22:59 -0800 | [diff] [blame] | 234 | FRIEND_TEST(AttributionE2eTest, TestAttributionMatchAndSliceByFirstUid); |
| 235 | FRIEND_TEST(AttributionE2eTest, TestAttributionMatchAndSliceByChain); |
Yangster-mac | 87718e2 | 2018-01-11 16:16:26 -0800 | [diff] [blame] | 236 | FRIEND_TEST(GaugeMetricE2eTest, TestMultipleFieldsForPushedEvent); |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame] | 237 | FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvents); |
| 238 | FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvent_LateAlarm); |
Tej Singh | 597c716 | 2019-04-17 16:41:45 -0700 | [diff] [blame] | 239 | FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsWithActivation); |
| 240 | FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsNoCondition); |
Yangster-mac | 32f07af | 2018-10-13 17:08:11 -0700 | [diff] [blame] | 241 | FRIEND_TEST(GaugeMetricE2eTest, TestConditionChangeToTrueSamplePulledEvents); |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame] | 242 | FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); |
| 243 | FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); |
Tej Singh | 597c716 | 2019-04-17 16:41:45 -0700 | [diff] [blame] | 244 | FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_WithActivation); |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame] | 245 | |
Yangster | 13fb7e4 | 2018-03-07 17:30:49 -0800 | [diff] [blame] | 246 | FRIEND_TEST(DimensionInConditionE2eTest, TestCreateCountMetric_NoLink_OR_CombinationCondition); |
| 247 | FRIEND_TEST(DimensionInConditionE2eTest, TestCreateCountMetric_Link_OR_CombinationCondition); |
| 248 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_NoLink_OR_CombinationCondition); |
| 249 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_Link_OR_CombinationCondition); |
| 250 | |
| 251 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_NoLink_SimpleCondition); |
| 252 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_Link_SimpleCondition); |
| 253 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_PartialLink_SimpleCondition); |
| 254 | |
Yangster | 13fb7e4 | 2018-03-07 17:30:49 -0800 | [diff] [blame] | 255 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_PartialLink_AND_CombinationCondition); |
| 256 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_NoLink_AND_CombinationCondition); |
| 257 | FRIEND_TEST(DimensionInConditionE2eTest, TestDurationMetric_Link_AND_CombinationCondition); |
| 258 | |
Yangster-mac | be10ddf | 2018-03-13 15:39:51 -0700 | [diff] [blame] | 259 | FRIEND_TEST(AnomalyDetectionE2eTest, TestSlicedCountMetric_single_bucket); |
| 260 | FRIEND_TEST(AnomalyDetectionE2eTest, TestSlicedCountMetric_multiple_buckets); |
| 261 | FRIEND_TEST(AnomalyDetectionE2eTest, TestDurationMetric_SUM_single_bucket); |
| 262 | FRIEND_TEST(AnomalyDetectionE2eTest, TestDurationMetric_SUM_multiple_buckets); |
| 263 | FRIEND_TEST(AnomalyDetectionE2eTest, TestDurationMetric_SUM_long_refractory_period); |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 264 | |
Yangster-mac | 684d195 | 2018-03-24 16:47:16 -0700 | [diff] [blame] | 265 | FRIEND_TEST(AlarmE2eTest, TestMultipleAlarms); |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 266 | FRIEND_TEST(ConfigTtlE2eTest, TestCountMetric); |
Yangster-mac | 849dfdc2 | 2018-10-12 15:41:45 -0700 | [diff] [blame] | 267 | FRIEND_TEST(MetricActivationE2eTest, TestCountMetric); |
Muhammad Qureshi | 3a5ebf5 | 2019-03-28 12:38:21 -0700 | [diff] [blame] | 268 | FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithOneDeactivation); |
| 269 | FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithTwoDeactivations); |
| 270 | FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithTwoMetricsTwoDeactivations); |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 271 | }; |
Bookatz | 906a35c | 2017-09-20 15:26:44 -0700 | [diff] [blame] | 272 | |
Yao Chen | ef99c4f | 2017-09-22 16:26:54 -0700 | [diff] [blame] | 273 | } // namespace statsd |
| 274 | } // namespace os |
| 275 | } // namespace android |