Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b7eac00
wip: profiling concurrent transactions
armcknight Aug 19, 2022
78d3436
Format code
getsentry-bot Aug 29, 2022
a340fe0
wip: track system time on sentry spans/events/tracer
armcknight Aug 31, 2022
4714eea
fix: merge conflict fix
armcknight Aug 31, 2022
f6681dc
Format code
getsentry-bot Aug 31, 2022
e6f2a78
wip: stop profiler after a timeout period
armcknight Aug 31, 2022
ad74b82
ref: move test cases from SentryHubTests.swift dealing with profiling…
armcknight Sep 2, 2022
15af62e
wip: add tests, working on issue where we wind up with a profiler sta…
armcknight Sep 2, 2022
91720e4
update log statement
armcknight Sep 6, 2022
2eaac7a
WIP: clamp relative start/end transaction times to profile; add more …
armcknight Sep 6, 2022
d75468b
work out test failures, refactor tests, add more logging
armcknight Sep 6, 2022
b1e5db4
add test case for concurrent profiled transactions; fix Invocations c…
armcknight Sep 7, 2022
bb723ff
move system timestamps to private interface
armcknight Sep 7, 2022
4ca9ebf
update changelog
armcknight Sep 7, 2022
cbbbbf3
WIP: use NSDate in profiling instead of adding system timestamps to s…
armcknight Sep 7, 2022
61d0d5d
stop profiler after a 30s timeout
armcknight Sep 7, 2022
65182cc
fix initialization of profiling when UIKit is not available; lock aro…
armcknight Sep 7, 2022
90865b1
move more logic out of finishInternal into captureProfilingEnvelopeIf…
armcknight Sep 8, 2022
228f69f
invalidate timeout timer when stopping profiler; further simplify tests
armcknight Sep 8, 2022
8b6b5f3
reorg test private functions in order they are called
armcknight Sep 9, 2022
2f15080
logging
armcknight Sep 9, 2022
74d719f
add expectation for test span
armcknight Sep 9, 2022
e721950
some extra checks for if profiler is running before performing operat…
armcknight Sep 12, 2022
6d6d7d3
fix one of the failing tests related to sampling
armcknight Sep 12, 2022
a3b2fee
pr feedback; renames, remove more unused things
armcknight Sep 14, 2022
153fb2f
rename global variables to have proper prefixes
armcknight Sep 14, 2022
a6bd110
add test for concurrent timeouts; fix jumpbar in SentryTracer
armcknight Sep 15, 2022
484e685
remove unused method
armcknight Sep 15, 2022
06f2bc6
refactor profiling code to extract from SentryTracer to SentryProfile…
armcknight Sep 16, 2022
15aa050
fix new test for timed out profiler with concurrent traces completing
armcknight Sep 16, 2022
d0f5fd6
Format code
getsentry-bot Sep 16, 2022
7c616be
remove unused import
armcknight Sep 16, 2022
7de5d6f
update changelog
armcknight Sep 16, 2022
b0a1409
test: remove redundant tests for profiling in tracer tests
armcknight Sep 16, 2022
973d73a
put Invocations.swift back
armcknight Sep 16, 2022
7ac0e02
fix macos build
armcknight Sep 16, 2022
d07c0e4
fix tvos build
armcknight Sep 16, 2022
69a5d65
fix assertion descriptions
armcknight Sep 19, 2022
d546f4a
track all waiting profilers the same way, not just those that time out
armcknight Sep 19, 2022
adf4fd8
rename method for better meaning
armcknight Sep 19, 2022
76eaffa
add comments explaining the two separate method calls
armcknight Sep 19, 2022
df95e31
more polish on SentryProfiler/SentryTracer interface; fix test timing…
armcknight Sep 20, 2022
9df251d
Format code
getsentry-bot Sep 20, 2022
4a58cac
reinstate timeout timer validation in a test, now with configurable t…
armcknight Sep 22, 2022
89002df
add logs and comments
armcknight Sep 22, 2022
ca4efe1
simplify timing logic
armcknight Sep 22, 2022
380d6e7
remove stop as to not modify previous behavior
armcknight Sep 22, 2022
5d51821
Format code
getsentry-bot Sep 22, 2022
e177812
fix interleavement of SENTRY_TARGET_PROFILING_SUPPORTED and NS_ASSUME…
armcknight Sep 22, 2022
381cea8
fixup! fix interleavement of SENTRY_TARGET_PROFILING_SUPPORTED and NS…
armcknight Sep 22, 2022
26cec22
fixup! fix interleavement of SENTRY_TARGET_PROFILING_SUPPORTED and NS…
armcknight Sep 22, 2022
1fdf2ea
Format code
getsentry-bot Sep 22, 2022
ae58839
gate compilation of profiling calls again to fix tv/watch builds
armcknight Sep 22, 2022
e1911a1
fix compilation on tvos
armcknight Sep 23, 2022
b8881c2
fix catalyst tests
armcknight Sep 23, 2022
f8c962f
fix test
armcknight Sep 23, 2022
573b656
use api available to all platform versions
armcknight Sep 24, 2022
064c1e6
Format code
getsentry-bot Sep 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

- Add flush (#2140)
- Add more device context (#2190)
- Profile concurrent transactions (#2105)

## 7.25.1

### Fixes

Expand Down
8 changes: 8 additions & 0 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,10 @@
7DC83100239826280043DD9A /* SentryIntegrationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DC830FF239826280043DD9A /* SentryIntegrationProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
7DC8310A2398283C0043DD9A /* SentryCrashIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DC831082398283C0043DD9A /* SentryCrashIntegration.h */; };
7DC8310C2398283C0043DD9A /* SentryCrashIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC831092398283C0043DD9A /* SentryCrashIntegration.m */; };
8419C0C428C1889D001C8259 /* SentryProfilerSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */; };
8453421228BE855D00C22EEC /* SentrySampleDecision.m in Sources */ = {isa = PBXBuildFile; fileRef = 8453421128BE855D00C22EEC /* SentrySampleDecision.m */; };
8453421628BE8A9500C22EEC /* SentrySpanStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 8453421528BE8A9500C22EEC /* SentrySpanStatus.m */; };
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */; };
861265F92404EC1500C4AFDE /* NSArray+SentrySanitize.h in Headers */ = {isa = PBXBuildFile; fileRef = 861265F72404EC1500C4AFDE /* NSArray+SentrySanitize.h */; };
861265FA2404EC1500C4AFDE /* NSArray+SentrySanitize.m in Sources */ = {isa = PBXBuildFile; fileRef = 861265F82404EC1500C4AFDE /* NSArray+SentrySanitize.m */; };
8E0551E026A7A63C00400526 /* TestProtocolClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E0551DF26A7A63C00400526 /* TestProtocolClient.swift */; };
Expand Down Expand Up @@ -1323,6 +1325,7 @@
7DC830FF239826280043DD9A /* SentryIntegrationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryIntegrationProtocol.h; path = Public/SentryIntegrationProtocol.h; sourceTree = "<group>"; };
7DC831082398283C0043DD9A /* SentryCrashIntegration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryCrashIntegration.h; path = include/SentryCrashIntegration.h; sourceTree = "<group>"; };
7DC831092398283C0043DD9A /* SentryCrashIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryCrashIntegration.m; sourceTree = "<group>"; };
8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryProfilerSwiftTests.swift; sourceTree = "<group>"; };
844A34C3282B278500C6D1DF /* .github */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .github; sourceTree = "<group>"; };
844A3563282B3C9F00C6D1DF /* .sauce */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .sauce; sourceTree = "<group>"; };
844DA7F6282435CD00E6B62E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
Expand All @@ -1348,6 +1351,7 @@
844DA81F28246DE300E6B62E /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = "<group>"; };
8453421128BE855D00C22EEC /* SentrySampleDecision.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySampleDecision.m; sourceTree = "<group>"; };
8453421528BE8A9500C22EEC /* SentrySpanStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySpanStatus.m; sourceTree = "<group>"; };
84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SentryProfiler+Test.h"; path = "Sources/Sentry/include/SentryProfiler+Test.h"; sourceTree = SOURCE_ROOT; };
861265F72404EC1500C4AFDE /* NSArray+SentrySanitize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSArray+SentrySanitize.h"; path = "include/NSArray+SentrySanitize.h"; sourceTree = "<group>"; };
861265F82404EC1500C4AFDE /* NSArray+SentrySanitize.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+SentrySanitize.m"; sourceTree = "<group>"; };
8E0551DF26A7A63C00400526 /* TestProtocolClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProtocolClient.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1497,6 +1501,7 @@
035E73CB27D575B3005EEB11 /* SentrySamplingProfilerTests.mm */,
035E73CD27D5790A005EEB11 /* SentryThreadMetadataCacheTests.mm */,
03F9D37B2819A65C00602916 /* SentryProfilerTests.mm */,
8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */,
);
path = Profiling;
sourceTree = "<group>";
Expand Down Expand Up @@ -2678,6 +2683,7 @@
03F84D1B27DD414C008FE43F /* SentryMachLogging.hpp */,
03F84D2C27DD4191008FE43F /* SentryMachLogging.cpp */,
03F84D1127DD414C008FE43F /* SentryProfiler.h */,
84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */,
03F84D2B27DD4191008FE43F /* SentryProfiler.mm */,
03BCC38D27E2A377003232C7 /* SentryProfilingConditionals.h */,
03F84D2927DD416B008FE43F /* SentryProfilingLogging.hpp */,
Expand Down Expand Up @@ -2923,6 +2929,7 @@
8EE3251C261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h in Headers */,
7BAF3DD92440AEC8008A5414 /* SentryRequestManager.h in Headers */,
7BE3C77B2446111500A38442 /* SentryRateLimitParser.h in Headers */,
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */,
7D0637032382B34300B30749 /* SentryScope.h in Headers */,
03F84D2727DD414C008FE43F /* SentryMachLogging.hpp in Headers */,
0356A570288B4612008BF593 /* SentryProfilesSampler.h in Headers */,
Expand Down Expand Up @@ -3505,6 +3512,7 @@
63FE720520DA66EC00CDBAE8 /* FileBasedTestCase.m in Sources */,
0A6EEADD28A657970076B469 /* UIViewRecursiveDescriptionTests.swift in Sources */,
63EED6C32237989300E02400 /* SentryOptionsTest.m in Sources */,
8419C0C428C1889D001C8259 /* SentryProfilerSwiftTests.swift in Sources */,
7BBD18B22451804C00427C76 /* SentryRetryAfterHeaderParserTests.swift in Sources */,
7BD337E424A356180050DB6E /* SentryCrashIntegrationTests.swift in Sources */,
7BD4E8E827FD95900086C410 /* SentryMigrateSessionInitTests.m in Sources */,
Expand Down
5 changes: 3 additions & 2 deletions Sources/Sentry/SentryFramesTracker.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "SentryFramesTracker.h"
#import "SentryDisplayLinkWrapper.h"
#import "SentryProfiler.h"
#import "SentryProfilingConditionals.h"
#import "SentryTracer.h"
#import <SentryScreenFrames.h>
Expand Down Expand Up @@ -123,7 +124,7 @@ - (void)displayLinkCallback
}

# if SENTRY_TARGET_PROFILING_SUPPORTED
if (self.currentTracer.isProfiling
if ([SentryProfiler isRunning]
&& (self.frameRateTimestamps.count == 0
|| self.frameRateTimestamps.lastObject[@"frame_rate"].doubleValue
!= actualFramesPerSecond)) {
Expand Down Expand Up @@ -161,7 +162,7 @@ - (void)displayLinkCallback
# if SENTRY_TARGET_PROFILING_SUPPORTED
- (void)recordTimestampStart:(NSNumber *)start end:(NSNumber *)end
{
if (self.currentTracer.isProfiling) {
if ([SentryProfiler isRunning]) {
[self.frameTimestamps addObject:@{ @"start_timestamp" : start, @"end_timestamp" : end }];
}
}
Expand Down
Loading