Skip to content

Fireperf aqs sessionmanager phase2#7958

Open
jrodiz wants to merge 6 commits intofirebase:fireperf-aqsfrom
jrodiz:fireperf-aqs-sessionmanager-phase2
Open

Fireperf aqs sessionmanager phase2#7958
jrodiz wants to merge 6 commits intofirebase:fireperf-aqsfrom
jrodiz:fireperf-aqs-sessionmanager-phase2

Conversation

@jrodiz
Copy link
Contributor

@jrodiz jrodiz commented Mar 23, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

jrodiz added 6 commits March 23, 2026 12:32
… factory

Delete the private no-arg constructor and static getInstance() method.
The Dagger component factory in FirebasePerfRegistrar now constructs a
fresh SessionManager(GaugeManager, PerfSession) instead of delegating
to the singleton accessor.

Add null-guards for gaugeManager in setApplicationContext,
stopGaugeCollectionIfSessionRunningTooLong, logGaugeMetadataIfCollectionEnabled,
and startOrStopCollectingGauges to support test-only SessionManager
instances that are constructed with a null GaugeManager.

Remove the testInstanceCreation unit test whose invariant is now
maintained by the DI container rather than the class itself.
…rror AppStartTrace pattern

Add getInstance(SessionManager) seeded-init overload so FirebasePerfEarly
can inject the DI-managed SessionManager at startup. The no-arg
getInstance() remains as a safe "get-after-init" fallback (creates its own
SessionManager if called before early init, e.g. in tests or
AppStateUpdateHandler).

Add getSessionManager() accessor and resetInstance() @VisibleForTesting
helper to support test isolation.

Update FirebasePerfEarly to call getInstance(sessionManager) instead of
the no-arg version.
…ionManager() to TransportManager

Trace's 5-arg convenience constructor now resolves SessionManager via
sessionManagerFrom(appStateMonitor), which delegates to
AppStateMonitor.getSessionManager() and falls back to a no-gauge
instance when called in tests with a mocked AppStateMonitor.

Trace's Parcel deserialization constructor now uses
TransportManager.getInstance().getSessionManager() instead of
SessionManager.getInstance(). This is safe because Parcel deserialization
always occurs after FirebasePerfEarly has initialized the SDK.

Add getSessionManager() accessor to TransportManager and thread
sessionManager through initializeForTest() so test helpers can supply the
correct instance.
…etricBuilder

The private single-arg constructor now obtains SessionManager via
AppStateMonitor.getInstance().getSessionManager() instead of calling
SessionManager.getInstance(). AppStateMonitor.getInstance() is safe here
because FirebasePerfEarly (eager component) always seeds it before any
network request can be intercepted by user code.
- FirebasePerfRegistrarTest: update component count (3→4) and
  dependency assertions to include SessionManager
- FirebasePerformanceTest: construct spy SessionManager directly instead
  of spying on the now-deleted getInstance() return value
- AppStartTraceTest: use base-class sessionManager field in @after reset
  instead of SessionManager.getInstance()
- TraceTest: pre-seed AppStateMonitor with the test sessionManager in
  setUp; use sessionManager.updatePerfSession() in session-addition test
- NetworkRequestMetricBuilderTest: same AppStateMonitor pre-seed pattern;
  use sessionManager.updatePerfSession() in session-addition test
- TransportManagerTest: replace all SessionManager.getInstance() calls
  with the base-class sessionManager field; initializeForTest() now
  accepts and sets the sessionManager parameter
@jrodiz jrodiz force-pushed the fireperf-aqs-sessionmanager-phase2 branch from 160ef20 to 3210a7a Compare March 23, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant