Lines Matching refs:bucketStartTimeNs

54 const int64_t bucketStartTimeNs = 10000000000;  variable
56 const int64_t bucket2StartTimeNs = bucketStartTimeNs + bucketSizeNs;
57 const int64_t bucket3StartTimeNs = bucketStartTimeNs + 2 * bucketSizeNs;
58 const int64_t bucket4StartTimeNs = bucketStartTimeNs + 3 * bucketSizeNs;
59 const int64_t bucket5StartTimeNs = bucketStartTimeNs + 4 * bucketSizeNs;
60 const int64_t bucket6StartTimeNs = bucketStartTimeNs + 5 * bucketSizeNs;
146 /*slicedStateAtoms=*/{}, /*stateGroupMap=*/{}, bucketStartTimeNs, bucketStartTimeNs, in createValueProducerWithSampling()
170 /*slicedStateAtoms=*/{}, /*stateGroupMap=*/{}, bucketStartTimeNs, in createValueProducerWithEventMatcherWizard()
171 bucketStartTimeNs, eventMatcherWizard); in createValueProducerWithEventMatcherWizard()
179 const int64_t timeBaseNs = bucketStartTimeNs,
180 const int64_t startTimeNs = bucketStartTimeNs,
301 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
305 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
327 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
342 {bucketStartTimeNs, bucket2StartTimeNs}, {bucket2StartTimeNs, bucket3StartTimeNs}); in TEST()
357 {bucketStartTimeNs, bucket2StartTimeNs, bucket3StartTimeNs}, in TEST()
369 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST_P()
371 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 1)); in TEST_P()
409 {0, 0}, {bucketStartTimeNs, bucket2StartTimeNs}, in TEST_P()
426 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
430 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs, 3, 3)); in TEST()
452 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
472 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
483 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
536 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
591 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); // First condition change. in TEST()
593 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 100)); in TEST()
615 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
634 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
644 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
657 {0, 0}, {bucketStartTimeNs, bucket2StartTimeNs}, in TEST()
674 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST_P()
678 int64_t partialBucketSplitTimeNs = bucketStartTimeNs + 150; in TEST_P()
688 {partialBucketSplitTimeNs - bucketStartTimeNs}, {0}, in TEST_P()
689 {bucketStartTimeNs}, {partialBucketSplitTimeNs}); in TEST_P()
695 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 59 * NS_PER_SEC, 20); in TEST_P()
699 {partialBucketSplitTimeNs - bucketStartTimeNs}, {0}, in TEST_P()
700 {bucketStartTimeNs}, {partialBucketSplitTimeNs}); in TEST_P()
709 {partialBucketSplitTimeNs - bucketStartTimeNs, in TEST_P()
712 {bucketStartTimeNs, partialBucketSplitTimeNs}, in TEST_P()
714 EXPECT_EQ(bucketStartTimeNs + bucketSizeNs, valueProducer->mCurrentBucketStartTimeNs); in TEST_P()
780 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
807 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 1); // Condition change to true time. in TEST_P()
809 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 100)); in TEST_P()
824 valueProducer->onConditionChanged(true, bucketStartTimeNs + 1); in TEST_P()
842 {(bucket2StartTimeNs - 100) - (bucketStartTimeNs + 1)}, {0}, in TEST_P()
843 {bucketStartTimeNs}, {partialBucketSplitTimeNs}); in TEST_P()
860 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
863 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 20); in TEST()
896 EXPECT_EQ(bucketStartTimeNs, data.bucket_info(0).start_bucket_elapsed_nanos()); in TEST()
916 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
921 valueProducer->onConditionChangedLocked(true, bucketStartTimeNs + 15); in TEST()
924 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 20); in TEST()
935 CreateRepeatedValueLogEvent(&event3, tagId, bucketStartTimeNs + 30, 30); in TEST()
943 valueProducer->onConditionChangedLocked(false, bucketStartTimeNs + 35); in TEST()
946 CreateRepeatedValueLogEvent(&event4, tagId, bucketStartTimeNs + 40, 40); in TEST()
970 EXPECT_EQ(bucketStartTimeNs, data.bucket_info(0).start_bucket_elapsed_nanos()); in TEST()
999 valueProducer->addAnomalyTracker(alert, alarmMonitor, UPDATE_NEW, bucketStartTimeNs); in TEST()
1002 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 1 * NS_PER_SEC, 10); in TEST()
1005 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 2 + NS_PER_SEC, 20); in TEST()
1009 bucketStartTimeNs + 2 * bucketSizeNs + 1 * NS_PER_SEC, 130); in TEST()
1013 bucketStartTimeNs + 3 * bucketSizeNs + 1 * NS_PER_SEC, 1); in TEST()
1017 bucketStartTimeNs + 3 * bucketSizeNs + 2 * NS_PER_SEC, 150); in TEST()
1021 bucketStartTimeNs + 3 * bucketSizeNs + 10 * NS_PER_SEC, 160); in TEST()
1066 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 1); // Condition change to true time. in TEST()
1068 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 0)); in TEST()
1083 valueProducer->addAnomalyTracker(alert, alarmMonitor, UPDATE_NEW, bucketStartTimeNs); in TEST()
1085 valueProducer->onConditionChanged(true, bucketStartTimeNs + 1); in TEST()
1098 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
1153 EXPECT_EQ(bucketStartTimeNs, valueProducer->mSkippedBuckets[0].bucketStartTimeNs); in TEST()
1159 EXPECT_EQ(bucket3StartTimeNs, valueProducer->mSkippedBuckets[1].bucketStartTimeNs); in TEST()
1178 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); // First condition change. in TEST()
1180 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 100)); in TEST()
1195 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
1214 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1224 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1243 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); in TEST()
1245 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 100)); in TEST()
1269 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
1285 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1294 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1318 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1326 {bucketStartTimeNs, bucket2StartTimeNs}, {bucket2StartTimeNs, bucket3StartTimeNs}); in TEST()
1343 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
1346 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 20); in TEST()
1366 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1383 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
1394 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 20); in TEST()
1404 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1423 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
1426 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 15); in TEST()
1467 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
1470 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 15); in TEST()
1488 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1506 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
1520 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 15, 15); in TEST()
1561 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1580 CreateThreeValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 1, 10, 20); in TEST()
1583 CreateThreeValueLogEvent(&event2, tagId, bucketStartTimeNs + 15, 1, 15, 22); in TEST()
1683 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
1687 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs, 1, 3)); in TEST()
1749 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
1753 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs, 1, 3)); in TEST()
1841 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
1845 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs, 1, 3)); in TEST()
1877 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1905 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
1942 EXPECT_EQ(bucketStartTimeNs, iterator->second[0].mBucketStartNs); in TEST()
1957 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 8, _)) in TEST()
1961 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 100)); in TEST()
1969 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
1996 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); // Condition change to true. in TEST()
1998 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 100)); in TEST()
2007 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
2020 valueProducer->onConditionChanged(false, bucketStartTimeNs + 20); in TEST()
2037 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
2039 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 50)); in TEST()
2044 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 1); // Condition change to false. in TEST()
2046 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 100)); in TEST()
2054 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
2058 valueProducer->onConditionChanged(false, bucketStartTimeNs + 1); in TEST()
2075 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 1, _)) in TEST()
2079 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 120)); in TEST()
2088 valueProducer->onConditionChanged(true, bucketStartTimeNs + 1); in TEST()
2109 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
2117 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 1, _)) in TEST()
2121 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 100)); in TEST()
2129 valueProducer->onConditionChanged(true, bucketStartTimeNs + 1); in TEST()
2154 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 3); in TEST()
2156 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 130)); in TEST()
2167 allData.push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 110)); in TEST()
2168 valueProducer->onDataPulled(allData, PullResult::PULL_RESULT_SUCCESS, bucketStartTimeNs); in TEST()
2172 valueProducer->onConditionChanged(false, bucketStartTimeNs + 2); in TEST()
2173 valueProducer->onConditionChanged(true, bucketStartTimeNs + 3); in TEST()
2202 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
2210 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 2), dropEvent.drop_time_millis()); in TEST()
2223 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 2, _)) in TEST()
2228 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, i)); in TEST()
2238 valueProducer->onConditionChanged(true, bucketStartTimeNs + 2); in TEST()
2266 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
2274 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 2), dropEvent.drop_time_millis()); in TEST()
2288 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 2); in TEST()
2290 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 120)); in TEST()
2296 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 3); in TEST()
2298 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 130)); in TEST()
2309 allData.push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 110)); in TEST()
2310 valueProducer->onDataPulled(allData, PullResult::PULL_RESULT_FAIL, bucketStartTimeNs); in TEST()
2312 valueProducer->onConditionChanged(false, bucketStartTimeNs + 2); in TEST()
2313 valueProducer->onConditionChanged(true, bucketStartTimeNs + 3); in TEST()
2342 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
2350 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 2), dropEvent.drop_time_millis()); in TEST()
2365 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 2); in TEST()
2367 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 120)); in TEST()
2373 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 3); in TEST()
2375 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 8, 130)); in TEST()
2386 allData.push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, 110)); in TEST()
2387 valueProducer->onDataPulled(allData, PullResult::PULL_RESULT_SUCCESS, bucketStartTimeNs); in TEST()
2389 valueProducer->onConditionChanged(false, bucketStartTimeNs + 2); in TEST()
2390 valueProducer->onConditionChanged(true, bucketStartTimeNs + 3); in TEST()
2418 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
2432 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
2437 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
2481 {bucketStartTimeNs, bucket4StartTimeNs}, {bucket2StartTimeNs, bucket5StartTimeNs}); in TEST()
2495 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
2497 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
2503 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20); in TEST()
2509 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 30); in TEST()
2511 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30, 10)); in TEST()
2519 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
2530 valueProducer->onConditionChanged(false, bucketStartTimeNs + 20); in TEST()
2537 valueProducer->onConditionChanged(true, bucketStartTimeNs + 30); in TEST()
2557 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
2568 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
2570 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST()
2575 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 11); in TEST()
2577 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 2)); in TEST()
2582 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 12); in TEST()
2584 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 5)); in TEST()
2592 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
2593 valueProducer->onConditionChanged(false, bucketStartTimeNs + 11); in TEST()
2594 valueProducer->onConditionChanged(true, bucketStartTimeNs + 12); in TEST()
2613 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
2623 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 10, _)) in TEST()
2628 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST()
2636 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
2660 int64_t partialBucketSplitTimeNs = bucketStartTimeNs + bucketSizeNs / 2; in TEST_P()
2665 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST_P()
2667 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST_P()
2691 valueProducer->addAnomalyTracker(alert, alarmMonitor, UPDATE_NEW, bucketStartTimeNs); in TEST_P()
2705 {partialBucketSplitTimeNs - bucketStartTimeNs}, {0}, in TEST_P()
2706 {bucketStartTimeNs}, {partialBucketSplitTimeNs}); in TEST_P()
2714 {partialBucketSplitTimeNs - bucketStartTimeNs}, {0}, in TEST_P()
2715 {bucketStartTimeNs}, {partialBucketSplitTimeNs}); in TEST_P()
2720 EXPECT_EQ(partialBucketSplitTimeNs, valueProducer->mSkippedBuckets[0].bucketStartTimeNs); in TEST_P()
2750 valueProducer->onConditionChanged(false, bucketStartTimeNs); in TEST()
2787 allData.push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30, 10)); in TEST()
2788 valueProducer->onDataPulled(allData, PullResult::PULL_RESULT_SUCCESS, bucketStartTimeNs + 30); in TEST()
2796 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
2803 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
2808 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST()
2817 allData.push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30, 10)); in TEST()
2818 valueProducer->onDataPulled(allData, PullResult::PULL_RESULT_SUCCESS, bucketStartTimeNs + 30); in TEST()
2826 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
2838 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST_P()
2840 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST_P()
2868 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST_P()
2879 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); in TEST()
2881 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST()
2887 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
2889 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
2897 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
2898 valueProducer->onConditionChanged(false, bucketStartTimeNs + 10); in TEST()
2899 valueProducer->onConditionChanged(false, bucketStartTimeNs + 12); in TEST()
2911 assertPastBucketValuesSingleKey(valueProducer->mPastBuckets, {2}, {2}, {0}, {bucketStartTimeNs}, in TEST()
2926 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 1)); in TEST()
2952 allData.push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 3, 10)); in TEST()
2953 valueProducer->onDataPulled(allData, PullResult::PULL_RESULT_FAIL, bucketStartTimeNs + 3); in TEST()
2977 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
2982 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs, tagId, 1, 1)); in TEST()
3018 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
3020 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs, tagId, 1, 1)); in TEST()
3025 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
3028 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 10, tagId, 3, 3)); in TEST()
3038 valueProducer->onDumpReport(bucketStartTimeNs + 10, true /* include recent buckets */, true, in TEST()
3062 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
3077 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); in TEST()
3079 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30, 10)); in TEST()
3085 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50); in TEST()
3087 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 50, 20)); in TEST()
3094 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
3095 valueProducer->onConditionChanged(false, bucketStartTimeNs + 50); in TEST()
3112 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
3124 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 8, _)) in TEST()
3129 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30, 10)); in TEST()
3136 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
3144 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
3178 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 8); in TEST()
3180 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30, 10)); in TEST()
3188 valueProducer->onConditionChanged(true, bucketStartTimeNs + 8); in TEST()
3189 valueProducer->onConditionChanged(false, bucketStartTimeNs + 50); in TEST()
3219 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 20, _)) in TEST()
3224 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 20, 10)); in TEST()
3233 valueProducer->onConditionChanged(true, bucketStartTimeNs + 20); in TEST()
3238 valueProducer->onDumpReport(bucketStartTimeNs + 40, true /* include recent buckets */, true, in TEST()
3248 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3250 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 40), in TEST()
3256 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 40), dropEvent.drop_time_millis()); in TEST()
3267 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 50, _)) in TEST()
3272 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 50, 10)); in TEST()
3281 valueProducer->onConditionChanged(true, bucketStartTimeNs + 50); in TEST()
3325 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50); in TEST()
3327 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 50, 10)); in TEST()
3344 valueProducer->onConditionChanged(true, bucketStartTimeNs + 50); in TEST()
3391 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50); in TEST()
3393 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 50, 10)); in TEST()
3399 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10000); in TEST()
3401 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 100, 15)); in TEST()
3410 valueProducer->onConditionChanged(true, bucketStartTimeNs + 50); in TEST()
3415 int64_t dumpReportTimeNs = bucketStartTimeNs + 10000; in TEST()
3424 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3447 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50); in TEST()
3449 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 50, 10)); in TEST()
3460 valueProducer->onConditionChanged(true, bucketStartTimeNs + 50); in TEST()
3465 int64_t dumpReportTimeNs = bucketStartTimeNs + 10000; in TEST()
3474 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3497 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
3499 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10, 10)); in TEST()
3516 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
3537 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3574 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
3576 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10, 10)); in TEST()
3582 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 9000000); in TEST()
3585 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 9000000, 15)); in TEST()
3594 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
3599 int64_t dumpReportTimeNs = bucketStartTimeNs + 9000000; in TEST()
3608 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3634 int64_t dumpReportTimeNs = bucketStartTimeNs + 10000000000; // 10 seconds in TEST()
3643 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3686 int64_t appUpgradeTimeNs = bucketStartTimeNs + 5 * NS_PER_SEC; in TEST()
3711 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3755 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
3757 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10, 10)); in TEST()
3774 int64_t conditionChangeTimeNs = bucketStartTimeNs + 10; in TEST()
3816 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs + 10, _)) in TEST()
3821 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10, 10)); in TEST()
3830 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
3835 int64_t dumpReportTimeNs = bucketStartTimeNs + 1000; in TEST()
3844 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3852 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 10), dropEvent.drop_time_millis()); in TEST()
3871 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10); in TEST()
3873 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 1, i)); in TEST()
3888 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 220); in TEST()
3890 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 220, 10)); in TEST()
3899 valueProducer->onConditionChanged(true, bucketStartTimeNs + 10); in TEST()
3902 valueProducer->onConditionChanged(false, bucketStartTimeNs + 30); in TEST()
3903 valueProducer->onConditionChanged(true, bucketStartTimeNs + 50); in TEST()
3904 valueProducer->onConditionChanged(false, bucketStartTimeNs + 70); in TEST()
3905 valueProducer->onConditionChanged(true, bucketStartTimeNs + 90); in TEST()
3906 valueProducer->onConditionChanged(false, bucketStartTimeNs + 100); in TEST()
3907 valueProducer->onConditionChanged(true, bucketStartTimeNs + 150); in TEST()
3908 valueProducer->onConditionChanged(false, bucketStartTimeNs + 170); in TEST()
3909 valueProducer->onConditionChanged(true, bucketStartTimeNs + 190); in TEST()
3910 valueProducer->onConditionChanged(false, bucketStartTimeNs + 200); in TEST()
3913 valueProducer->onConditionChanged(true, bucketStartTimeNs + 220); in TEST()
3918 int64_t dumpReportTimeNs = bucketStartTimeNs + 1000; in TEST()
3921 valueProducer->onDumpReport(bucketStartTimeNs + 1000, true /* include recent buckets */, true, in TEST()
3929 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
3937 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 10), dropEvent.drop_time_millis()); in TEST()
3941 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 30), dropEvent.drop_time_millis()); in TEST()
3945 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 50), dropEvent.drop_time_millis()); in TEST()
3949 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 70), dropEvent.drop_time_millis()); in TEST()
3953 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 90), dropEvent.drop_time_millis()); in TEST()
3957 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 100), dropEvent.drop_time_millis()); in TEST()
3961 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 150), dropEvent.drop_time_millis()); in TEST()
3965 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 170), dropEvent.drop_time_millis()); in TEST()
3969 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 190), dropEvent.drop_time_millis()); in TEST()
3973 EXPECT_EQ(NanoToMillis(bucketStartTimeNs + 200), dropEvent.drop_time_millis()); in TEST()
3991 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
3993 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
3999 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4002 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 5 * NS_PER_SEC, 5)); in TEST()
4008 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4011 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, 9)); in TEST()
4017 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 15 * NS_PER_SEC); in TEST()
4020 tagId, bucketStartTimeNs + 15 * NS_PER_SEC, 21)); in TEST()
4026 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
4029 tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 30)); in TEST()
4062 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs); in TEST()
4066 bucketStartTimeNs + 5 * NS_PER_SEC, android::view::DisplayStateEnum::DISPLAY_STATE_ON); in TEST()
4085 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4095 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4098 screenEvent = CreateScreenStateChangedEvent(bucketStartTimeNs + 10 * NS_PER_SEC, in TEST()
4117 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4127 bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4137 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4140 screenEvent = CreateScreenStateChangedEvent(bucketStartTimeNs + 15 * NS_PER_SEC, in TEST()
4162 bucketStartTimeNs + 15 * NS_PER_SEC); in TEST()
4172 bucketStartTimeNs + 15 * NS_PER_SEC); in TEST()
4182 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4187 valueProducer->onDumpReport(bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
4208 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
4257 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
4259 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
4265 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4268 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 5 * NS_PER_SEC, 5)); in TEST()
4280 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 15 * NS_PER_SEC); in TEST()
4283 tagId, bucketStartTimeNs + 15 * NS_PER_SEC, 21)); in TEST()
4289 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
4292 tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 30)); in TEST()
4336 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs); in TEST()
4340 bucketStartTimeNs + 5 * NS_PER_SEC, android::view::DisplayStateEnum::DISPLAY_STATE_ON); in TEST()
4358 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4368 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4372 screenEvent = CreateScreenStateChangedEvent(bucketStartTimeNs + 10 * NS_PER_SEC, in TEST()
4391 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4401 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4405 screenEvent = CreateScreenStateChangedEvent(bucketStartTimeNs + 12 * NS_PER_SEC, in TEST()
4424 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4434 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4437 screenEvent = CreateScreenStateChangedEvent(bucketStartTimeNs + 15 * NS_PER_SEC, in TEST()
4456 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 15 * NS_PER_SEC); in TEST()
4466 bucketStartTimeNs + 15 * NS_PER_SEC); in TEST()
4476 bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
4481 valueProducer->onDumpReport(bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
4501 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
4590 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
4592 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs, 1 /*uid*/, 3)); in TEST()
4593 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs, 2 /*uid*/, 7)); in TEST()
4599 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
4601 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
4604 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
4611 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
4614 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, in TEST()
4616 data->push_back(CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, in TEST()
4673 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 20 * NS_PER_SEC, 1 /* uid */, in TEST()
4681 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 40 * NS_PER_SEC, 2 /* uid */, in TEST()
4747 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {3}, in TEST()
4756 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {4}, in TEST()
4776 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {2}, in TEST()
4785 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {6}, in TEST()
4820 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
4822 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
4828 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4831 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, 5)); in TEST()
4838 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
4845 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
4848 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, 7)); in TEST()
4854 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
4857 tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 15)); in TEST()
4889 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs); in TEST()
4893 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4911 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4920 bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4925 CreateBatterySaverOffEvent(/*timestamp=*/bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
4938 bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
4947 bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4951 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
4968 bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
4977 bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
4982 valueProducer->onDumpReport(bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
4997 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
5005 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
5036 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
5044 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5051 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
5054 tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 15)); in TEST()
5078 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5087 valueProducer->onDumpReport(bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
5121 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
5123 data->push_back(CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs, 3)); in TEST()
5129 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5132 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, 5)); in TEST()
5138 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5141 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, 7)); in TEST()
5190 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs); in TEST()
5194 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5209 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5218 bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5222 CreateBatterySaverOffEvent(/*timestamp=*/bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5237 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5246 bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5255 bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5297 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {2}, in TEST()
5305 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {2}, in TEST()
5315 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {3}, in TEST()
5345 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5348 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, 3)); in TEST()
5354 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5357 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30 * NS_PER_SEC, 5)); in TEST()
5364 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
5371 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 45 * NS_PER_SEC); in TEST()
5374 tagId, bucketStartTimeNs + 45 * NS_PER_SEC, 14)); in TEST()
5380 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
5383 tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 20)); in TEST()
5403 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5419 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5430 valueProducer->onConditionChanged(false, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5446 bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5457 CreateBatterySaverOffEvent(/*timestamp=*/bucketStartTimeNs + 35 * NS_PER_SEC); in TEST()
5463 valueProducer->onConditionChanged(true, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
5474 bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5485 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 45 * NS_PER_SEC); in TEST()
5498 valueProducer->onDumpReport(bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
5515 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucketStartTimeNs + 50 * NS_PER_SEC, in TEST()
5574 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5576 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, in TEST()
5578 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, in TEST()
5582 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 10 * NS_PER_SEC, in TEST()
5589 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5591 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
5593 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
5597 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
5605 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 25 * NS_PER_SEC); in TEST()
5607 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 25 * NS_PER_SEC, in TEST()
5611 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 25 * NS_PER_SEC, in TEST()
5615 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 25 * NS_PER_SEC, in TEST()
5623 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
5625 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, in TEST()
5627 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, in TEST()
5629 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, in TEST()
5637 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 45 * NS_PER_SEC); in TEST()
5639 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 45 * NS_PER_SEC, in TEST()
5641 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 45 * NS_PER_SEC, in TEST()
5643 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 45 * NS_PER_SEC, in TEST()
5691 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 10 * NS_PER_SEC, 1 /* uid */, in TEST()
5698 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 20 * NS_PER_SEC, 1 /* uid */, in TEST()
5705 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 25 * NS_PER_SEC, 2 /* uid */, in TEST()
5711 valueProducer->onConditionChanged(false, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
5715 valueProducer->onConditionChanged(true, bucketStartTimeNs + 45 * NS_PER_SEC); in TEST()
5820 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5823 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, 3)); in TEST()
5829 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5832 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30 * NS_PER_SEC, 5)); in TEST()
5862 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
5868 valueProducer->onConditionChanged(true, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5888 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
5900 CreateBatterySaverOffEvent(/*timestamp=*/bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5918 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
5928 bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
6016 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
6019 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, 3)); in TEST()
6025 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
6028 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 30 * NS_PER_SEC, 5)); in TEST()
6034 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
6037 CreateRepeatedValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, 9)); in TEST()
6076 CreateBatterySaverOnEvent(/*timestamp=*/bucketStartTimeNs + 10 * NS_PER_SEC); in TEST()
6082 valueProducer->onConditionChanged(true, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
6088 CreateBatterySaverOffEvent(/*timestamp=*/bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
6094 valueProducer->onConditionChanged(false, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
6143 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {2}, in TEST()
6153 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {4}, in TEST()
6209 EXPECT_EQ(eventTimeNs, bucketStartTimeNs); in TEST()
6211 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs, 1 /*uid*/, 1, in TEST()
6213 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs, 1 /*uid*/, 1, in TEST()
6215 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs, 2 /*uid*/, 1, in TEST()
6222 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 20 * NS_PER_SEC); in TEST()
6224 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
6227 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 20 * NS_PER_SEC, in TEST()
6234 EXPECT_EQ(eventTimeNs, bucketStartTimeNs + 25 * NS_PER_SEC); in TEST()
6236 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 25 * NS_PER_SEC, in TEST()
6239 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 25 * NS_PER_SEC, in TEST()
6242 data->push_back(CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 25 * NS_PER_SEC, in TEST()
6291 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 20 * NS_PER_SEC, 1 /* uid */, in TEST()
6298 CreateUidProcessStateChangedEvent(bucketStartTimeNs + 25 * NS_PER_SEC, 2 /* uid */, in TEST()
6356 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {4}, in TEST()
6370 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {8}, in TEST()
6400 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {7}, in TEST()
6431 int64_t appUpdateTimeNs = bucketStartTimeNs + 1000; in TEST()
6437 int64_t dumpReportTimeNs = bucketStartTimeNs + 10000000000; // 10 seconds in TEST()
6446 EXPECT_EQ(NanoToMillis(bucketStartTimeNs), in TEST()
6473 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 1, 1 /*uid*/, 5, 5)); in TEST()
6475 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 1, 2 /*uid*/, 5, 5)); in TEST()
6522 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {16, 16}, -1, in TEST()
6560 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
6572 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
6582 {bucketStartTimeNs, bucket2StartTimeNs}, in TEST()
6613 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
6614 valueProducer->onConditionChanged(false, bucketStartTimeNs + conditionDurationNs); in TEST()
6624 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
6638 {bucketStartTimeNs, bucket2StartTimeNs}, {bucket2StartTimeNs, bucket3StartTimeNs}); in TEST()
6669 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
6677 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
6696 {pullDelayNs, -pullDelayNs}, {bucketStartTimeNs, bucket2StartTimeNs}, in TEST()
6728 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
6732 valueProducer->onConditionChanged(false, bucketStartTimeNs + conditionDurationNs); in TEST()
6739 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
6750 {bucketStartTimeNs, bucket2StartTimeNs}, {bucket2StartTimeNs, bucket3StartTimeNs}); in TEST()
6786 valueProducer->onConditionChanged(true, bucketStartTimeNs); in TEST()
6797 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
6813 {bucketStartTimeNs, bucket2StartTimeNs}, in TEST()
6830 {bucketStartTimeNs, bucket2StartTimeNs, bucket3StartTimeNs}, in TEST()
6865 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
6875 {bucketStartTimeNs, bucket2StartTimeNs}, in TEST()
6887 {bucketStartTimeNs, bucket2StartTimeNs, bucket3StartTimeNs}, in TEST()
6901 EXPECT_CALL(*pullerManager, Pull(tagId, kConfigKey, bucketStartTimeNs, _)) in TEST()
6980 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
7036 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
7094 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
7104 {bucketStartTimeNs, bucket2StartTimeNs}, in TEST()
7165 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
7223 {bucketStartTimeNs}, {bucket2StartTimeNs}); in TEST()
7273 bucketStartTimeNs + 5 * NS_PER_SEC, android::view::DisplayStateEnum::DISPLAY_STATE_OFF); in TEST()
7281 assertConditionTimer(it->second.conditionTimer, true, 0, bucketStartTimeNs + 5 * NS_PER_SEC); in TEST()
7340 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {1}, in TEST()
7347 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {1}, in TEST()
7367 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 1, 1 /*uid*/, 5, 5)); in TEST()
7369 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 1, 1 /*uid*/, 5, 7)); in TEST()
7371 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 1, 2 /*uid*/, 6, 5)); in TEST()
7373 CreateThreeValueLogEvent(tagId, bucketStartTimeNs + 1, 2 /*uid*/, 6, 7)); in TEST()
7428 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {11}, -1, 0); in TEST()
7435 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {5}, -1, 0); in TEST()
7456 makeRepeatedUidLogEvent(tagId, bucketStartTimeNs + 1, {1, 10}, 5, {2, 3})); in TEST()
7458 makeRepeatedUidLogEvent(tagId, bucketStartTimeNs + 1, {2, 10}, 5, {3, 4})); in TEST()
7503 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {3}, -1, in TEST()
7512 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, {4}, -1, in TEST()
7547 CreateRepeatedValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 10); in TEST()
7548 CreateRepeatedValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 15); in TEST()
7549 CreateRepeatedValueLogEvent(&event3, tagId, bucketStartTimeNs + 20, 20); in TEST()
7642 data->push_back(makeUidLogEvent(tagId, bucketStartTimeNs + 1, 1001, 5, 10)); in TEST()
7643 data->push_back(makeUidLogEvent(tagId, bucketStartTimeNs + 1, 1002, 10, 10)); in TEST()
7644 data->push_back(makeUidLogEvent(tagId, bucketStartTimeNs + 1, 1003, 15, 10)); in TEST()
7652 makeUidLogEvent(tagId, bucketStartTimeNs + 10000000000, 1001, 6, 10)); in TEST()
7654 makeUidLogEvent(tagId, bucketStartTimeNs + 10000000000, 1002, 12, 10)); in TEST()
7656 makeUidLogEvent(tagId, bucketStartTimeNs + 10000000000, 1003, 18, 10)); in TEST()
7667 int64_t dumpReportTimeNs = bucketStartTimeNs + 10000000000; in TEST()
7684 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucketStartTimeNs + 10000000000, in TEST()
7691 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucketStartTimeNs + 10000000000, in TEST()
7717 CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 30 * NS_PER_SEC, 1, 2)); in TEST()
7719 CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 30 * NS_PER_SEC, 2, 4)); in TEST()
7727 CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, 3, 5)); in TEST()
7729 CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 40 * NS_PER_SEC, 4, 9)); in TEST()
7737 CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 5, 10)); in TEST()
7739 CreateTwoValueLogEvent(tagId, bucketStartTimeNs + 50 * NS_PER_SEC, 6, 20)); in TEST()
7768 valueProducer->onConditionChanged(true, bucketStartTimeNs + 30 * NS_PER_SEC); in TEST()
7771 valueProducer->onConditionChanged(false, bucketStartTimeNs + 40 * NS_PER_SEC); in TEST()
7774 valueProducer->onConditionChanged(true, bucketStartTimeNs + 50 * NS_PER_SEC); in TEST()
7819 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, in TEST()
7866 CreateThreeValueLogEvent(&event1, tagId, bucketStartTimeNs + 10, 1, 5, 10); in TEST()
7869 CreateThreeValueLogEvent(&event2, tagId, bucketStartTimeNs + 20, 1, 6, 8); in TEST()
7872 CreateThreeValueLogEvent(&event3, tagId, bucketStartTimeNs + 40, 2, 3, 10); in TEST()
7875 CreateThreeValueLogEvent(&event4, tagId, bucketStartTimeNs + 50, 2, 4, 6); in TEST()
7878 CreateThreeValueLogEvent(&event5, tagId, bucketStartTimeNs + 30, 1, 19, 9); in TEST()
7881 CreateThreeValueLogEvent(&event6, tagId, bucketStartTimeNs + 60, 2, 20, 8); in TEST()
7951 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, in TEST()
7958 ValidateValueBucket(data.bucket_info(0), bucketStartTimeNs, bucket2StartTimeNs, in TEST()