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

refactor: Add origin as parameter to file IO tracker #4860

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

philprime
Copy link
Contributor

This PR is derived from #4605

Adds origin and operation as parameters to File IO tracker set by the callers.

#skip-changelog

Copy link

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryNSDataSwizzling.m
  • Sources/Sentry/SentryNSFileManagerSwizzling.m

Copy link

github-actions bot commented Feb 18, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1229.19 ms 1248.73 ms 19.54 ms
Size 22.31 KiB 820.51 KiB 798.20 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c0b4b71 1218.16 ms 1251.28 ms 33.12 ms
626b91b 1231.67 ms 1247.13 ms 15.46 ms
bcb1c7d 1208.24 ms 1222.58 ms 14.34 ms
b11cd87 1234.51 ms 1250.52 ms 16.01 ms
bb7da60 1231.80 ms 1252.65 ms 20.85 ms
5e78d2b 1229.90 ms 1252.94 ms 23.04 ms
794f87f 1225.78 ms 1243.46 ms 17.68 ms
efb2222 1258.22 ms 1276.78 ms 18.56 ms
80da9d1 1193.76 ms 1211.83 ms 18.08 ms
69d2789 1224.14 ms 1247.17 ms 23.02 ms

App size

Revision Plain With Sentry Diff
c0b4b71 20.76 KiB 430.98 KiB 410.22 KiB
626b91b 21.58 KiB 546.20 KiB 524.61 KiB
bcb1c7d 22.85 KiB 413.42 KiB 390.57 KiB
b11cd87 21.58 KiB 631.86 KiB 610.28 KiB
bb7da60 21.58 KiB 697.84 KiB 676.25 KiB
5e78d2b 22.85 KiB 411.17 KiB 388.32 KiB
794f87f 20.76 KiB 401.37 KiB 380.61 KiB
efb2222 20.76 KiB 424.45 KiB 403.69 KiB
80da9d1 21.58 KiB 418.45 KiB 396.86 KiB
69d2789 21.58 KiB 548.09 KiB 526.50 KiB

Previous results on branch: philprime/deferred-trace-origin

Startup times

Revision Plain With Sentry Diff
bdfecd0 1224.92 ms 1247.55 ms 22.63 ms

App size

Revision Plain With Sentry Diff
bdfecd0 22.32 KiB 820.43 KiB 798.12 KiB

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 96.80000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.279%. Comparing base (43a41b3) to head (0b9032e).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ions/Performance/IO/SentryFileIOTrackerTests.swift 94.871% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4860       +/-   ##
=============================================
+ Coverage   92.164%   92.279%   +0.115%     
=============================================
  Files          658       659        +1     
  Lines        77222     77327      +105     
  Branches     27170     27986      +816     
=============================================
+ Hits         71171     71357      +186     
+ Misses        5957      5874       -83     
- Partials        94        96        +2     
Files with missing lines Coverage Δ
Sources/Sentry/SentryFileIOTracker.m 95.731% <100.000%> (+0.247%) ⬆️
Sources/Sentry/SentryNSDataSwizzling.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryNSFileManagerSwizzling.m 100.000% <100.000%> (+47.058%) ⬆️
.../SentryTests/Transactions/SentrySpanKeyTests.swift 100.000% <100.000%> (ø)
...yTests/Transactions/SentrySpanOperationTests.swift 100.000% <100.000%> (ø)
...tryTests/Transactions/SentryTraceOriginTests.swift 100.000% <100.000%> (ø)
...ions/Performance/IO/SentryFileIOTrackerTests.swift 98.546% <94.871%> (-0.855%) ⬇️

... and 35 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43a41b3...0b9032e. Read the comment docs.

Copy link

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryNSDataSwizzling.m
  • Sources/Sentry/SentryNSFileManagerSwizzling.m

Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

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

The changes look fine, should we add a test to validate the origin is properly included in whatever event/envelope is generated for File I/O tracking?

@philprime
Copy link
Contributor Author

philprime commented Feb 19, 2025

Not sure if I understand the questions:

should we add a test to validate the origin is properly included in whatever event/envelope is generated for File I/O tracking?

Do you mean we add tests to verify the origins as expected by the backend, like mentioned in the develop docs?

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, with a minor suggestion.

Copy link

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryNSDataSwizzling.m
  • Sources/Sentry/SentryNSFileManagerSwizzling.m

@philprime philprime merged commit 4eec7a1 into main Feb 19, 2025
74 checks passed
@philprime philprime deleted the philprime/deferred-trace-origin branch February 19, 2025 12:43
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