Skip to content
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

Collect slow and frozen frames for spans #3111

Merged

Conversation

markushi
Copy link
Member

@markushi markushi commented Dec 19, 2023

By utilizing our existing SentryFrameMetricsCollector via a new performance collector:SpanFrameMetricsCollector

📜 Description

Fixes #3106

Based on #3102, which needs to merged first.

If perf-v2 is enabled, the ActivityFramesTracker will no-op and instead SpanFrameMetricsCollector will start collecting the data on a span level (including the top level transaction ISpan).

💡 Motivation and Context

Top level epic: getsentry/team-mobile#156

💚 How did you test it?

Added unit tests.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Dec 19, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 9ed159c

Copy link
Contributor

github-actions bot commented Dec 19, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 413.67 ms 478.80 ms 65.13 ms
Size 1.72 MiB 2.27 MiB 559.46 KiB

Baseline results on branch: feat/continuous-perf-collectors

Startup times

Revision Plain With Sentry Diff
5344734 417.38 ms 478.70 ms 61.32 ms
243f1a4 405.48 ms 474.32 ms 68.84 ms
a5e1504 379.98 ms 463.29 ms 83.31 ms
7b303a4 381.72 ms 445.56 ms 63.84 ms

App size

Revision Plain With Sentry Diff
5344734 1.72 MiB 2.27 MiB 558.34 KiB
243f1a4 1.72 MiB 2.27 MiB 558.42 KiB
a5e1504 1.72 MiB 2.27 MiB 558.86 KiB
7b303a4 1.72 MiB 2.27 MiB 558.34 KiB

Previous results on branch: feat/slow-frozen-frames-span-data

Startup times

Revision Plain With Sentry Diff
cf10143 401.54 ms 484.12 ms 82.58 ms
90a5e12 369.89 ms 444.17 ms 74.27 ms
e445344 403.17 ms 487.92 ms 84.75 ms
f8ae166 404.67 ms 485.78 ms 81.11 ms
e74753f 394.16 ms 459.81 ms 65.65 ms
ffac13d 372.33 ms 486.52 ms 114.19 ms

App size

Revision Plain With Sentry Diff
cf10143 1.72 MiB 2.27 MiB 559.32 KiB
90a5e12 1.72 MiB 2.27 MiB 559.49 KiB
e445344 1.72 MiB 2.27 MiB 559.45 KiB
f8ae166 1.72 MiB 2.27 MiB 559.44 KiB
e74753f 1.72 MiB 2.27 MiB 559.45 KiB
ffac13d 1.72 MiB 2.27 MiB 559.34 KiB

frozenFrameDuration = 0;
}

public FrameMetrics duplicate() {
Copy link
Member

Choose a reason for hiding this comment

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

nit: we usually call it clone() in other places

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's on purpose. I didn't want to interfere with Object.clone() / the clonable interface here
image

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM!

@markushi markushi merged commit a45911f into feat/continuous-perf-collectors Jan 18, 2024
15 checks passed
@markushi markushi deleted the feat/slow-frozen-frames-span-data branch January 18, 2024 09:09
markushi added a commit that referenced this pull request Jan 25, 2024
* Extend performance collector APIs

* Update changelog

* Update changelog

* Collect slow and frozen frames for spans (#3111)

* Collect slow and frozen frames using SentryFrameMetricsCollector and SpanFrameMetricsCollector

* Rename fast frame to normal frame, remove fastFrameDuration

* Extend performance collector APIs

* Update changelog

* Collect slow and frozen frames using SentryFrameMetricsCollector and SpanFrameMetricsCollector

* Rename fast frame to normal frame, remove fastFrameDuration

* Fix PR feedback

* Fix nullability and remove unused field

* Rename FrameMetrics to SentryFrameMetrics

* Collect delay instead of total duration

* Fix tests

* Revert "Fix tests"

This reverts commit 5b9c3c6.

* Properly fix tests

* Collect slow and frozen frames as measurements (#3155)

* Ensure slow and frozen frames values are reported as measurement values as well

* Interpolate total frame count to match span duration (#3158)

* Interpolate total frame count to match span duration

* Update Changelog
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.

3 participants