Skip to content

Commit

Permalink
Merge 5951641 into 881a955
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight committed Sep 15, 2023
2 parents 881a955 + 5951641 commit 5a52ddf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- Remove warning about non-portable path to file "SentryDsn.h" (#3270)
- Fix how profiles were identified in the backend for grouping and issue correlation purposes (#3282)

### Features

Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
void
_unsafe_cleanUpProfiler(SentryProfiler *profiler, NSString *tracerKey)
{
const auto profilerKey = profiler.profileId.sentryIdString;
const auto profilerKey = profiler.profilerId.sentryIdString;

[_gTracersToProfilers removeObjectForKey:tracerKey];
_gProfilersToTracers[profilerKey] = @(_gProfilersToTracers[profilerKey].unsignedIntValue - 1);
Expand All @@ -58,7 +58,7 @@
{
std::lock_guard<std::mutex> l(_gStateLock);

const auto profilerKey = profiler.profileId.sentryIdString;
const auto profilerKey = profiler.profilerId.sentryIdString;
const auto tracerKey = traceId.sentryIdString;

SENTRY_LOG_DEBUG(
Expand Down
14 changes: 7 additions & 7 deletions Sources/Sentry/SentryProfiler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@
}

NSMutableDictionary<NSString *, id> *
serializedProfileData(NSDictionary<NSString *, id> *profileData, uint64_t startSystemTime,
uint64_t endSystemTime, SentryId *profileID, NSString *truncationReason,
NSDictionary<NSString *, id> *serializedMetrics, NSArray<SentryDebugMeta *> *debugMeta,
SentryHub *hub
serializedProfileData(
NSDictionary<NSString *, id> *profileData, uint64_t startSystemTime, uint64_t endSystemTime,
NSString *truncationReason, NSDictionary<NSString *, id> *serializedMetrics,
NSArray<SentryDebugMeta *> *debugMeta, SentryHub *hub
# if SENTRY_HAS_UIKIT
,
SentryScreenFrames *gpuData
Expand Down Expand Up @@ -211,7 +211,7 @@
@"model" : isEmulated ? sentry_getSimulatorDeviceModel() : sentry_getDeviceModel()
};

payload[@"profile_id"] = profileID.sentryIdString;
payload[@"profile_id"] = [[[SentryId alloc] init] sentryIdString];
payload[@"truncation_reason"] = truncationReason;
payload[@"environment"] = hub.scope.environmentString ?: hub.getClient.options.environment;
payload[@"release"] = hub.getClient.options.releaseName;
Expand Down Expand Up @@ -270,7 +270,7 @@ - (instancetype)init
return nil;
}

_profileId = [[SentryId alloc] init];
_profilerId = [[SentryId alloc] init];

SENTRY_LOG_DEBUG(@"Initialized new SentryProfiler %@", self);
_debugImageProvider = [SentryDependencyContainer sharedInstance].debugImageProvider;
Expand Down Expand Up @@ -415,7 +415,7 @@ + (void)updateProfilePayload:(NSMutableDictionary<NSString *, id> *)payload
onHub:(SentryHub *)hub;
{
return serializedProfileData([self._state copyProfilingData], startSystemTime, endSystemTime,
self.profileId, profilerTruncationReasonName(_truncationReason),
profilerTruncationReasonName(_truncationReason),
[_metricProfiler serializeBetween:startSystemTime and:endSystemTime],
[_debugImageProvider getDebugImagesCrashed:NO], hub
# if SENTRY_HAS_UIKIT
Expand Down
5 changes: 2 additions & 3 deletions Sources/Sentry/include/SentryProfiler+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ NS_ASSUME_NONNULL_BEGIN

NSMutableDictionary<NSString *, id> *serializedProfileData(
NSDictionary<NSString *, id> *profileData, uint64_t startSystemTime, uint64_t endSystemTime,
SentryId *profileID, NSString *truncationReason,
NSDictionary<NSString *, id> *serializedMetrics, NSArray<SentryDebugMeta *> *debugMeta,
SentryHub *hub
NSString *truncationReason, NSDictionary<NSString *, id> *serializedMetrics,
NSArray<SentryDebugMeta *> *debugMeta, SentryHub *hub
# if SENTRY_HAS_UIKIT
,
SentryScreenFrames *gpuData
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/include/SentryProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SENTRY_EXTERN_C_END
*/
@interface SentryProfiler : NSObject

@property (strong, nonatomic) SentryId *profileId;
@property (strong, nonatomic) SentryId *profilerId;

/**
* Start a profiler, if one isn't already running.
Expand Down
7 changes: 3 additions & 4 deletions Tests/SentryProfilerTests/SentryProfilerTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,9 @@ - (void)testProfilerMutationDuringSerialization
// serialize the data as if it were captured in a transaction envelope
const auto profileData = [state copyProfilingData];

const auto profileID = [[SentryId alloc] init];
const auto serialization = serializedProfileData(profileData, 1, 2, profileID,
profilerTruncationReasonName(SentryProfilerTruncationReasonNormal), @{}, @[],
[[SentryHub alloc] initWithClient:nil andScope:nil]
const auto serialization = serializedProfileData(
profileData, 1, 2, profilerTruncationReasonName(SentryProfilerTruncationReasonNormal), @{},
@[], [[SentryHub alloc] initWithClient:nil andScope:nil]
# if SENTRY_HAS_UIKIT
,
[[SentryScreenFrames alloc] initWithTotal:5
Expand Down

0 comments on commit 5a52ddf

Please sign in to comment.