Skip to content

Commit

Permalink
add noop implementations for BugsnagPerformance classes
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag committed Dec 2, 2024
1 parent 7373858 commit e84642f
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
53 changes: 53 additions & 0 deletions packages/platforms/react-native/ios/BugsnagPerformanceSpan.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#import "BugsnagPerformanceSpan.h"

@implementation BugsnagPerformanceSpan

- (BOOL)isValid {
return NO;
}

- (NSString *)name {
return @"";
}

- (NSDate *_Nullable)startTime {
return nil;
}

- (NSDate *_Nullable)endTime {
return nil;
}

- (SpanId)parentId {
return 0;
}

- (void)setParentId:(SpanId)parentId {
// No-op
}

- (NSMutableDictionary *)attributes {
return [NSMutableDictionary dictionary];
}

- (void)abortIfOpen {
// No-op
}

- (void)abortUnconditionally {
// No-op
}

- (void)end {
// No-op
}

- (void)endWithEndTime:(NSDate *)endTime {
// No-op
}

- (void)setAttribute:(NSString *)attributeName withValue:(id _Nullable)value {
// No-op
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import "BugsnagPerformanceSpanContext.h"

@implementation BugsnagPerformanceSpanContext

- (instancetype) initWithTraceIdHi:(uint64_t)traceIdHi traceIdLo:(uint64_t)traceIdLo spanId:(SpanId)spanId {
self = [super init];
return self;
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#import "BugsnagPerformanceSpanOptions.h"

@implementation BugsnagPerformanceSpanOptions

- (instancetype)initWithName:(NSString *)name
startTime:(NSDate *)startTime
attributes:(NSDictionary<NSString *, id> *)attributes {
self = [super init];
return self;
}

- (NSString *)name {
return @"";
}

- (NSDate *)startTime {
return [NSDate date];
}

- (NSDictionary<NSString *, id> *)attributes {
return @{};
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

/* Begin PBXBuildFile section */
DA396E142CCFD327009B37C2 /* BugsnagCocoaPerformanceFromBugsnagReactNativePerformance.m in Sources */ = {isa = PBXBuildFile; fileRef = DA396E132CCFD327009B37C2 /* BugsnagCocoaPerformanceFromBugsnagReactNativePerformance.m */; };
DADF3E582CFE1C20002D2AC6 /* BugsnagPerformanceSpanContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = DADF3E572CFE1C20002D2AC6 /* BugsnagPerformanceSpanContext.mm */; };
DADF3E5A2CFE2192002D2AC6 /* BugsnagPerformanceSpan.mm in Sources */ = {isa = PBXBuildFile; fileRef = DADF3E592CFE2192002D2AC6 /* BugsnagPerformanceSpan.mm */; };
DADF3E5C2CFE248B002D2AC6 /* BugsnagPerformanceSpanOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DADF3E5B2CFE248B002D2AC6 /* BugsnagPerformanceSpanOptions.mm */; };
DAE18DD42C58DF2500D52529 /* BugsnagReactNativePerformance.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE18DD32C58DF2500D52529 /* BugsnagReactNativePerformance.mm */; };
DAE18DD72C58E02C00D52529 /* BugsnagReactNativePerformance.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DAE18DD22C58DF2500D52529 /* BugsnagReactNativePerformance.h */; };
/* End PBXBuildFile section */
Expand All @@ -33,6 +36,9 @@
DAC1DC592CF87E770009C7F9 /* BugsnagPerformanceSpanContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagPerformanceSpanContext.h; sourceTree = "<group>"; };
DAC1DC5A2CF87EBA0009C7F9 /* BugsnagPerformanceSpanOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagPerformanceSpanOptions.h; sourceTree = "<group>"; };
DAC1DC5B2CF8859A0009C7F9 /* BugsnagPerformanceSpan.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagPerformanceSpan.h; sourceTree = "<group>"; };
DADF3E572CFE1C20002D2AC6 /* BugsnagPerformanceSpanContext.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BugsnagPerformanceSpanContext.mm; sourceTree = "<group>"; };
DADF3E592CFE2192002D2AC6 /* BugsnagPerformanceSpan.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BugsnagPerformanceSpan.mm; sourceTree = "<group>"; };
DADF3E5B2CFE248B002D2AC6 /* BugsnagPerformanceSpanOptions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BugsnagPerformanceSpanOptions.mm; sourceTree = "<group>"; };
DAE18DD22C58DF2500D52529 /* BugsnagReactNativePerformance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BugsnagReactNativePerformance.h; sourceTree = "<group>"; };
DAE18DD32C58DF2500D52529 /* BugsnagReactNativePerformance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BugsnagReactNativePerformance.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -59,6 +65,9 @@
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
DADF3E5B2CFE248B002D2AC6 /* BugsnagPerformanceSpanOptions.mm */,
DADF3E592CFE2192002D2AC6 /* BugsnagPerformanceSpan.mm */,
DADF3E572CFE1C20002D2AC6 /* BugsnagPerformanceSpanContext.mm */,
DAC1DC5B2CF8859A0009C7F9 /* BugsnagPerformanceSpan.h */,
DAC1DC5A2CF87EBA0009C7F9 /* BugsnagPerformanceSpanOptions.h */,
DAC1DC592CF87E770009C7F9 /* BugsnagPerformanceSpanContext.h */,
Expand Down Expand Up @@ -128,7 +137,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DADF3E5C2CFE248B002D2AC6 /* BugsnagPerformanceSpanOptions.mm in Sources */,
DADF3E582CFE1C20002D2AC6 /* BugsnagPerformanceSpanContext.mm in Sources */,
DA396E142CCFD327009B37C2 /* BugsnagCocoaPerformanceFromBugsnagReactNativePerformance.m in Sources */,
DADF3E5A2CFE2192002D2AC6 /* BugsnagPerformanceSpan.mm in Sources */,
DAE18DD42C58DF2500D52529 /* BugsnagReactNativePerformance.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down

0 comments on commit e84642f

Please sign in to comment.