Lines Matching refs:stats

69     StatsdStats stats;  in TEST()  local
75 stats.noteConfigReceived(key, metricsCount, conditionsCount, matchersCount, alertsCount, {}, in TEST()
78 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
93 StatsdStats stats; in TEST() local
95 stats.noteConfigReceived(key, /*metricsCount=*/0, /*conditionsCount=*/0, /*matchersCount=*/0, in TEST()
98 stats.noteConfigMetadataProviderPromotionFailed(key); in TEST()
100 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
107 StatsdStats stats; in TEST() local
124 stats.noteConfigReceived(key, metricsCount, conditionsCount, matchersCount, alertsCount, {}, in TEST()
127 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
149 StatsdStats stats; in TEST() local
164 stats.noteConfigReceived(key, metricsCount, conditionsCount, matchersCount, alertsCount, {}, in TEST()
167 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
188 StatsdStats stats; in TEST() local
196 stats.noteConfigReceived(key, metricsCount, conditionsCount, matchersCount, alertsCount, {}, in TEST()
199 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
217 StatsdStats stats; in TEST() local
223 stats.noteConfigReceived(key, metricsCount, conditionsCount, matchersCount, alertsCount, {}, in TEST()
226 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
231 stats.noteConfigRemoved(key); in TEST()
233 report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
240 StatsdStats stats; in TEST() local
242 stats.noteConfigReceived(key, 2, 3, 4, 5, {std::make_pair(123, 456)}, nullopt); in TEST()
244 stats.noteMatcherMatched(key, StringToId("matcher1")); in TEST()
245 stats.noteMatcherMatched(key, StringToId("matcher1")); in TEST()
246 stats.noteMatcherMatched(key, StringToId("matcher2")); in TEST()
248 stats.noteConditionDimensionSize(key, StringToId("condition1"), 250); in TEST()
249 stats.noteConditionDimensionSize(key, StringToId("condition1"), 240); in TEST()
251 stats.noteMetricDimensionSize(key, StringToId("metric1"), 201); in TEST()
252 stats.noteMetricDimensionSize(key, StringToId("metric1"), 202); in TEST()
254 stats.noteAnomalyDeclared(key, StringToId("alert1")); in TEST()
255 stats.noteAnomalyDeclared(key, StringToId("alert1")); in TEST()
256 stats.noteAnomalyDeclared(key, StringToId("alert2")); in TEST()
259 stats.noteBroadcastSent(key); in TEST()
260 stats.noteBroadcastSent(key); in TEST()
263 stats.noteDataDropped(key, 123); in TEST()
266 stats.noteMetricsReportSent(key, 0, 1); in TEST()
267 stats.noteMetricsReportSent(key, 0, 2); in TEST()
268 stats.noteMetricsReportSent(key, 0, 3); in TEST()
271 stats.noteActiveStatusChanged(key, true); in TEST()
272 stats.noteActiveStatusChanged(key, true); in TEST()
275 stats.noteActiveStatusChanged(key, false); in TEST()
277 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ true); in TEST()
327 stats.noteMatcherMatched(key, StringToId("matcher99")); in TEST()
328 stats.noteConditionDimensionSize(key, StringToId("condition99"), 300); in TEST()
329 stats.noteMetricDimensionSize(key, StringToId("metric99tion99"), 270); in TEST()
330 stats.noteAnomalyDeclared(key, StringToId("alert99")); in TEST()
333 report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
354 StatsdStats stats; in TEST() local
357 stats.noteAtomLogged(util::SENSOR_STATE_CHANGED, 1000, false); in TEST()
359 stats.noteAtomLogged(util::SENSOR_STATE_CHANGED, now + 1, false); in TEST()
360 stats.noteAtomLogged(util::SENSOR_STATE_CHANGED, now + 2, false); in TEST()
361 stats.noteAtomLogged(util::APP_CRASH_OCCURRED, now + 3, false); in TEST()
363 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
384 StatsdStats stats; in TEST() local
389 stats.noteAtomLogged(newAtom1, now + 1, false); in TEST()
390 stats.noteAtomLogged(newAtom1, now + 2, false); in TEST()
391 stats.noteAtomLogged(newAtom2, now + 3, false); in TEST()
393 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
414 StatsdStats stats; in TEST() local
416 stats.updateMinPullIntervalSec(util::DISK_SPACE, 3333L); in TEST()
417 stats.updateMinPullIntervalSec(util::DISK_SPACE, 2222L); in TEST()
418 stats.updateMinPullIntervalSec(util::DISK_SPACE, 4444L); in TEST()
420 stats.notePull(util::DISK_SPACE); in TEST()
421 stats.notePullTime(util::DISK_SPACE, 1111L); in TEST()
422 stats.notePullDelay(util::DISK_SPACE, 1111L); in TEST()
423 stats.notePull(util::DISK_SPACE); in TEST()
424 stats.notePullTime(util::DISK_SPACE, 3333L); in TEST()
425 stats.notePullDelay(util::DISK_SPACE, 3335L); in TEST()
426 stats.notePull(util::DISK_SPACE); in TEST()
427 stats.notePullFromCache(util::DISK_SPACE); in TEST()
428 stats.notePullerCallbackRegistrationChanged(util::DISK_SPACE, true); in TEST()
429 stats.notePullerCallbackRegistrationChanged(util::DISK_SPACE, false); in TEST()
430 stats.notePullerCallbackRegistrationChanged(util::DISK_SPACE, true); in TEST()
431 stats.notePullBinderCallFailed(util::DISK_SPACE); in TEST()
432 stats.notePullUidProviderNotFound(util::DISK_SPACE); in TEST()
433 stats.notePullerNotFound(util::DISK_SPACE); in TEST()
434 stats.notePullerNotFound(util::DISK_SPACE); in TEST()
435 stats.notePullTimeout(util::DISK_SPACE, 3000L, 6000L); in TEST()
436 stats.notePullTimeout(util::DISK_SPACE, 4000L, 7000L); in TEST()
438 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
464 StatsdStats stats; in TEST() local
467 stats.noteBucketDropped(10000000000LL); in TEST()
469 stats.noteBucketBoundaryDelayNs(10000000000LL, -1L); in TEST()
470 stats.noteBucketBoundaryDelayNs(10000000000LL, -10L); in TEST()
471 stats.noteBucketBoundaryDelayNs(10000000000LL, 2L); in TEST()
473 stats.noteBucketBoundaryDelayNs(10000000001LL, 1L); in TEST()
475 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
492 StatsdStats stats; in TEST() local
495 stats.noteConfigReceived(key, 2, 3, 4, 5, {}, nullopt); in TEST()
496 stats.noteRestrictedMetricInsertError(key, metricId); in TEST()
497 stats.noteRestrictedMetricTableCreationError(key, metricId); in TEST()
498 stats.noteRestrictedMetricTableDeletionError(key, metricId); in TEST()
499 stats.noteDeviceInfoTableCreationFailed(key); in TEST()
500 stats.noteRestrictedMetricFlushLatency(key, metricId, 3000); in TEST()
501 stats.noteRestrictedMetricFlushLatency(key, metricId, 3001); in TEST()
502 stats.noteRestrictedMetricCategoryChanged(key, metricId); in TEST()
503 stats.noteRestrictedConfigFlushLatency(key, 4000); in TEST()
505 stats.noteConfigReceived(configKeyWithoutError, 2, 3, 4, 5, {}, nullopt); in TEST()
506 stats.noteDbCorrupted(key); in TEST()
507 stats.noteDbCorrupted(key); in TEST()
508 stats.noteDbSizeExceeded(key); in TEST()
509 stats.noteDbStatFailed(key); in TEST()
510 stats.noteDbConfigInvalid(key); in TEST()
511 stats.noteDbTooOld(key); in TEST()
512 stats.noteDbDeletionConfigRemoved(key); in TEST()
513 stats.noteDbDeletionConfigUpdated(key); in TEST()
514 stats.noteRestrictedConfigDbSize(key, 999, 111); in TEST()
516 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
545 StatsdStats stats; in TEST() local
550 stats.noteQueryRestrictedMetricSucceed(configKey.GetId(), configPackage, configKey.GetUid(), in TEST()
555 stats.noteQueryRestrictedMetricFailed(configIdWithError, configPackage, std::nullopt, in TEST()
557 stats.noteQueryRestrictedMetricFailed(configIdWithError, configPackage, std::nullopt, in TEST()
561 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
584 StatsdStats stats; in TEST() local
585 stats.noteRegisteredAnomalyAlarmChanged(); in TEST()
586 stats.noteRegisteredAnomalyAlarmChanged(); in TEST()
588 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
593 StatsdStats stats; in TEST() local
599 stats.noteConfigReceived(key, 2, 3, 4, 5, {}, nullopt); in TEST()
602 stats.noteDataDropped(key, timestamps[i]); in TEST()
603 stats.noteBroadcastSent(key, timestamps[i]); in TEST()
604 stats.noteMetricsReportSent(key, 0, timestamps[i], i + 1); in TEST()
605 stats.noteActiveStatusChanged(key, true, timestamps[i]); in TEST()
606 stats.noteActiveStatusChanged(key, false, timestamps[i]); in TEST()
612 stats.noteDataDropped(key, 123, 10000); in TEST()
613 stats.noteBroadcastSent(key, 10000); in TEST()
614 stats.noteMetricsReportSent(key, 0, 10000, 21); in TEST()
615 stats.noteActiveStatusChanged(key, true, 10000); in TEST()
616 stats.noteActiveStatusChanged(key, false, 10000); in TEST()
618 EXPECT_TRUE(stats.mConfigStats.find(key) != stats.mConfigStats.end()); in TEST()
619 const auto& configStats = stats.mConfigStats[key]; in TEST()
645 StatsdStats stats; in TEST() local
649 stats.noteSystemServerRestart(timestamps[i]); in TEST()
652 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
656 stats.noteSystemServerRestart(StatsdStats::kMaxSystemServerRestarts + 1); in TEST()
658 report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
664 StatsdStats stats; in TEST() local
667 stats.noteActivationBroadcastGuardrailHit(uid1, 10); in TEST()
668 stats.noteActivationBroadcastGuardrailHit(uid1, 20); in TEST()
672 stats.noteActivationBroadcastGuardrailHit(uid2, i); in TEST()
675 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
701 StatsdStats stats; in TEST() local
711 stats.noteAtomLogged(pushAtomTag, /*timeSec=*/0, false); in TEST()
712 stats.noteAtomError(pushAtomTag, /*pull=*/false); in TEST()
714 stats.noteAtomError(pullAtomTag, /*pull=*/true); in TEST()
717 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
735 StatsdStats stats; in TEST() local
742 stats.noteEventQueueOverflow(/*oldestEventTimestampNs*/ 0, pushAtomTag, false); in TEST()
743 stats.noteEventQueueOverflow(/*oldestEventTimestampNs*/ 0, nonPlatformPushAtomTag, false); in TEST()
746 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ true); in TEST()
748 ASSERT_EQ(0, stats.mPushedAtomDropsStats.size()); in TEST()
769 StatsdStats stats; in TEST() local
771 stats.noteEventQueueSize(100, 1000); in TEST()
772 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ true); in TEST()
779 StatsdStats stats; in TEST() local
786 stats.noteAtomLogged(pushAtomTag, /*timeSec*/ 0, false); in TEST()
787 stats.noteAtomLogged(nonPlatformPushAtomTag, /*timeSec*/ 0, false); in TEST()
792 stats.noteEventQueueOverflow(/*oldestEventTimestampNs*/ 0, pushAtomTag, false); in TEST()
793 stats.noteEventQueueOverflow(/*oldestEventTimestampNs*/ 0, nonPlatformPushAtomTag, false); in TEST()
796 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
817 StatsdStats stats; in TEST() local
824 stats.noteAtomLogged(pushAtomTag, /*timeSec=*/0, /*isSkipped*/ true); in TEST()
825 stats.noteAtomLogged(nonPlatformPushAtomTag, /*timeSec=*/0, /*isSkipped*/ true); in TEST()
828 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
847 StatsdStats stats; in TEST() local
854 stats.noteAtomLogged(pushAtomTag, /*timeSec*/ 0, false); in TEST()
855 stats.noteAtomLogged(nonPlatformPushAtomTag, /*timeSec*/ 0, false); in TEST()
860 stats.noteEventQueueOverflow(/*oldestEventTimestampNs*/ 0, pushAtomTag, true); in TEST()
861 stats.noteEventQueueOverflow(/*oldestEventTimestampNs*/ 0, nonPlatformPushAtomTag, true); in TEST()
864 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
885 StatsdStats stats; in TEST() local
888 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
893 StatsdStats stats; in TEST() local
898 stats.noteBucketCount(metricId2); in TEST()
899 stats.noteHardDimensionLimitReached(metricId3); in TEST()
902 EXPECT_FALSE(stats.hasHitDimensionGuardrail(metricId1)); in TEST()
905 EXPECT_FALSE(stats.hasHitDimensionGuardrail(metricId2)); in TEST()
908 EXPECT_TRUE(stats.hasHitDimensionGuardrail(metricId3)); in TEST()
912 StatsdStats stats; in TEST() local
914 stats.noteSubscriptionStarted(/* id */ 1, /* pushedCount */ 3, /* pulledCount */ 1); in TEST()
916 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
930 StatsdStats stats; in TEST() local
932 stats.noteSubscriptionStarted(/* id */ 1, /* pushedCount */ 3, /* pulledCount */ 1); in TEST()
933 stats.noteSubscriptionFlushed(/* id */ 1); in TEST()
935 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
944 StatsdStats stats; in TEST() local
946 stats.noteSubscriptionStarted(/* id */ 1, /* pushedCount */ 3, /* pulledCount */ 1); in TEST()
947 stats.noteSubscriptionEnded(/* id */ 1); in TEST()
949 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
957 StatsdStats stats; in TEST() local
959 stats.noteSubscriptionAtomPulled(/* atomId */ 10'001); in TEST()
961 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
969 StatsdStats stats; in TEST() local
971 stats.noteSubscriptionPullThreadWakeup(); in TEST()
973 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
980 StatsdStats stats; in TEST() local
987 stats.noteSubscriptionStarted(id, /* pushedCount */ 3, /* pulledCount */ 1); in TEST()
990 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
999 StatsdStats stats; in TEST() local
1005 stats.noteSubscriptionStarted(id, /* pushedCount */ 3, /* pulledCount */ 1); in TEST()
1009 stats.noteSubscriptionEnded(/* id */ 5); in TEST()
1014 stats.noteSubscriptionStarted(maxSubs + 1, /* pushedCount */ 3, /* pulledCount */ 1); in TEST()
1016 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
1039 StatsdStats stats; in TEST() local
1055 stats.noteAtomSocketLoss(info); in TEST()
1058 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
1082 StatsdStats stats; in TEST() local
1101 stats.noteAtomSocketLoss(info); in TEST()
1104 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
1123 StatsdStats stats; in TEST() local
1124 stats.noteBatchSocketRead(1, 0, 0, 0, 0, empty); // bin 1 in TEST()
1125 stats.noteBatchSocketRead(2, 0, 0, 0, 0, empty); // bin 2 in TEST()
1126 stats.noteBatchSocketRead(2, 0, 0, 0, 0, empty); // bin 2 in TEST()
1127 stats.noteBatchSocketRead(4, 0, 0, 0, 0, empty); // bin 4 in TEST()
1128 stats.noteBatchSocketRead(5, 0, 0, 0, 0, empty); // bin 5 in TEST()
1129 stats.noteBatchSocketRead(9, 0, 0, 0, 0, empty); // bin 5 in TEST()
1130 stats.noteBatchSocketRead(9, 0, 0, 0, 0, empty); // bin 5 in TEST()
1131 stats.noteBatchSocketRead(10, 0, 0, 0, 0, empty); // bin 6 in TEST()
1132 stats.noteBatchSocketRead(19, 0, 0, 0, 0, empty); // bin 6 in TEST()
1133 stats.noteBatchSocketRead(30, 0, 0, 0, 0, empty); // bin 8 in TEST()
1134 stats.noteBatchSocketRead(32, 0, 0, 0, 0, empty); // bin 8 in TEST()
1135 stats.noteBatchSocketRead(39, 0, 0, 0, 0, empty); // bin 8 in TEST()
1136 stats.noteBatchSocketRead(90, 0, 0, 0, 0, empty); // bin 14 in TEST()
1137 stats.noteBatchSocketRead(99, 0, 0, 0, 0, empty); // bin 14 in TEST()
1138 stats.noteBatchSocketRead(100, 0, 0, 0, 0, empty); // bin 15 in TEST()
1139 stats.noteBatchSocketRead(100, 0, 0, 0, 0, empty); // bin 15 in TEST()
1140 stats.noteBatchSocketRead(199, 0, 0, 0, 0, empty); // bin 15 in TEST()
1141 stats.noteBatchSocketRead(200, 0, 0, 0, 0, empty); // bin 16 in TEST()
1142 stats.noteBatchSocketRead(299, 0, 0, 0, 0, empty); // bin 16 in TEST()
1143 stats.noteBatchSocketRead(999, 0, 0, 0, 0, empty); // bin 23 in TEST()
1144 stats.noteBatchSocketRead(1000, 0, 0, 0, 0, empty); // bin 24 in TEST()
1145 stats.noteBatchSocketRead(1199, 1, 2, 3, 4, m1199); // bin 24 in TEST()
1146 stats.noteBatchSocketRead(1200, 5, 6, 7, 8, m1200); // bin 25 in TEST()
1147 stats.noteBatchSocketRead(1800, 0, 0, 0, 0, empty); // bin 28 in TEST()
1148 stats.noteBatchSocketRead(1999, 0, 0, 0, 0, empty); // bin 28 in TEST()
1149 stats.noteBatchSocketRead(2000, 0, 0, 0, 0, empty); // bin 29 in TEST()
1150 stats.noteBatchSocketRead(120000, 10, INT64_MAX, 50, INT64_MAX, m120000); // bin 29 in TEST()
1152 StatsdStatsReport report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()
1191 stats.reset(); in TEST()
1192 report = getStatsdStatsReport(stats, /* reset stats */ false); in TEST()