File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
firebase-perf/src/main/java/com/google/firebase/perf/session Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ public String sessionId() {
70
70
71
71
/** Returns the AQS sessionId for the given session. */
72
72
public String aqsSessionId () {
73
+ // This is a fallback for if/when the AQS ID is undefined.
74
+ if (aqsSessionId .equals (Constants .UNDEFINED_AQS_ID )) {
75
+ // TODO(b/394127311): Explore returning a valid - but different ID.
76
+ return Constants .UNDEFINED_AQS_ID ;
77
+ }
73
78
return aqsSessionId ;
74
79
}
75
80
Original file line number Diff line number Diff line change @@ -111,9 +111,7 @@ public void updateGaugeCollection(ApplicationProcessState applicationProcessStat
111
111
gaugeManagerDataCollectionJob .cancel (false );
112
112
}
113
113
114
- if (session == null
115
- || !session .isGaugeAndEventCollectionEnabled ()
116
- || session .aqsSessionId ().equals (Constants .UNDEFINED_AQS_ID )) {
114
+ if (shouldStopCollectingGauges ()) {
117
115
logger .warn ("Not starting gauge collection." );
118
116
stopCollectingGauges ();
119
117
return ;
@@ -433,6 +431,12 @@ private long getMemoryGaugeCollectionFrequencyMs(
433
431
}
434
432
}
435
433
434
+ private boolean shouldStopCollectingGauges () {
435
+ return session == null
436
+ || !session .isGaugeAndEventCollectionEnabled ()
437
+ || session .aqsSessionId ().equals (Constants .UNDEFINED_AQS_ID );
438
+ }
439
+
436
440
@ VisibleForTesting
437
441
void setApplicationProcessState (ApplicationProcessState applicationProcessState ) {
438
442
this .applicationProcessState = applicationProcessState ;
You can’t perform that action at this time.
0 commit comments