Skip to content

Commit

Permalink
trace lifecycle implementation
Browse files Browse the repository at this point in the history
    refactor remaining profiling code in tracer to file combining
    SentryProfiledTracerConcurrency and
    SentryCaptureTransactionWithProfile, and add functions to start
    and stop continuous profiler based on root span counts
  • Loading branch information
armcknight committed Feb 18, 2025
1 parent 922ee10 commit 5d43904
Show file tree
Hide file tree
Showing 14 changed files with 378 additions and 323 deletions.
24 changes: 8 additions & 16 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
6205CF262D549D8A001E6049 /* SentryDateCodableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6205CF252D549D8A001E6049 /* SentryDateCodableTests.swift */; };
621AE74B2C626C230012E730 /* SentryANRTrackerV2.h in Headers */ = {isa = PBXBuildFile; fileRef = 621AE74A2C626C230012E730 /* SentryANRTrackerV2.h */; };
621AE74D2C626C510012E730 /* SentryANRTrackerV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 621AE74C2C626C510012E730 /* SentryANRTrackerV2.m */; };
621C88482CAD23B9000EABCB /* SentryCaptureTransactionWithProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 621C88472CAD23B9000EABCB /* SentryCaptureTransactionWithProfile.h */; };
621C884A2CAD23E9000EABCB /* SentryCaptureTransactionWithProfile.mm in Sources */ = {isa = PBXBuildFile; fileRef = 621C88492CAD23E9000EABCB /* SentryCaptureTransactionWithProfile.mm */; };
621D9F2F2B9B0320003D94DE /* SentryCurrentDateProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621D9F2E2B9B0320003D94DE /* SentryCurrentDateProvider.swift */; };
621F61F12BEA073A005E654F /* SentryEnabledFeaturesBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621F61F02BEA073A005E654F /* SentryEnabledFeaturesBuilder.swift */; };
62212B872D520CB00062C2FA /* SentryEventCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62212B862D520CB00062C2FA /* SentryEventCodable.swift */; };
Expand Down Expand Up @@ -718,8 +716,8 @@
84AC61D929F7643B009EEF61 /* TestDispatchFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AC61D829F7643B009EEF61 /* TestDispatchFactory.swift */; };
84AC61DB29F7654A009EEF61 /* TestDispatchSourceWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AC61DA29F7654A009EEF61 /* TestDispatchSourceWrapper.swift */; };
84AEB46A2C2F97FC007E46E1 /* ArrayAccesses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AEB4682C2F9673007E46E1 /* ArrayAccesses.swift */; };
84AF45A629A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AF45A429A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h */; };
84AF45A729A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84AF45A529A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm */; };
84AF45A629A7FFA500FBB177 /* SentryProfilerTracerTracking.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AF45A429A7FFA500FBB177 /* SentryProfilerTracerTracking.h */; };
84AF45A729A7FFA500FBB177 /* SentryProfilerTracerTracking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84AF45A529A7FFA500FBB177 /* SentryProfilerTracerTracking.mm */; };
84B0DFF42CD2CF64007FB332 /* SentryUserFeedbackFormController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B0DFF32CD2CF64007FB332 /* SentryUserFeedbackFormController.swift */; };
84B0E0072CD963FD007FB332 /* SentryIconography.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B0E0062CD963F9007FB332 /* SentryIconography.swift */; };
84B7FA3529B285FC00AD93B1 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63AA759B1EB8AEF500D153DE /* Sentry.framework */; };
Expand Down Expand Up @@ -1148,8 +1146,6 @@
621AE74A2C626C230012E730 /* SentryANRTrackerV2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryANRTrackerV2.h; path = include/SentryANRTrackerV2.h; sourceTree = "<group>"; };
621AE74C2C626C510012E730 /* SentryANRTrackerV2.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryANRTrackerV2.m; sourceTree = "<group>"; };
621AE74E2C626CF70012E730 /* SentryANRTrackerV2Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryANRTrackerV2Tests.swift; sourceTree = "<group>"; };
621C88472CAD23B9000EABCB /* SentryCaptureTransactionWithProfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryCaptureTransactionWithProfile.h; path = Sources/Sentry/include/SentryCaptureTransactionWithProfile.h; sourceTree = SOURCE_ROOT; };
621C88492CAD23E9000EABCB /* SentryCaptureTransactionWithProfile.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryCaptureTransactionWithProfile.mm; sourceTree = "<group>"; };
621D9F2E2B9B0320003D94DE /* SentryCurrentDateProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCurrentDateProvider.swift; sourceTree = "<group>"; };
621F61F02BEA073A005E654F /* SentryEnabledFeaturesBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnabledFeaturesBuilder.swift; sourceTree = "<group>"; };
62212B862D520CB00062C2FA /* SentryEventCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEventCodable.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1857,8 +1853,8 @@
84AC61D829F7643B009EEF61 /* TestDispatchFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestDispatchFactory.swift; sourceTree = "<group>"; };
84AC61DA29F7654A009EEF61 /* TestDispatchSourceWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestDispatchSourceWrapper.swift; sourceTree = "<group>"; };
84AEB4682C2F9673007E46E1 /* ArrayAccesses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayAccesses.swift; sourceTree = "<group>"; };
84AF45A429A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfiledTracerConcurrency.h; path = ../include/SentryProfiledTracerConcurrency.h; sourceTree = "<group>"; };
84AF45A529A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfiledTracerConcurrency.mm; sourceTree = "<group>"; };
84AF45A429A7FFA500FBB177 /* SentryProfilerTracerTracking.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfilerTracerTracking.h; path = ../include/SentryProfilerTracerTracking.h; sourceTree = "<group>"; };
84AF45A529A7FFA500FBB177 /* SentryProfilerTracerTracking.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfilerTracerTracking.mm; sourceTree = "<group>"; };
84B0DFF32CD2CF64007FB332 /* SentryUserFeedbackFormController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedbackFormController.swift; sourceTree = "<group>"; };
84B0E0062CD963F9007FB332 /* SentryIconography.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryIconography.swift; sourceTree = "<group>"; };
84B7FA3B29B2866200AD93B1 /* SentryTestUtils-ObjC-BridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryTestUtils-ObjC-BridgingHeader.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3568,10 +3564,8 @@
8459FCBD2BD73E810038E9C9 /* SentryProfilerSerialization.h */,
8459FCBF2BD73EB20038E9C9 /* SentryProfilerSerialization.mm */,
8459FCC12BD73EEF0038E9C9 /* SentryProfilerSerialization+Test.h */,
621C88472CAD23B9000EABCB /* SentryCaptureTransactionWithProfile.h */,
621C88492CAD23E9000EABCB /* SentryCaptureTransactionWithProfile.mm */,
84AF45A429A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h */,
84AF45A529A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm */,
84AF45A429A7FFA500FBB177 /* SentryProfilerTracerTracking.h */,
84AF45A529A7FFA500FBB177 /* SentryProfilerTracerTracking.mm */,
840B7EF22BBF83DF008B8120 /* SentryProfiler+Private.h */,
8431D4612BE1B534009EAEC1 /* SentryProfilerDefines.h */,
03F84D2B27DD4191008FE43F /* SentryProfiler.mm */,
Expand Down Expand Up @@ -4258,7 +4252,6 @@
7D7F0A5F23DF3D2C00A4629C /* SentryGlobalEventProcessor.h in Headers */,
D867063D27C3BC2400048851 /* SentryCoreDataTrackingIntegration.h in Headers */,
0A2D8D5D289815EB008720F6 /* SentryBaseIntegration.h in Headers */,
621C88482CAD23B9000EABCB /* SentryCaptureTransactionWithProfile.h in Headers */,
84AC61D629F75A98009EEF61 /* SentryDispatchFactory.h in Headers */,
63FE716520DA4C1100CDBAE8 /* SentryCrashMemory.h in Headers */,
63FE713F20DA4C1100CDBAE8 /* SentryCrashStackCursor_SelfThread.h in Headers */,
Expand Down Expand Up @@ -4302,7 +4295,7 @@
03F84D1E27DD414C008FE43F /* SentryBacktrace.hpp in Headers */,
63AA76991EB9C1C200D153DE /* SentryDefines.h in Headers */,
D86B6835294348A400B8B1FC /* SentryAttachment+Private.h in Headers */,
84AF45A629A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h in Headers */,
84AF45A629A7FFA500FBB177 /* SentryProfilerTracerTracking.h in Headers */,
7B2A70DB27D607CF008B0D15 /* SentryThreadWrapper.h in Headers */,
8EAE980B261E9F530073B6B3 /* SentryPerformanceTracker.h in Headers */,
63FE718520DA4C1100CDBAE8 /* SentryCrashC.h in Headers */,
Expand Down Expand Up @@ -4878,7 +4871,6 @@
84CFA4CD2C9E0CA3008DA5F4 /* SentryUserFeedbackIntegration.m in Sources */,
7BCFA71627D0BB50008C662C /* SentryANRTrackerV1.m in Sources */,
8459FCC02BD73EB20038E9C9 /* SentryProfilerSerialization.mm in Sources */,
621C884A2CAD23E9000EABCB /* SentryCaptureTransactionWithProfile.mm in Sources */,
63EED6C02237923600E02400 /* SentryOptions.m in Sources */,
620078722D38F00D0022CB67 /* SentryGeoCodable.swift in Sources */,
D8CB741B2947286500A5F964 /* SentryEnvelopeItemHeader.m in Sources */,
Expand Down Expand Up @@ -5023,7 +5015,7 @@
D81988C52BEC18CA0020E36C /* SentryRRWebCustomEvent.swift in Sources */,
8497988D2D5FFDB3009AE4B5 /* SentryProfilingOptions.swift in Sources */,
639889B81EDECFA800EA7442 /* SentryBreadcrumbTracker.m in Sources */,
84AF45A729A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm in Sources */,
84AF45A729A7FFA500FBB177 /* SentryProfilerTracerTracking.mm in Sources */,
62872B5F2BA1B7F300A4FA7D /* NSLock.swift in Sources */,
7DC8310C2398283C0043DD9A /* SentryCrashIntegration.m in Sources */,
03F84D3227DD4191008FE43F /* SentryProfiler.mm in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/PrivateSentrySDKOnly.mm
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#import <SentryUser.h>

#if SENTRY_TARGET_PROFILING_SUPPORTED
# import "SentryProfiledTracerConcurrency.h"
# import "SentryProfilerSerialization.h"
# import "SentryProfilerTracerTracking.h"
# import "SentryTraceProfiler.h"
#endif // SENTRY_TARGET_PROFILING_SUPPORTED

Expand Down
50 changes: 0 additions & 50 deletions Sources/Sentry/Profiling/SentryCaptureTransactionWithProfile.mm

This file was deleted.

156 changes: 0 additions & 156 deletions Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/Sentry/Profiling/SentryProfilerSerialization.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
# import "SentryMeta.h"
# import "SentryMetricProfiler.h"
# import "SentryProfileTimeseries.h"
# import "SentryProfiledTracerConcurrency.h"
# import "SentryProfiler+Private.h"
# import "SentryProfilerSerialization+Test.h"
# import "SentryProfilerSerialization.h"
# import "SentryProfilerState.h"
# import "SentryProfilerTestHelpers.h"
# import "SentryProfilerTracerTracking.h"
# import "SentrySDK+Private.h"
# import "SentrySample.h"
# import "SentryScope+Private.h"
Expand Down
Loading

0 comments on commit 5d43904

Please sign in to comment.