Skip to content

Commit 9ad4a5f

Browse files
authored
feat: profile concurrent transactions (#2227)
* Revert "Revert "feat: profile concurrent transactions (#2105)" (#2225)" This reverts commit 4c1fab4. * fix tests and test sdk logging * provide default for no build numbers
1 parent 5697a74 commit 9ad4a5f

File tree

16 files changed

+746
-460
lines changed

16 files changed

+746
-460
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
- Profile concurrent transactions (#2227)
8+
39
## 7.29.0
410

511
### Features

Sentry.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,10 @@
593593
7DC83100239826280043DD9A /* SentryIntegrationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DC830FF239826280043DD9A /* SentryIntegrationProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
594594
7DC8310A2398283C0043DD9A /* SentryCrashIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DC831082398283C0043DD9A /* SentryCrashIntegration.h */; };
595595
7DC8310C2398283C0043DD9A /* SentryCrashIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC831092398283C0043DD9A /* SentryCrashIntegration.m */; };
596+
8419C0C428C1889D001C8259 /* SentryProfilerSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */; };
596597
8453421228BE855D00C22EEC /* SentrySampleDecision.m in Sources */ = {isa = PBXBuildFile; fileRef = 8453421128BE855D00C22EEC /* SentrySampleDecision.m */; };
597598
8453421628BE8A9500C22EEC /* SentrySpanStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 8453421528BE8A9500C22EEC /* SentrySpanStatus.m */; };
599+
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */; };
598600
84A8891C28DBD28900C51DFD /* SentryDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A8891A28DBD28900C51DFD /* SentryDevice.h */; };
599601
84A8891D28DBD28900C51DFD /* SentryDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84A8891B28DBD28900C51DFD /* SentryDevice.mm */; };
600602
84A8892128DBD8D600C51DFD /* SentryDeviceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84A8892028DBD8D600C51DFD /* SentryDeviceTests.mm */; };
@@ -1350,6 +1352,7 @@
13501352
7DC830FF239826280043DD9A /* SentryIntegrationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryIntegrationProtocol.h; path = Public/SentryIntegrationProtocol.h; sourceTree = "<group>"; };
13511353
7DC831082398283C0043DD9A /* SentryCrashIntegration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryCrashIntegration.h; path = include/SentryCrashIntegration.h; sourceTree = "<group>"; };
13521354
7DC831092398283C0043DD9A /* SentryCrashIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryCrashIntegration.m; sourceTree = "<group>"; };
1355+
8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryProfilerSwiftTests.swift; sourceTree = "<group>"; };
13531356
844A34C3282B278500C6D1DF /* .github */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .github; sourceTree = "<group>"; };
13541357
844A3563282B3C9F00C6D1DF /* .sauce */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .sauce; sourceTree = "<group>"; };
13551358
844DA7F6282435CD00E6B62E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
@@ -1375,6 +1378,7 @@
13751378
844DA81F28246DE300E6B62E /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = "<group>"; };
13761379
8453421128BE855D00C22EEC /* SentrySampleDecision.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySampleDecision.m; sourceTree = "<group>"; };
13771380
8453421528BE8A9500C22EEC /* SentrySpanStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySpanStatus.m; sourceTree = "<group>"; };
1381+
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; };
13781382
84A8891A28DBD28900C51DFD /* SentryDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDevice.h; path = include/SentryDevice.h; sourceTree = "<group>"; };
13791383
84A8891B28DBD28900C51DFD /* SentryDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDevice.mm; sourceTree = "<group>"; };
13801384
84A8892028DBD8D600C51DFD /* SentryDeviceTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDeviceTests.mm; sourceTree = "<group>"; };
@@ -1527,6 +1531,7 @@
15271531
035E73CB27D575B3005EEB11 /* SentrySamplingProfilerTests.mm */,
15281532
035E73CD27D5790A005EEB11 /* SentryThreadMetadataCacheTests.mm */,
15291533
03F9D37B2819A65C00602916 /* SentryProfilerTests.mm */,
1534+
8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */,
15301535
);
15311536
path = Profiling;
15321537
sourceTree = "<group>";
@@ -2722,6 +2727,7 @@
27222727
03F84D1B27DD414C008FE43F /* SentryMachLogging.hpp */,
27232728
03F84D2C27DD4191008FE43F /* SentryMachLogging.cpp */,
27242729
03F84D1127DD414C008FE43F /* SentryProfiler.h */,
2730+
84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */,
27252731
03F84D2B27DD4191008FE43F /* SentryProfiler.mm */,
27262732
03BCC38D27E2A377003232C7 /* SentryProfilingConditionals.h */,
27272733
03F84D2927DD416B008FE43F /* SentryProfilingLogging.hpp */,
@@ -2969,6 +2975,7 @@
29692975
8EE3251C261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h in Headers */,
29702976
7BAF3DD92440AEC8008A5414 /* SentryRequestManager.h in Headers */,
29712977
7BE3C77B2446111500A38442 /* SentryRateLimitParser.h in Headers */,
2978+
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */,
29722979
7D0637032382B34300B30749 /* SentryScope.h in Headers */,
29732980
03F84D2727DD414C008FE43F /* SentryMachLogging.hpp in Headers */,
29742981
0356A570288B4612008BF593 /* SentryProfilesSampler.h in Headers */,
@@ -3560,6 +3567,7 @@
35603567
63FE720520DA66EC00CDBAE8 /* FileBasedTestCase.m in Sources */,
35613568
0A6EEADD28A657970076B469 /* UIViewRecursiveDescriptionTests.swift in Sources */,
35623569
63EED6C32237989300E02400 /* SentryOptionsTest.m in Sources */,
3570+
8419C0C428C1889D001C8259 /* SentryProfilerSwiftTests.swift in Sources */,
35633571
7BBD18B22451804C00427C76 /* SentryRetryAfterHeaderParserTests.swift in Sources */,
35643572
7BD337E424A356180050DB6E /* SentryCrashIntegrationTests.swift in Sources */,
35653573
7BD4E8E827FD95900086C410 /* SentryMigrateSessionInitTests.m in Sources */,

Sentry.xcodeproj/xcshareddata/xcschemes/Sentry.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</BuildActionEntries>
2424
</BuildAction>
2525
<TestAction
26-
buildConfiguration = "Debug"
26+
buildConfiguration = "Test"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "NO"

Sources/Sentry/SentryFramesTracker.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#import "SentryFramesTracker.h"
22
#import "SentryCompiler.h"
33
#import "SentryDisplayLinkWrapper.h"
4+
#import "SentryProfiler.h"
45
#import "SentryProfilingConditionals.h"
56
#import "SentryTracer.h"
67
#import <SentryScreenFrames.h>
@@ -132,7 +133,7 @@ - (void)displayLinkCallback
132133
# if defined(TEST) || defined(TESTCI)
133134
BOOL shouldRecordFrameRates = YES;
134135
# else
135-
BOOL shouldRecordFrameRates = self.currentTracer.isProfiling;
136+
BOOL shouldRecordFrameRates = [SentryProfiler isRunning];
136137
# endif // defined(TEST) || defined(TESTCI)
137138
BOOL hasNoFrameRatesYet = self.frameRateTimestamps.count == 0;
138139
BOOL frameRateSignificantlyChanged
@@ -175,7 +176,7 @@ - (void)displayLinkCallback
175176
# if SENTRY_TARGET_PROFILING_SUPPORTED
176177
- (void)recordTimestampStart:(NSNumber *)start end:(NSNumber *)end
177178
{
178-
BOOL shouldRecord = self.currentTracer.isProfiling;
179+
BOOL shouldRecord = [SentryProfiler isRunning];
179180
# if defined(TEST) || defined(TESTCI)
180181
shouldRecord = YES;
181182
# endif

0 commit comments

Comments
 (0)