Skip to content

Commit 34a3d31

Browse files
committed
Comments
1 parent b7ea8d6 commit 34a3d31

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/session/gauges/GaugeManager.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,13 @@ public void initializeGaugeMetadataManager(Context appContext) {
102102
public void onUpdateAppState(ApplicationProcessState applicationProcessState) {
103103
this.applicationProcessState = applicationProcessState;
104104

105-
if (session == null) {
105+
if (session == null || !session.isVerbose()) {
106106
return;
107107
}
108108

109-
if (session.isVerbose()) {
110-
// If it's a verbose session, start collecting gauges for the new app state.
111-
startCollectingGauges(this.applicationProcessState, session.getTimer());
112-
}
109+
// If it's a verbose session, start collecting gauges for the new app state.
110+
// This
111+
startCollectingGauges(this.applicationProcessState, session.getTimer());
113112
}
114113

115114
/** Returns the singleton instance of this class. */
@@ -153,7 +152,9 @@ public void startCollectingGauges(PerfSession session) {
153152
}
154153

155154
/**
156-
* Starts the collection of available Gauges for the given {@code appState}.
155+
* Starts the collection of available Gauges for the given {@code appState}. If it's being
156+
* collected for a different app state, it stops that prior to starting it for the given
157+
* {@code appState}.
157158
*
158159
* @param appState The app state to which the collected gauges are associated.
159160
* @param referenceTime The time off which the system time is calculated when collecting gauges.

0 commit comments

Comments
 (0)