-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-native): support for starting native spans on ios
- Loading branch information
1 parent
ab5a293
commit 7373858
Showing
9 changed files
with
165 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/platforms/react-native/ios/BugsnagPerformanceSpan.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#import "BugsnagPerformanceSpanContext.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface BugsnagPerformanceSpan : BugsnagPerformanceSpanContext | ||
|
||
@property(nonatomic,readonly) BOOL isValid; | ||
|
||
@property (nonatomic,readonly) NSString *name; | ||
@property (nonatomic,readonly) NSDate *_Nullable startTime; | ||
@property (nonatomic,readonly) NSDate *_Nullable endTime; | ||
|
||
@property (nonatomic,readwrite) SpanId parentId; | ||
@property (nonatomic,readonly) NSMutableDictionary *attributes; | ||
|
||
- (void)abortIfOpen; | ||
|
||
- (void)abortUnconditionally; | ||
|
||
- (void)end; | ||
|
||
- (void)endWithEndTime:(NSDate *)endTime NS_SWIFT_NAME(end(endTime:)); | ||
|
||
- (void)setAttribute:(NSString *)attributeName withValue:(_Nullable id)value; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
24 changes: 24 additions & 0 deletions
24
packages/platforms/react-native/ios/BugsnagPerformanceSpanContext.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef union { | ||
__uint128_t value; | ||
struct { | ||
uint64_t lo; | ||
uint64_t hi; | ||
}; | ||
} TraceId; | ||
|
||
typedef uint64_t SpanId; | ||
|
||
@interface BugsnagPerformanceSpanContext : NSObject | ||
|
||
@property(nonatomic) TraceId traceId; | ||
@property(nonatomic) SpanId spanId; | ||
|
||
- (instancetype) initWithTraceIdHi:(uint64_t)traceIdHi traceIdLo:(uint64_t)traceIdLo spanId:(SpanId)spanId; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
27 changes: 27 additions & 0 deletions
27
packages/platforms/react-native/ios/BugsnagPerformanceSpanOptions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#import "BugsnagPerformanceSpanContext.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef NS_ENUM(uint8_t, BSGFirstClass) { | ||
BSGFirstClassNo = 0, | ||
BSGFirstClassYes = 1, | ||
BSGFirstClassUnset = 2, | ||
}; | ||
|
||
// Affects whether or not a span should include rendering metrics | ||
typedef NS_ENUM(uint8_t, BSGInstrumentRendering) { | ||
BSGInstrumentRenderingNo = 0, // Never include rendering metrics | ||
BSGInstrumentRenderingYes = 1, // Always include rendering metrics, as long as the autoInstrumentRendering configuration option is on | ||
BSGInstrumentRenderingUnset = 2, // Include rendering metrics only if the span is first class, start and end times were not set when creating/closing the span and the autoInstrumentRendering configuration option is on | ||
}; | ||
|
||
@interface BugsnagPerformanceSpanOptions : NSObject | ||
|
||
@property(nonatomic) NSDate * _Nullable startTime; | ||
@property(nonatomic) BugsnagPerformanceSpanContext * _Nullable parentContext; | ||
@property(nonatomic) BOOL makeCurrentContext; | ||
@property(nonatomic) BSGFirstClass firstClass; | ||
@property(nonatomic) BSGInstrumentRendering instrumentRendering; | ||
|
||
@end | ||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters