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 */ 16 17 #pragma once 18 19 #include <aidl/android/os/BnStatsd.h> 20 #include <gtest/gtest_prod.h> 21 #include <stdio.h> 22 23 #include <unordered_map> 24 25 #include "config/ConfigListener.h" 26 #include "external/StatsPullerManager.h" 27 #include "logd/LogEvent.h" 28 #include "metrics/MetricsManager.h" 29 #include "packages/UidMap.h" 30 #include "socket/LogEventFilter.h" 31 #include "src/statsd_config.pb.h" 32 #include "src/statsd_metadata.pb.h" 33 34 namespace android { 35 namespace os { 36 namespace statsd { 37 38 class StatsLogProcessor : public ConfigListener, public virtual PackageInfoListener { 39 public: 40 StatsLogProcessor( 41 const sp<UidMap>& uidMap, const sp<StatsPullerManager>& pullerManager, 42 const sp<AlarmMonitor>& anomalyAlarmMonitor, 43 const sp<AlarmMonitor>& subscriberTriggerAlarmMonitor, const int64_t timeBaseNs, 44 const std::function<bool(const ConfigKey&)>& sendBroadcast, 45 const std::function<bool(const int&, const vector<int64_t>&)>& sendActivationBroadcast, 46 const std::function<void(const ConfigKey&, const string&, const vector<int64_t>&)>& 47 sendRestrictedMetricsBroadcast, 48 const std::shared_ptr<LogEventFilter>& logEventFilter); 49 50 virtual ~StatsLogProcessor(); 51 52 void OnLogEvent(LogEvent* event); 53 54 void OnConfigUpdated(const int64_t timestampNs, const int64_t wallClockNs, const ConfigKey& key, 55 const StatsdConfig& config, bool modularUpdate = true); 56 // For testing only. 57 void OnConfigUpdated(const int64_t timestampNs, const ConfigKey& key, 58 const StatsdConfig& config, bool modularUpdate = true); 59 void OnConfigRemoved(const ConfigKey& key); 60 61 size_t GetMetricsSize(const ConfigKey& key) const; 62 63 void GetActiveConfigs(const int uid, vector<int64_t>& outActiveConfigs); 64 65 void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, const int64_t wallClockNs, 66 const bool include_current_partial_bucket, const bool erase_data, 67 const DumpReportReason dumpReportReason, const DumpLatency dumpLatency, 68 vector<uint8_t>* outData); 69 void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, const int64_t wallClockNs, 70 const bool include_current_partial_bucket, const bool erase_data, 71 const DumpReportReason dumpReportReason, const DumpLatency dumpLatency, 72 ProtoOutputStream* proto); 73 // For testing only. 74 void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, 75 const bool include_current_partial_bucket, const bool erase_data, 76 const DumpReportReason dumpReportReason, const DumpLatency dumpLatency, 77 vector<uint8_t>* outData); 78 79 /* Tells MetricsManager that the alarms in alarmSet have fired. Modifies periodic alarmSet. */ 80 void onPeriodicAlarmFired( 81 const int64_t& timestampNs, 82 unordered_set<sp<const InternalAlarm>, SpHash<InternalAlarm>>& alarmSet); 83 84 /* Flushes data to disk. Data on memory will be gone after written to disk. */ 85 void WriteDataToDisk(const DumpReportReason dumpReportReason, const DumpLatency dumpLatency, 86 const int64_t elapsedRealtimeNs, const int64_t wallClockNs); 87 88 /* Persist configs containing metrics with active activations to disk. */ 89 void SaveActiveConfigsToDisk(int64_t currentTimeNs); 90 91 /* Writes the current active status/ttl for all configs and metrics to ProtoOutputStream. */ 92 void WriteActiveConfigsToProtoOutputStream( 93 int64_t currentTimeNs, const DumpReportReason reason, ProtoOutputStream* proto); 94 95 /* Load configs containing metrics with active activations from disk. */ 96 void LoadActiveConfigsFromDisk(); 97 98 /* Persist metadata for configs and metrics to disk. */ 99 void SaveMetadataToDisk(int64_t currentWallClockTimeNs, int64_t systemElapsedTimeNs); 100 101 /* Writes the statsd metadata for all configs and metrics to StatsMetadataList. */ 102 void WriteMetadataToProto(int64_t currentWallClockTimeNs, 103 int64_t systemElapsedTimeNs, 104 metadata::StatsMetadataList* metadataList); 105 106 /* Load stats metadata for configs and metrics from disk. */ 107 void LoadMetadataFromDisk(int64_t currentWallClockTimeNs, 108 int64_t systemElapsedTimeNs); 109 110 /* Sets the metadata for all configs and metrics */ 111 void SetMetadataState(const metadata::StatsMetadataList& statsMetadataList, 112 int64_t currentWallClockTimeNs, 113 int64_t systemElapsedTimeNs); 114 115 /* Enforces ttls for restricted metrics */ 116 void EnforceDataTtls(const int64_t wallClockNs, const int64_t elapsedRealtimeNs); 117 118 /* Sets the active status/ttl for all configs and metrics to the status in ActiveConfigList. */ 119 void SetConfigsActiveState(const ActiveConfigList& activeConfigList, int64_t currentTimeNs); 120 121 /* Notify all MetricsManagers of app upgrades */ 122 void notifyAppUpgrade(const int64_t& eventTimeNs, const string& apk, const int uid, 123 const int64_t version) override; 124 125 /* Notify all MetricsManagers of app removals */ 126 void notifyAppRemoved(const int64_t& eventTimeNs, const string& apk, const int uid) override; 127 128 /* Notify all MetricsManagers of uid map snapshots received */ 129 void onUidMapReceived(const int64_t& eventTimeNs) override; 130 131 /* Notify all metrics managers of boot completed 132 * This will force a bucket split when the boot is finished. 133 */ 134 void onStatsdInitCompleted(const int64_t& elapsedTimeNs); 135 136 // Reset all configs. 137 void resetConfigs(); 138 getUidMap()139 inline sp<UidMap> getUidMap() { 140 return mUidMap; 141 } 142 143 void dumpStates(int outFd, bool verbose); 144 145 void informPullAlarmFired(const int64_t timestampNs); 146 147 int64_t getLastReportTimeNs(const ConfigKey& key); 148 setPrintLogs(bool enabled)149 inline void setPrintLogs(bool enabled) { 150 std::lock_guard<std::mutex> lock(mMetricsMutex); 151 mPrintAllLogs = enabled; 152 153 if (mLogEventFilter) { 154 // Turning on print logs turns off pushed event filtering to enforce 155 // complete log event buffer parsing 156 mLogEventFilter->setFilteringEnabled(!enabled); 157 } 158 } 159 160 // Add a specific config key to the possible configs to dump ASAP. 161 void noteOnDiskData(const ConfigKey& key); 162 163 void setAnomalyAlarm(const int64_t timeMillis); 164 165 void cancelAnomalyAlarm(); 166 167 void querySql(const string& sqlQuery, const int32_t minSqlClientVersion, 168 const optional<vector<uint8_t>>& policyConfig, 169 const shared_ptr<aidl::android::os::IStatsQueryCallback>& callback, 170 const int64_t configId, const string& configPackage, const int32_t callingUid); 171 172 void fillRestrictedMetrics(const int64_t configId, const string& configPackage, 173 const int32_t delegateUid, vector<int64_t>* output); 174 175 /* Returns pre-defined list of atoms to parse by LogEventFilter */ 176 static LogEventFilter::AtomIdSet getDefaultAtomIdSet(); 177 178 private: 179 // For testing only. getAnomalyAlarmMonitor()180 inline sp<AlarmMonitor> getAnomalyAlarmMonitor() const { 181 return mAnomalyAlarmMonitor; 182 } 183 getPeriodicAlarmMonitor()184 inline sp<AlarmMonitor> getPeriodicAlarmMonitor() const { 185 return mPeriodicAlarmMonitor; 186 } 187 188 mutable mutex mMetricsMutex; 189 190 // Guards mNextAnomalyAlarmTime. A separate mutex is needed because alarms are set/cancelled 191 // in the onLogEvent code path, which is locked by mMetricsMutex. 192 // DO NOT acquire mMetricsMutex while holding mAnomalyAlarmMutex. This can lead to a deadlock. 193 mutable mutex mAnomalyAlarmMutex; 194 195 std::unordered_map<ConfigKey, sp<MetricsManager>> mMetricsManagers; 196 197 std::unordered_map<ConfigKey, int64_t> mLastBroadcastTimes; 198 199 // Last time we sent a broadcast to this uid that the active configs had changed. 200 std::unordered_map<int, int64_t> mLastActivationBroadcastTimes; 201 202 // Tracks when we last checked the bytes consumed for each config key. 203 std::unordered_map<ConfigKey, int64_t> mLastByteSizeTimes; 204 205 // Tracks when we last checked the ttl for restricted metrics. 206 int64_t mLastTtlTime; 207 208 // Tracks when we last flushed restricted metrics. 209 int64_t mLastFlushRestrictedTime; 210 211 // Tracks when we last checked db guardrails. 212 int64_t mLastDbGuardrailEnforcementTime; 213 214 // Tracks which config keys has metric reports on disk 215 std::set<ConfigKey> mOnDiskDataConfigs; 216 217 sp<UidMap> mUidMap; // Reference to the UidMap to lookup app name and version for each uid. 218 219 sp<StatsPullerManager> mPullerManager; // Reference to StatsPullerManager 220 221 sp<AlarmMonitor> mAnomalyAlarmMonitor; 222 223 sp<AlarmMonitor> mPeriodicAlarmMonitor; 224 225 std::shared_ptr<LogEventFilter> mLogEventFilter; 226 227 void OnLogEvent(LogEvent* event, int64_t elapsedRealtimeNs); 228 229 void resetIfConfigTtlExpiredLocked(const int64_t eventTimeNs); 230 231 void OnConfigUpdatedLocked(const int64_t currentTimestampNs, const ConfigKey& key, 232 const StatsdConfig& config, bool modularUpdate); 233 234 void GetActiveConfigsLocked(const int uid, vector<int64_t>& outActiveConfigs); 235 236 void WriteActiveConfigsToProtoOutputStreamLocked( 237 int64_t currentTimeNs, const DumpReportReason reason, ProtoOutputStream* proto); 238 239 void SetConfigsActiveStateLocked(const ActiveConfigList& activeConfigList, 240 int64_t currentTimeNs); 241 242 void SetMetadataStateLocked(const metadata::StatsMetadataList& statsMetadataList, 243 int64_t currentWallClockTimeNs, 244 int64_t systemElapsedTimeNs); 245 246 void WriteMetadataToProtoLocked(int64_t currentWallClockTimeNs, 247 int64_t systemElapsedTimeNs, 248 metadata::StatsMetadataList* metadataList); 249 250 void WriteDataToDiskLocked(const DumpReportReason dumpReportReason, 251 const DumpLatency dumpLatency, const int64_t elapsedRealtimeNs, 252 const int64_t wallClockNs); 253 254 void WriteDataToDiskLocked(const ConfigKey& key, const int64_t timestampNs, 255 const int64_t wallClockNs, const DumpReportReason dumpReportReason, 256 const DumpLatency dumpLatency); 257 258 void onConfigMetricsReportLocked( 259 const ConfigKey& key, const int64_t dumpTimeStampNs, const int64_t wallClockNs, 260 const bool include_current_partial_bucket, const bool erase_data, 261 const DumpReportReason dumpReportReason, const DumpLatency dumpLatency, 262 /*if dataSavedToDisk is true, it indicates the caller will write the data to disk 263 (e.g., before reboot). So no need to further persist local history.*/ 264 const bool dataSavedToDisk, vector<uint8_t>* proto); 265 266 /* Check if it is time enforce data ttls for restricted metrics, and if it is, enforce ttls 267 * on all restricted metrics. */ 268 void enforceDataTtlsIfNecessaryLocked(const int64_t wallClockNs, 269 const int64_t elapsedRealtimeNs); 270 271 // Enforces ttls on all restricted metrics. 272 void enforceDataTtlsLocked(const int64_t wallClockNs, const int64_t elapsedRealtimeNs); 273 274 // Enforces that dbs are within guardrail parameters. 275 void enforceDbGuardrailsIfNecessaryLocked(const int64_t wallClockNs, 276 const int64_t elapsedRealtimeNs); 277 278 /* Check if we should send a broadcast if approaching memory limits and if we're over, we 279 * actually delete the data. */ 280 void flushIfNecessaryLocked(const ConfigKey& key, MetricsManager& metricsManager); 281 282 set<ConfigKey> getRestrictedConfigKeysToQueryLocked(const int32_t callingUid, 283 const int64_t configId, 284 const set<int32_t>& configPackageUids, 285 string& err, 286 InvalidQueryReason& invalidQueryReason); 287 288 // Maps the isolated uid in the log event to host uid if the log event contains uid fields. 289 void mapIsolatedUidToHostUidIfNecessaryLocked(LogEvent* event) const; 290 291 // Handler over the isolated uid change event. 292 void onIsolatedUidChangedEventLocked(const LogEvent& event); 293 294 // Handler over the binary push state changed event. 295 void onBinaryPushStateChangedEventLocked(LogEvent* event); 296 297 // Handler over the watchdog rollback occurred event. 298 void onWatchdogRollbackOccurredLocked(LogEvent* event); 299 300 // Updates train info on disk based on binary push state changed info and 301 // write disk info into parameters. 302 void getAndUpdateTrainInfoOnDisk(bool is_rollback, InstallTrainInfo* trainInfoIn); 303 304 // Gets experiment ids on disk for associated train and updates them 305 // depending on rollback type. Then writes them back to disk and returns 306 // them. 307 std::vector<int64_t> processWatchdogRollbackOccurred(const int32_t rollbackTypeIn, 308 const string& packageName); 309 310 // Reset all configs. 311 void resetConfigsLocked(const int64_t timestampNs); 312 // Reset the specified configs. 313 void resetConfigsLocked(const int64_t timestampNs, const std::vector<ConfigKey>& configs); 314 315 // An anomaly alarm should have fired. 316 // Check with anomaly alarm manager to find the alarms and process the result. 317 void informAnomalyAlarmFiredLocked(const int64_t elapsedTimeMillis); 318 319 /* Tells MetricsManager that the alarms in alarmSet have fired. Modifies anomaly alarmSet. */ 320 void processFiredAnomalyAlarmsLocked( 321 const int64_t& timestampNs, 322 unordered_set<sp<const InternalAlarm>, SpHash<InternalAlarm>>& alarmSet); 323 324 void flushRestrictedDataLocked(const int64_t elapsedRealtimeNs); 325 326 void flushRestrictedDataIfNecessaryLocked(const int64_t elapsedRealtimeNs); 327 328 /* Tells LogEventFilter about atom ids to parse */ 329 void updateLogEventFilterLocked() const; 330 331 // Function used to send a broadcast so that receiver for the config key can call getData 332 // to retrieve the stored data. 333 std::function<bool(const ConfigKey& key)> mSendBroadcast; 334 335 // Function used to send a broadcast so that receiver can be notified of which configs 336 // are currently active. 337 std::function<bool(const int& uid, const vector<int64_t>& configIds)> mSendActivationBroadcast; 338 339 // Function used to send a broadcast if necessary so the receiver can be notified of the 340 // restricted metrics for the given config. 341 std::function<void(const ConfigKey& key, const string& delegatePackage, 342 const vector<int64_t>& restrictedMetricIds)> 343 mSendRestrictedMetricsBroadcast; 344 345 const int64_t mTimeBaseNs; 346 347 // Largest timestamp of the events that we have processed. 348 int64_t mLargestTimestampSeen = 0; 349 350 int64_t mLastTimestampSeen = 0; 351 352 int64_t mLastPullerCacheClearTimeSec = 0; 353 354 // Last time we wrote data to disk. 355 int64_t mLastWriteTimeNs = 0; 356 357 // Last time we wrote active metrics to disk. 358 int64_t mLastActiveMetricsWriteNs = 0; 359 360 //Last time we wrote metadata to disk. 361 int64_t mLastMetadataWriteNs = 0; 362 363 // The time for the next anomaly alarm for alerts. 364 int64_t mNextAnomalyAlarmTime = 0; 365 366 bool mPrintAllLogs = false; 367 368 friend class StatsLogProcessorTestRestricted; 369 FRIEND_TEST(StatsLogProcessorTest, TestOutOfOrderLogs); 370 FRIEND_TEST(StatsLogProcessorTest, TestRateLimitByteSize); 371 FRIEND_TEST(StatsLogProcessorTest, TestRateLimitBroadcast); 372 FRIEND_TEST(StatsLogProcessorTest, TestDropWhenByteSizeTooLarge); 373 FRIEND_TEST(StatsLogProcessorTest, InvalidConfigRemoved); 374 FRIEND_TEST(StatsLogProcessorTest, TestActiveConfigMetricDiskWriteRead); 375 FRIEND_TEST(StatsLogProcessorTest, TestActivationOnBoot); 376 FRIEND_TEST(StatsLogProcessorTest, TestActivationOnBootMultipleActivations); 377 FRIEND_TEST(StatsLogProcessorTest, 378 TestActivationOnBootMultipleActivationsDifferentActivationTypes); 379 FRIEND_TEST(StatsLogProcessorTest, TestActivationsPersistAcrossSystemServerRestart); 380 FRIEND_TEST(StatsLogProcessorTest, LogEventFilterOnSetPrintLogs); 381 FRIEND_TEST(StatsLogProcessorTest, TestUidMapHasSnapshot); 382 FRIEND_TEST(StatsLogProcessorTest, TestEmptyConfigHasNoUidMap); 383 FRIEND_TEST(StatsLogProcessorTest, TestReportIncludesSubConfig); 384 FRIEND_TEST(StatsLogProcessorTest, TestPullUidProviderSetOnConfigUpdate); 385 FRIEND_TEST(StatsLogProcessorTestRestricted, TestInconsistentRestrictedMetricsConfigUpdate); 386 FRIEND_TEST(StatsLogProcessorTestRestricted, TestRestrictedLogEventPassed); 387 FRIEND_TEST(StatsLogProcessorTestRestricted, TestRestrictedLogEventNotPassed); 388 FRIEND_TEST(StatsLogProcessorTestRestricted, RestrictedMetricsManagerOnDumpReportNotCalled); 389 FRIEND_TEST(StatsLogProcessorTestRestricted, NonRestrictedMetricsManagerOnDumpReportCalled); 390 FRIEND_TEST(StatsLogProcessorTestRestricted, RestrictedMetricOnDumpReportEmpty); 391 FRIEND_TEST(StatsLogProcessorTestRestricted, NonRestrictedMetricOnDumpReportNotEmpty); 392 FRIEND_TEST(StatsLogProcessorTestRestricted, RestrictedMetricNotWriteToDisk); 393 FRIEND_TEST(StatsLogProcessorTestRestricted, NonRestrictedMetricWriteToDisk); 394 FRIEND_TEST(StatsLogProcessorTestRestricted, RestrictedMetricFlushIfReachMemoryLimit); 395 FRIEND_TEST(StatsLogProcessorTestRestricted, RestrictedMetricNotFlushIfNotReachMemoryLimit); 396 FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForSumDuration1); 397 FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForSumDuration2); 398 FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForSumDuration3); 399 FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForMaxDuration1); 400 FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForMaxDuration2); 401 FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensionsForMaxDuration3); 402 FRIEND_TEST(MetricConditionLinkE2eTest, TestMultiplePredicatesAndLinks1); 403 FRIEND_TEST(MetricConditionLinkE2eTest, TestMultiplePredicatesAndLinks2); 404 FRIEND_TEST(AttributionE2eTest, TestAttributionMatchAndSliceByFirstUid); 405 FRIEND_TEST(AttributionE2eTest, TestAttributionMatchAndSliceByChain); 406 FRIEND_TEST(GaugeMetricE2ePulledTest, TestFirstNSamplesPulledNoTrigger); 407 FRIEND_TEST(GaugeMetricE2ePulledTest, TestFirstNSamplesPulledNoTriggerWithActivation); 408 FRIEND_TEST(GaugeMetricE2ePushedTest, TestMultipleFieldsForPushedEvent); 409 FRIEND_TEST(GaugeMetricE2ePushedTest, TestRepeatedFieldsForPushedEvent); 410 FRIEND_TEST(GaugeMetricE2ePulledTest, TestRandomSamplePulledEvents); 411 FRIEND_TEST(GaugeMetricE2ePulledTest, TestRandomSamplePulledEvent_LateAlarm); 412 FRIEND_TEST(GaugeMetricE2ePulledTest, TestRandomSamplePulledEventsWithActivation); 413 FRIEND_TEST(GaugeMetricE2ePulledTest, TestRandomSamplePulledEventsNoCondition); 414 FRIEND_TEST(GaugeMetricE2ePulledTest, TestConditionChangeToTrueSamplePulledEvents); 415 FRIEND_TEST(RestrictedEventMetricE2eTest, TestEnforceTtlRemovesOldEvents); 416 FRIEND_TEST(RestrictedEventMetricE2eTest, TestFlagDisabled); 417 FRIEND_TEST(RestrictedEventMetricE2eTest, TestLogEventsEnforceTtls); 418 FRIEND_TEST(RestrictedEventMetricE2eTest, TestQueryEnforceTtls); 419 FRIEND_TEST(RestrictedEventMetricE2eTest, TestLogEventsDoesNotEnforceTtls); 420 FRIEND_TEST(RestrictedEventMetricE2eTest, TestNotFlushed); 421 FRIEND_TEST(RestrictedEventMetricE2eTest, TestFlushInWriteDataToDisk); 422 FRIEND_TEST(RestrictedEventMetricE2eTest, TestFlushPeriodically); 423 FRIEND_TEST(RestrictedEventMetricE2eTest, TestTTlsEnforceDbGuardrails); 424 FRIEND_TEST(RestrictedEventMetricE2eTest, TestOnLogEventMalformedDbNameDeleted); 425 FRIEND_TEST(RestrictedEventMetricE2eTest, TestEnforceDbGuardrails); 426 FRIEND_TEST(RestrictedEventMetricE2eTest, TestEnforceDbGuardrailsDoesNotDeleteBeforeGuardrail); 427 FRIEND_TEST(RestrictedEventMetricE2eTest, TestRestrictedMetricLoadsTtlFromDisk); 428 429 FRIEND_TEST(AnomalyCountDetectionE2eTest, TestSlicedCountMetric_single_bucket); 430 FRIEND_TEST(AnomalyCountDetectionE2eTest, TestSlicedCountMetric_multiple_buckets); 431 FRIEND_TEST(AnomalyCountDetectionE2eTest, 432 TestCountMetric_save_refractory_to_disk_no_data_written); 433 FRIEND_TEST(AnomalyCountDetectionE2eTest, TestCountMetric_save_refractory_to_disk); 434 FRIEND_TEST(AnomalyCountDetectionE2eTest, TestCountMetric_load_refractory_from_disk); 435 FRIEND_TEST(AnomalyDurationDetectionE2eTest, TestDurationMetric_SUM_single_bucket); 436 FRIEND_TEST(AnomalyDurationDetectionE2eTest, TestDurationMetric_SUM_partial_bucket); 437 FRIEND_TEST(AnomalyDurationDetectionE2eTest, TestDurationMetric_SUM_multiple_buckets); 438 FRIEND_TEST(AnomalyDurationDetectionE2eTest, TestDurationMetric_SUM_long_refractory_period); 439 440 FRIEND_TEST(AlarmE2eTest, TestMultipleAlarms); 441 FRIEND_TEST(ConfigTtlE2eTest, TestCountMetric); 442 FRIEND_TEST(MetricActivationE2eTest, TestCountMetric); 443 FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithOneDeactivation); 444 FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithTwoDeactivations); 445 FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithSameDeactivation); 446 FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithTwoMetricsTwoDeactivations); 447 448 FRIEND_TEST(ConfigUpdateE2eTest, TestAlarms); 449 FRIEND_TEST(ConfigUpdateE2eTest, TestGaugeMetric); 450 FRIEND_TEST(ConfigUpdateE2eTest, TestValueMetric); 451 FRIEND_TEST(ConfigUpdateE2eTest, TestAnomalyDurationMetric); 452 FRIEND_TEST(ConfigUpdateE2eAbTest, TestHashStrings); 453 FRIEND_TEST(ConfigUpdateE2eAbTest, TestUidMapVersionStringInstaller); 454 FRIEND_TEST(ConfigUpdateE2eAbTest, TestConfigTtl); 455 456 FRIEND_TEST(CountMetricE2eTest, TestInitialConditionChanges); 457 FRIEND_TEST(CountMetricE2eTest, TestSlicedState); 458 FRIEND_TEST(CountMetricE2eTest, TestSlicedStateWithMap); 459 FRIEND_TEST(CountMetricE2eTest, TestMultipleSlicedStates); 460 FRIEND_TEST(CountMetricE2eTest, TestSlicedStateWithPrimaryFields); 461 FRIEND_TEST(CountMetricE2eTest, TestRepeatedFieldsAndEmptyArrays); 462 463 FRIEND_TEST(DurationMetricE2eTest, TestOneBucket); 464 FRIEND_TEST(DurationMetricE2eTest, TestTwoBuckets); 465 FRIEND_TEST(DurationMetricE2eTest, TestWithActivation); 466 FRIEND_TEST(DurationMetricE2eTest, TestWithCondition); 467 FRIEND_TEST(DurationMetricE2eTest, TestWithSlicedCondition); 468 FRIEND_TEST(DurationMetricE2eTest, TestWithActivationAndSlicedCondition); 469 FRIEND_TEST(DurationMetricE2eTest, TestWithSlicedState); 470 FRIEND_TEST(DurationMetricE2eTest, TestWithConditionAndSlicedState); 471 FRIEND_TEST(DurationMetricE2eTest, TestWithSlicedStateMapped); 472 FRIEND_TEST(DurationMetricE2eTest, TestSlicedStatePrimaryFieldsNotSubsetDimInWhat); 473 FRIEND_TEST(DurationMetricE2eTest, TestWithSlicedStatePrimaryFieldsSubset); 474 FRIEND_TEST(DurationMetricE2eTest, TestUploadThreshold); 475 FRIEND_TEST(DurationMetricE2eTest, TestConditionOnRepeatedEnumField); 476 477 FRIEND_TEST(ValueMetricE2eTest, TestInitialConditionChanges); 478 FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); 479 FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); 480 FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_WithActivation); 481 FRIEND_TEST(ValueMetricE2eTest, TestInitWithSlicedState); 482 FRIEND_TEST(ValueMetricE2eTest, TestInitWithSlicedState_WithDimensions); 483 FRIEND_TEST(ValueMetricE2eTest, TestInitWithSlicedState_WithIncorrectDimensions); 484 FRIEND_TEST(ValueMetricE2eTest, TestInitWithValueFieldPositionALL); 485 486 FRIEND_TEST(KllMetricE2eTest, TestInitWithKllFieldPositionALL); 487 488 FRIEND_TEST(StatsServiceStatsdInitTest, StatsServiceStatsdInitTest); 489 }; 490 491 } // namespace statsd 492 } // namespace os 493 } // namespace android 494