-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a SessionSubscriber for Firebase Performance #6683
Conversation
Release note changesNo release note changes were detected. If you made changes that should be |
Vertex AI Mock Responses Check
|
Generated by 🚫 Danger |
Coverage Report 1Affected Products
Test Logs |
Test Results 148 files 148 suites 3m 7s ⏱️ Results for commit afb0804. ♻️ This comment has been updated with latest results. |
Size Report 1Affected Products
Test Logs |
...-perf/src/main/java/com/google/firebase/perf/session/FirebasePerformanceSessionSubscriber.kt
Show resolved
Hide resolved
|
||
class FirebasePerformanceSessionSubscriber(private val dataCollectionEnabled: Boolean) : | ||
SessionSubscriber { | ||
override val isDataCollectionEnabled: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just put override val isDataCollectionEnabled: Boolean
in the ctor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
get() = dataCollectionEnabled | ||
|
||
override val sessionSubscriberName: SessionSubscriber.Name | ||
get() = SessionSubscriber.Name.PERFORMANCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the explicit getter. Can you just say something like override val sessionSubscriberName = SessionSubscriber.Name.PERFORMANCE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you copied this from Crashlytics, it's likely a result of Java Kotlin interop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -0,0 +1,49 @@ | |||
/* | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2025 yo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 😄
} | ||
|
||
/** Returns the AQS sessionId for the given session. */ | ||
public void setAQSId(SessionSubscriber.SessionDetails aqs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want the Perf session to have the id of the current AQS session when the Perf session starts, but then allow AQS to have different sessions due to background foreground etc? Because Crashlytics will have the current AQS session id at crash time added to the report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AQS knows the "first session id" and the current session id. If that is your concern, I think it's better to have the current aqs session id as the perf session id, and then if we need to do lookups we can join it to aqs data and know the first session id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the behaviour a little compared to #6665.
This retains the PerfSession ID as is, which is used to identify sessions for gauge collection.
However, my plan is to use the AQS session ID to log the gauges. Whenever there is an AQS change, it will also result in a new PerfSession.
return aqsSessionId; | ||
} | ||
|
||
/** Returns the AQS sessionId for the given session. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
public String sessionId() { | ||
return sessionId; | ||
} | ||
|
||
/** Returns the AQS sessionId for the given session. */ | ||
public String aqsSessionId() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This PR doesn't change the use of session ID to AQS - except in GaugeMetadata. I've added TODOs to identify the missing locations.
This is a follow up for: #6678
This PR doesn't change the use of session ID to AQS - except in GaugeMetadata. I've added TODOs to identify the missing locations.