Skip to content

Fireperf: use the new class FrameMetricsRecorder in AppStateMonitor and FragmentStateMonitor #3683

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

Merged
merged 38 commits into from
May 5, 2022

Conversation

leotianlizhan
Copy link
Contributor

@leotianlizhan leotianlizhan commented Apr 26, 2022

With FrameMetricsRecorder taking care of managing FrameMetricsAggregator, the need for AppStateMonitor to use FrameMetricsAggregator is gone. This PR is to make change to AppStateMonitor to use the FrameMetricsRecorder for measuring frame metrics.

As a part of this, the lifecycle event used to measure the start and stop of an activity screen trace is aligned to make it work for all versions of Android.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 26, 2022

Coverage Report 1

Affected Products

  • firebase-perf

    Overall coverage changed from 71.46% (c76d022) to 71.36% (0bf7345) by -0.10%.

    FilenameBase (c76d022)Merge (0bf7345)Diff
    AppStateMonitor.java88.57%86.71%-1.87%
    FragmentStateMonitor.java91.67%89.47%-2.19%
    FrameMetricsRecorder.java77.14%78.38%+1.24%
    RateLimiter.java90.98%91.73%+0.75%
    TransportManager.java95.81%94.88%-0.93%

Test Logs

Notes

  • Commit (0bf7345) is created by Prow via merging PR base commit (c76d022) and head commit (1a62a8e).
  • Run gradle <product>:checkCoverage to produce HTML coverage reports locally. After gradle commands finished, report files can be found under <product-build-dir>/reports/jacoco/.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/ydZBWxg2ER.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 26, 2022

Size Report 1

Affected Products

  • firebase-perf

    TypeBase (c76d022)Merge (0bf7345)Diff
    aar311 kB310 kB-255 B (-0.1%)
    apk (aggressive)1.03 MB1.03 MB+1.04 kB (+0.1%)
    apk (release)2.47 MB2.47 MB+104 B (+0.0%)

Test Logs

Notes

  • Commit (0bf7345) is created by Prow via merging PR base commit (c76d022) and head commit (1a62a8e).

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/vr2gmcx4BW.html

@leotianlizhan leotianlizhan force-pushed the perf-apply-recorder branch 2 times, most recently from 929d70e to ef812f9 Compare April 27, 2022 18:14
@leotianlizhan leotianlizhan changed the title Perf apply recorder Fireperf: use the new class FrameMetricsRecorder in AppStateMonitor and FragmentStateMonitor Apr 27, 2022
@leotianlizhan leotianlizhan changed the base branch from perf-fix-fma to master April 27, 2022 18:31
@leotianlizhan leotianlizhan changed the base branch from master to perf-fix-fma April 27, 2022 18:32
@visumickey visumickey marked this pull request as ready for review May 2, 2022 16:42
@visumickey visumickey requested a review from jeremyjiang-dev May 2, 2022 16:42
@@ -15,6 +15,7 @@
package com.google.firebase.perf.application;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior of AppStateMonitor has changed quite a bit. I'm surprised the tests haven't changed barely at all. I feel like we're probably missing tests (e.g. testing new behaviors), as well as having coverage for the behavior changes that have happened (some things happen in different points of the activity's lifecycle)

Copy link
Contributor Author

@leotianlizhan leotianlizhan May 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only lifecycle change is reverting the activity screen trace that is from onResume -> onPostPaused to onStart -> onStop. onStart -> onStop was the original behavior before attempting to fix the b/210055697 that started all of this in the first place. That's why there's no new tests for that.

@@ -15,6 +15,7 @@
package com.google.firebase.perf.application;
Copy link
Contributor Author

@leotianlizhan leotianlizhan May 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only lifecycle change is reverting the activity screen trace that is from onResume -> onPostPaused to onStart -> onStop. onStart -> onStop was the original behavior before attempting to fix the b/210055697 that started all of this in the first place. That's why there's no new tests for that.

@visumickey
Copy link
Contributor

/retest

Copy link
Contributor

@jeremyjiang-dev jeremyjiang-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on checks green!

@visumickey visumickey merged commit 316735f into perf-fix-fma May 5, 2022
@visumickey visumickey deleted the perf-apply-recorder branch May 5, 2022 03:37
@firebase firebase locked and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants