Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ private synchronized void scheduleCpuMetricCollectionOnce(Timer referenceTime) {
CpuMetricReading currCpuReading = syncCollectCpuMetric(referenceTime);
if (currCpuReading != null) {
cpuMetricReadings.add(currCpuReading);
GaugeCounter.INSTANCE.incrementCounter();
}
},
/* initialDelay */ 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private synchronized void scheduleMemoryMetricCollectionOnce(Timer referenceTime
AndroidMemoryReading memoryReading = syncCollectMemoryMetric(referenceTime);
if (memoryReading != null) {
memoryMetricReadings.add(memoryReading);
GaugeCounter.INSTANCE.incrementCounter();
}
},
/* initialDelay */ 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public void testGaugeCounterStartsAJobToConsumeTheGeneratedMetrics() throws Inte
PerfSession fakeSession = createTestSession(1);
testGaugeManager.setApplicationProcessState(ApplicationProcessState.FOREGROUND);
testGaugeManager.startCollectingGauges(fakeSession);
GaugeCounter.INSTANCE.setGaugeManager(testGaugeManager);
GaugeCounter.setGaugeManager(testGaugeManager);

// There's no job to log the gauges.
assertThat(fakeScheduledExecutorService.isEmpty()).isTrue();
Expand Down Expand Up @@ -377,7 +377,7 @@ public void testUpdateAppStateHandlesMultipleAppStates() {
fakeSession.setGaugeAndEventCollectionEnabled(true);
testGaugeManager.setApplicationProcessState(ApplicationProcessState.FOREGROUND);
testGaugeManager.startCollectingGauges(fakeSession);
GaugeCounter.INSTANCE.setGaugeManager(testGaugeManager);
GaugeCounter.setGaugeManager(testGaugeManager);

// Generate metrics that don't exceed the GaugeCounter.MAX_COUNT.
generateMetricsAndIncrementCounter(10);
Expand Down
Loading