Skip to content

Commit

Permalink
fix another build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight committed Apr 18, 2024
1 parent 8555434 commit 1c745a7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
45 changes: 27 additions & 18 deletions Sources/Sentry/Profiling/SentryLaunchProfiling.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# import "SentryDispatchQueueWrapper.h"
# import "SentryFileManager.h"
# import "SentryInternalDefines.h"
# import "SentryLaunchProfiling+Tests.h"
# import "SentryLaunchProfiling.h"
# import "SentryLog.h"
# import "SentryOptions.h"
# import "SentryProfiler+Private.h"
Expand All @@ -23,12 +23,8 @@

NS_ASSUME_NONNULL_BEGIN

NSString *const kSentryLaunchProfileConfigKeyTracesSampleRate = @"traces";
NSString *const kSentryLaunchProfileConfigKeyProfilesSampleRate = @"profiles";

# pragma mark - Private

BOOL sentry_isTracingAppLaunch;
static SentryTracer *_Nullable sentry_launchTracer;

SentryTracerConfiguration *
Expand All @@ -41,6 +37,17 @@
return config;

Check warning on line 37 in Sources/Sentry/Profiling/SentryLaunchProfiling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/Profiling/SentryLaunchProfiling.m#L33-L37

Added lines #L33 - L37 were not covered by tests
}

# pragma mark - Package

typedef struct {
BOOL shouldProfile;
SentrySamplerDecision *_Nullable tracesDecision;
SentrySamplerDecision *_Nullable profilesDecision;
} SentryLaunchProfileConfig;

NSString *const kSentryLaunchProfileConfigKeyTracesSampleRate = @"traces";
NSString *const kSentryLaunchProfileConfigKeyProfilesSampleRate = @"profiles";

SentryLaunchProfileConfig
sentry_shouldProfileNextLaunch(SentryOptions *options)
{
Expand Down Expand Up @@ -75,8 +82,23 @@
return (SentryLaunchProfileConfig) { YES, tracesSamplerDecision, profilesSamplerDecision };
}

SentryTransactionContext *
sentry_context(NSNumber *tracesRate)
{
SentryTransactionContext *context =
[[SentryTransactionContext alloc] initWithName:@"launch"
nameSource:kSentryTransactionNameSourceCustom
operation:@"app.lifecycle"
origin:SentryTraceOriginAutoAppStartProfile
sampled:kSentrySampleDecisionYes];
context.sampleRate = tracesRate;
return context;
}

# pragma mark - Public

BOOL sentry_isTracingAppLaunch;

void
sentry_configureLaunchProfiling(SentryOptions *options)
{
Expand All @@ -97,19 +119,6 @@
}];
}

SentryTransactionContext *
sentry_context(NSNumber *tracesRate)
{
SentryTransactionContext *context =
[[SentryTransactionContext alloc] initWithName:@"launch"
nameSource:kSentryTransactionNameSourceCustom
operation:@"app.lifecycle"
origin:SentryTraceOriginAutoAppStartProfile
sampled:kSentrySampleDecisionYes];
context.sampleRate = tracesRate;
return context;
}

void
sentry_startLaunchProfile(void)
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/SentryTests/SentryLaunchProfiling+Tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ typedef struct {
SentrySamplerDecision *_Nullable profilesDecision;
} SentryLaunchProfileConfig;

SentryLaunchProfileConfig sentry_shouldProfileNextLaunch(SentryOptions *options);

SENTRY_EXTERN NSString *const kSentryLaunchProfileConfigKeyTracesSampleRate;
SENTRY_EXTERN NSString *const kSentryLaunchProfileConfigKeyProfilesSampleRate;

SentryLaunchProfileConfig sentry_shouldProfileNextLaunch(SentryOptions *options);

SentryTransactionContext *sentry_context(NSNumber *tracesRate);

NS_ASSUME_NONNULL_END
Expand Down

0 comments on commit 1c745a7

Please sign in to comment.