-
-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
279 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#import "SentryDefines.h" | ||
#import "SentrySerializable.h" | ||
#import "SentryUnit.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface SentryMeasurement<UnitType : SentryUnit *> : NSObject <SentrySerializable> | ||
SENTRY_NO_INIT | ||
|
||
- (instancetype)initWithName:(NSString *)name value:(NSNumber *)value unit:(UnitType)unit; | ||
|
||
@property (nonatomic, copy, readonly) NSString *name; | ||
@property (nonatomic, copy, readonly) NSNumber *value; | ||
@property (readonly, copy) UnitType unit; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#import "SentryDefines.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface SentryUnit : NSObject <NSCopying> | ||
SENTRY_NO_INIT | ||
|
||
- (instancetype)initWithSymbol:(NSString *)symbol; | ||
|
||
@property (readonly, copy) NSString *symbol; | ||
|
||
@end | ||
|
||
@interface SentryUnitDuration : SentryUnit | ||
SENTRY_NO_INIT | ||
|
||
/** Nanosecond (`"nanosecond"`), 10^-9 seconds. */ | ||
@property (class, readonly, copy) SentryUnitDuration *nanoseconds; | ||
|
||
// ... | ||
|
||
@end | ||
|
||
@interface SentryUnitInformation : SentryUnit | ||
SENTRY_NO_INIT | ||
|
||
/** Bit (`"bit"`), corresponding to 1/8 of a byte. */ | ||
@property (class, readonly, copy) SentryUnitInformation *bit; | ||
|
||
// ... | ||
|
||
@end | ||
|
||
@interface SentryUnitFraction : SentryUnit | ||
SENTRY_NO_INIT | ||
|
||
/** Floating point fraction of `1`. */ | ||
@property (class, readonly, copy) SentryUnitFraction *ratio; | ||
|
||
/** Ratio expressed as a fraction of `100`. `100%` equals a ratio of `1.0`. */ | ||
@property (class, readonly, copy) SentryUnitFraction *percent; | ||
|
||
// ... | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#import "SentryMeasurement.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@implementation SentryMeasurement | ||
|
||
- (instancetype)initWithName:(NSString *)name value:(NSNumber *)value unit:(SentryUnit *)unit | ||
{ | ||
if (self = [super init]) { | ||
_name = name; | ||
_value = value; | ||
_unit = unit; | ||
} | ||
return self; | ||
} | ||
|
||
- (NSDictionary<NSString *, id> *)serialize | ||
{ | ||
return @{ @"name" : self.name, @"value" : self.value, @"unit" : self.unit.symbol }; | ||
} | ||
|
||
@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
Oops, something went wrong.