-
Notifications
You must be signed in to change notification settings - Fork 528
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
Fixes #4466: CPU Usage performance metrics logging #4623
Conversation
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.
Thanks @Sarthak2601. Sent my first batch of thoughts.
I think something else that would be really helpful here is including a detailed analysis in the opening comment demonstrating that this works as expected (e.g. by making the app simulate different types of loads on the system over different time periods to show that the computation is correct). I think we also need to make sure the solution works across multiple device images (which may require sharing a build with team members who have physical Android devices and can test the build in different configurations--you'll need to have a way to analyze the results).
I suspect the testing part can happen after this PR is merged (as part of verifying the dashboard changes), but we should at least verify it on a Google & non-Google physical device before merging.
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/system/OppiaClock.kt
Outdated
Show resolved
Hide resolved
Hi @Sarthak2601, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
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.
Thanks @Sarthak2601. Took a high-level pass; there are some things I'm not sure that I fully understand conceptually so PTAL at the comments. It'd be helpful to resolve these, then I can another conceptual pass before you finish up the rest of the PR.
...src/main/java/org/oppia/android/domain/oppialogger/analytics/ApplicationLifecycleObserver.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/oppia/android/domain/oppialogger/analytics/ApplicationLifecycleObserver.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/oppia/android/domain/oppialogger/analytics/ApplicationLifecycleObserver.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/oppia/android/domain/oppialogger/analytics/ApplicationLifecycleObserver.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/oppia/android/domain/oppialogger/analytics/PerformanceMetricsController.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/oppia/android/util/logging/performancemetrics/PerformanceMetricsAssessorImpl.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/oppia/android/domain/oppialogger/analytics/ApplicationLifecycleObserver.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/oppia/android/domain/oppialogger/analytics/ApplicationLifecycleObserver.kt
Outdated
Show resolved
Hide resolved
Thanks @Sarthak2601. Left some more thoughts, + some in chat (regarding availableProcessors() and potential downsides to using it). |
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.
Thanks @Sarthak2601! Just had a few comments (mostly nits and one functional clarification), but otherwise I think the tests look really good! The PR seems quite close to completion now.
.../main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotterModule.kt
Outdated
Show resolved
Hide resolved
...in/src/main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotter.kt
Outdated
Show resolved
Hide resolved
...in/src/main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotter.kt
Outdated
Show resolved
Hide resolved
...rc/test/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotterTest.kt
Show resolved
Hide resolved
...rc/test/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotterTest.kt
Outdated
Show resolved
Hide resolved
...rc/test/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotterTest.kt
Outdated
Show resolved
Hide resolved
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.
Thanks @Sarthak2601! Overall, the PR looks fantastic. I just had a few small follow-up comments.
...in/src/main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotter.kt
Outdated
Show resolved
Hide resolved
...in/src/main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotter.kt
Show resolved
Hide resolved
...rc/test/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotterTest.kt
Show resolved
Hide resolved
...in/src/main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotter.kt
Outdated
Show resolved
Hide resolved
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.
Thanks @Sarthak2601. Excellently done PR that completely LGTM. :)
...in/src/main/java/org/oppia/android/domain/oppialogger/analytics/CpuPerformanceSnapshotter.kt
Outdated
Show resolved
Hide resolved
Heads up that I think you'll need to sync to the latest develop branch before you can merge. Could you also update your latest require test to verify the exception message (since IllegalArgumentException is really generic)? No need to have me reapprove that specific change. |
Hi @Sarthak2601, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks! |
Done with the change and synced to the latest develop. |
Explanation
Fixes #4466: CPU Usage performance metrics logging.
Introduces a CpuPerformanceSnapshotter that leverages the abilities of an actor to sequentially log cpu usage. Cpu usage is logged after a certain delay which is calculated on the basis of current Iconification (foreground/background) of the app. This iconification is updated every time the app changes state, i.e. goes from foreground to background or vice-versa.
Essential Checklist