File tree 1 file changed +7
-1
lines changed
firebase-perf/src/test/java/com/google/firebase/perf/session/gauges 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -344,10 +344,16 @@ public void testGaugeCounterStartsAJobToConsumeTheGeneratedMetrics() {
344
344
.isEqualTo (TIME_TO_WAIT_BEFORE_FLUSHING_GAUGES_QUEUE_MS );
345
345
346
346
fakeScheduledExecutorService .simulateSleepExecutingAtMostOneTask ();
347
+
348
+ // Generate additional metrics, but doesn't start logging them as it hasn't met the threshold.
349
+ generateMetricsAndIncrementCounter (5 );
350
+ assertThat (fakeScheduledExecutorService .isEmpty ()).isTrue ();
351
+
347
352
GaugeMetric recordedGaugeMetric =
348
353
getLastRecordedGaugeMetric (ApplicationProcessState .FOREGROUND , 1 );
349
354
350
- // It flushes all metrics in the ConcurrentLinkedQueues.
355
+ // It flushes all the original metrics in the ConcurrentLinkedQueues, but not the new ones
356
+ // added after the task completed.
351
357
int recordedGaugeMetricsCount =
352
358
recordedGaugeMetric .getAndroidMemoryReadingsCount ()
353
359
+ recordedGaugeMetric .getCpuMetricReadingsCount ();
You can’t perform that action at this time.
0 commit comments