Skip to content

Conversation

@armcknight
Copy link
Member

@armcknight armcknight commented Nov 4, 2022

required changing SentryTracer to an ObjC++ file to use our C++ interface to get thread IDs; when this happened, a latent type mismatch was uncovered, breaking the compilation. it required a bit of a nonobvious semantic change from false (which resolves to 0, where parentSampled used to be a boolean type property set to false, and was changed to the NSUInteger-backed enum) to kSentrySampleDecisionUndecided (which is the 0 value in the enum), and not kSentrySampleDecisionNo as "false" might imply

fixes #2356

- required changing SentryTracer to an ObjC++ file to use our C++ interface to get thread IDs; when this happened, a latent type mismatch was uncovered, breaking the compilation. it required a bit of a nonobvious semantic change from `false` (which resolves to 0, where parentSampled used to be a boolean type property set to false, and was changed to the NSUInteger-backed enum) to `kSentrySampleDecisionUndecided` (which is the 0 value in the enum), and not kSentrySampleDecisionNo as "false" might imply
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1227.72 ms 1242.92 ms 15.20 ms
Size 20.50 KiB 365.50 KiB 345.00 KiB

Baseline results on branch: master

Startup times

Revision Plain With Sentry Diff
bdfccaa 1202.83 ms 1228.96 ms 26.13 ms
0fdf0b2 1249.20 ms 1254.08 ms 4.88 ms
d47c2c0 1230.55 ms 1250.22 ms 19.67 ms
64225be 1213.96 ms 1227.62 ms 13.66 ms
b15627c 1228.88 ms 1269.70 ms 40.82 ms
f6eee7c 1227.39 ms 1240.76 ms 13.37 ms
5ecf9f6 1230.76 ms 1232.86 ms 2.10 ms
0fdf0b2 1266.27 ms 1277.90 ms 11.63 ms
6dc0bd1 1220.49 ms 1237.44 ms 16.95 ms
7138b7d 1243.40 ms 1252.08 ms 8.68 ms

App size

Revision Plain With Sentry Diff
bdfccaa 20.50 KiB 361.80 KiB 341.29 KiB
0fdf0b2 20.51 KiB 332.90 KiB 312.39 KiB
d47c2c0 20.50 KiB 342.31 KiB 321.80 KiB
64225be 20.50 KiB 339.02 KiB 318.52 KiB
b15627c 20.50 KiB 337.76 KiB 317.25 KiB
f6eee7c 20.50 KiB 361.89 KiB 341.39 KiB
5ecf9f6 20.51 KiB 332.66 KiB 312.15 KiB
0fdf0b2 20.51 KiB 332.90 KiB 312.39 KiB
6dc0bd1 20.51 KiB 333.58 KiB 313.07 KiB
7138b7d 20.51 KiB 331.79 KiB 311.28 KiB

Previous results on branch: armcknight/fix/profiling-transaction-thread-IDs

Startup times

Revision Plain With Sentry Diff
bd08699 1241.84 ms 1265.35 ms 23.51 ms
dd74e7d 1255.92 ms 1261.12 ms 5.20 ms
7d757a7 1209.02 ms 1247.90 ms 38.88 ms

App size

Revision Plain With Sentry Diff
bd08699 20.50 KiB 365.50 KiB 345.00 KiB
dd74e7d 20.50 KiB 365.51 KiB 345.01 KiB
7d757a7 20.50 KiB 365.51 KiB 345.01 KiB

@armcknight armcknight changed the title Armcknight/fix/profiling transaction thread i ds fix: profiling transaction thread IDs Nov 4, 2022
Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

LGTM

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, if you add some tests for the new functionality in SentryTransactionContext.

return self;
}

- (void)getThreadInfo
Copy link
Member

Choose a reason for hiding this comment

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

m: It would be great to add some tests for this new functionality.

Copy link
Member Author

Choose a reason for hiding this comment

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

We've got the ThreadHandle system under test here and here, and SentryThread has unit tests here.

We test that this field is nonempty here but I don't think we should use this spot as another place to test whether we're getting what we think is the correct thread info, it's not scalable to do this for every usage. If we think there's an issue with ThreadHandle or SentryThread let's take care of it separately.

@armcknight
Copy link
Member Author

what is going on with the code formatter

@armcknight armcknight merged commit c8069a6 into master Nov 4, 2022
@armcknight armcknight deleted the armcknight/fix/profiling-transaction-thread-IDs branch November 4, 2022 17:29
kevinrenskers added a commit that referenced this pull request Nov 7, 2022
* master:
  test: Delete empty OOMLogicTests (#2361)
  fix: profiling transaction timestamps (#2359)
  fix: profiling transaction thread IDs (#2358)
  test: Use flush for macOS-SPM sample (#2360)
  release: 7.30.0
  fix: SentryCrash writing nan for invalid number (#2348)
  HTTP Client errors (#2308)
  ci: Call make for analyze (#2353)
  fix: CoreData tracking entity name retrieval (#2329)
  fix: sampled profile format backend validation errors (#2350)
  build(deps): bump github/codeql-action from 2.1.29 to 2.1.30 (#2351)
  build(deps): bump github/codeql-action from 2.1.28 to 2.1.29 (#2344)
  fix: Fixed flaky testTimezoneChangeNotificationBreadcrumb (#2335)

# Conflicts:
#	Sentry.xcodeproj/project.pbxproj
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.

Set correct active_thread_id for transactions linked to profiles

5 participants