Skip to content

Fix faulty span.frame_delay calculation for early app start spans#3427

Merged
markushi merged 3 commits into
mainfrom
fix/huge-frame-delay
May 16, 2024
Merged

Fix faulty span.frame_delay calculation for early app start spans#3427
markushi merged 3 commits into
mainfrom
fix/huge-frame-delay

Conversation

@markushi

Copy link
Copy Markdown
Member

📜 Description

The return value of frameMetricsCollector.getLastKnownFrameStartTimeNanos() was ignored, thus creating large frame delay values.

I also moved data collection post initial tracer.finish, ensuring a finish timestamp is set and spans / txns are already trimmed. This is especially useful for idle ui.load transactions, as otherwise the frame delay will be longer than the txn duration.

💡 Motivation and Context

💚 How did you test it?

📝 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

Comment thread sentry/src/main/java/io/sentry/SentryTracer.java
@github-actions

github-actions Bot commented May 16, 2024

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 378.62 ms 453.98 ms 75.36 ms
Size 1.70 MiB 2.28 MiB 592.12 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7ca9895 364.31 ms 460.46 ms 96.15 ms
bf82eb3 423.76 ms 506.45 ms 82.69 ms
d429384 397.33 ms 457.69 ms 60.36 ms
f5e1b97 362.53 ms 429.31 ms 66.78 ms
c554ca2 368.52 ms 430.74 ms 62.22 ms
9119d59 407.12 ms 509.64 ms 102.52 ms
a33b076 381.94 ms 459.64 ms 77.71 ms
93a76ca 397.30 ms 455.16 ms 57.87 ms
283d83e 348.44 ms 392.06 ms 43.62 ms
9e57f46 368.94 ms 410.50 ms 41.56 ms

App size

Revision Plain With Sentry Diff
7ca9895 1.72 MiB 2.29 MiB 576.51 KiB
bf82eb3 1.70 MiB 2.28 MiB 587.99 KiB
d429384 1.72 MiB 2.27 MiB 558.42 KiB
f5e1b97 1.70 MiB 2.28 MiB 592.00 KiB
c554ca2 1.70 MiB 2.27 MiB 582.25 KiB
9119d59 1.70 MiB 2.27 MiB 583.84 KiB
a33b076 1.70 MiB 2.28 MiB 592.32 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
283d83e 1.72 MiB 2.29 MiB 577.69 KiB
9e57f46 1.70 MiB 2.28 MiB 592.08 KiB

Previous results on branch: fix/huge-frame-delay

Startup times

Revision Plain With Sentry Diff
ab36940 378.21 ms 454.76 ms 76.55 ms

App size

Revision Plain With Sentry Diff
ab36940 1.70 MiB 2.28 MiB 592.12 KiB

@stefanosiano stefanosiano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice!

@markushi markushi changed the title Fix large frame delay values Fix faulty span.frame_delay calculation for early app start spans May 16, 2024
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.

2 participants