Skip to content

Commit

Permalink
refactor: add origin as parameter to file IO tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime committed Feb 18, 2025
1 parent 43a41b3 commit c5207e7
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 16 deletions.
8 changes: 8 additions & 0 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@
A8F17B2E2901765900990B25 /* SentryRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = A8F17B2D2901765900990B25 /* SentryRequest.m */; };
A8F17B342902870300990B25 /* SentryHttpStatusCodeRange.m in Sources */ = {isa = PBXBuildFile; fileRef = A8F17B332902870300990B25 /* SentryHttpStatusCodeRange.m */; };
D42E48572D48DF1600D251BC /* SentryBuildAppStartSpansTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D42E48562D48DF1600D251BC /* SentryBuildAppStartSpansTests.swift */; };
D43647EF2D5CF9E3001468E0 /* SentrySpanKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43647EE2D5CF9DC001468E0 /* SentrySpanKey.swift */; };
D43647F12D5CFB71001468E0 /* SentrySpanKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D43647F02D5CFB71001468E0 /* SentrySpanKeyTests.swift */; };
D48724DB2D352597005DE483 /* SentryTraceOrigin.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48724DA2D352591005DE483 /* SentryTraceOrigin.swift */; };
D48724DD2D354939005DE483 /* SentrySpanOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48724DC2D354934005DE483 /* SentrySpanOperation.swift */; };
D48724E02D3549CA005DE483 /* SentrySpanOperationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48724DF2D3549C6005DE483 /* SentrySpanOperationTests.swift */; };
Expand Down Expand Up @@ -1949,6 +1951,8 @@
D41909942D490006002B83D0 /* SentryNSDictionarySanitize+Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "SentryNSDictionarySanitize+Tests.m"; sourceTree = "<group>"; };
D42E48562D48DF1600D251BC /* SentryBuildAppStartSpansTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBuildAppStartSpansTests.swift; sourceTree = "<group>"; };
D42E48582D48FC8F00D251BC /* SentryNSDictionarySanitizeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNSDictionarySanitizeTests.swift; sourceTree = "<group>"; };
D43647EE2D5CF9DC001468E0 /* SentrySpanKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySpanKey.swift; sourceTree = "<group>"; };
D43647F02D5CFB71001468E0 /* SentrySpanKeyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentrySpanKeyTests.swift; sourceTree = "<group>"; };
D48724DA2D352591005DE483 /* SentryTraceOrigin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryTraceOrigin.swift; sourceTree = "<group>"; };
D48724DC2D354934005DE483 /* SentrySpanOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySpanOperation.swift; sourceTree = "<group>"; };
D48724DF2D3549C6005DE483 /* SentrySpanOperationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySpanOperationTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3785,6 +3789,7 @@
children = (
D48724DA2D352591005DE483 /* SentryTraceOrigin.swift */,
D48724DC2D354934005DE483 /* SentrySpanOperation.swift */,
D43647EE2D5CF9DC001468E0 /* SentrySpanKey.swift */,
);
path = Transactions;
sourceTree = "<group>";
Expand All @@ -3794,6 +3799,7 @@
children = (
D48724E12D354D16005DE483 /* SentryTraceOriginTests.swift */,
D48724DF2D3549C6005DE483 /* SentrySpanOperationTests.swift */,
D43647F02D5CFB71001468E0 /* SentrySpanKeyTests.swift */,
);
path = Transactions;
sourceTree = "<group>";
Expand Down Expand Up @@ -4957,6 +4963,7 @@
D82859432C3E753C009A28AA /* SentrySessionReplaySyncC.c in Sources */,
D833D57C2D10784800961E7A /* SentryRRWebOptionsEvent.swift in Sources */,
84A8891D28DBD28900C51DFD /* SentryDevice.mm in Sources */,
D43647EF2D5CF9E3001468E0 /* SentrySpanKey.swift in Sources */,
7B56D73324616D9500B842DA /* SentryConcurrentRateLimitsDictionary.m in Sources */,
8ECC674825C23A20000E2BF6 /* SentryTransaction.m in Sources */,
0A80E433291017C300095219 /* SentryWatchdogTerminationScopeObserver.m in Sources */,
Expand Down Expand Up @@ -5392,6 +5399,7 @@
7BF9EF7A2722B58900B5BBEF /* SentrySubClassFinderTests.swift in Sources */,
D48724E02D3549CA005DE483 /* SentrySpanOperationTests.swift in Sources */,
7B59398224AB47650003AAD2 /* SentrySessionTrackerTests.swift in Sources */,
D43647F12D5CFB71001468E0 /* SentrySpanKeyTests.swift in Sources */,
7B05A61824A4D14A00EF211D /* SentrySessionGeneratorTests.swift in Sources */,
D8CB742B294B1DD000A5F964 /* SentryUIApplicationTests.swift in Sources */,
63FE720920DA66EC00CDBAE8 /* XCTestCase+SentryCrash.m in Sources */,
Expand Down
53 changes: 37 additions & 16 deletions Sources/Sentry/SentryFileIOTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ - (void)disable
- (BOOL)measureNSData:(NSData *)data
writeToFile:(NSString *)path
atomically:(BOOL)useAuxiliaryFile
origin:(NSString *)origin
method:(BOOL (^)(NSString *, BOOL))method
{
id<SentrySpan> span = [self startTrackingWritingNSData:data filePath:path];
id<SentrySpan> span = [self startTrackingWritingNSData:data filePath:path origin:origin];

Check warning on line 65 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L65

Added line #L65 was not covered by tests

BOOL result = method(path, useAuxiliaryFile);

Expand All @@ -74,10 +75,11 @@ - (BOOL)measureNSData:(NSData *)data
- (BOOL)measureNSData:(NSData *)data
writeToFile:(NSString *)path
options:(NSDataWritingOptions)writeOptionsMask
origin:(NSString *)origin
error:(NSError **)error
method:(BOOL (^)(NSString *, NSDataWritingOptions, NSError **))method
{
id<SentrySpan> span = [self startTrackingWritingNSData:data filePath:path];
id<SentrySpan> span = [self startTrackingWritingNSData:data filePath:path origin:origin];

Check warning on line 82 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L82

Added line #L82 was not covered by tests

BOOL result = method(path, writeOptionsMask, error);

Expand All @@ -88,9 +90,13 @@ - (BOOL)measureNSData:(NSData *)data
return result;
}

- (NSData *)measureNSDataFromFile:(NSString *)path method:(NSData * (^)(NSString *))method
- (NSData *)measureNSDataFromFile:(NSString *)path
origin:(NSString *)origin
method:(NSData * (^)(NSString *))method
{
id<SentrySpan> span = [self startTrackingReadingFilePath:path];
id<SentrySpan> span = [self startTrackingReadingFilePath:path
origin:origin
operation:SentrySpanOperation.fileRead];

Check warning on line 99 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L97-L99

Added lines #L97 - L99 were not covered by tests

NSData *result = method(path);

Expand All @@ -104,10 +110,13 @@ - (NSData *)measureNSDataFromFile:(NSString *)path method:(NSData * (^)(NSString

- (NSData *)measureNSDataFromFile:(NSString *)path
options:(NSDataReadingOptions)readOptionsMask
origin:(NSString *)origin
error:(NSError **)error
method:(NSData * (^)(NSString *, NSDataReadingOptions, NSError **))method
{
id<SentrySpan> span = [self startTrackingReadingFilePath:path];
id<SentrySpan> span = [self startTrackingReadingFilePath:path
origin:origin
operation:SentrySpanOperation.fileRead];

Check warning on line 119 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L117-L119

Added lines #L117 - L119 were not covered by tests

NSData *result = method(path, readOptionsMask, error);

Expand All @@ -121,6 +130,7 @@ - (NSData *)measureNSDataFromFile:(NSString *)path

- (NSData *)measureNSDataFromURL:(NSURL *)url
options:(NSDataReadingOptions)readOptionsMask
origin:(NSString *)origin
error:(NSError **)error
method:(NSData * (^)(NSURL *, NSDataReadingOptions, NSError **))method
{
Expand All @@ -131,7 +141,9 @@ - (NSData *)measureNSDataFromURL:(NSURL *)url
if (![url.scheme isEqualToString:NSURLFileScheme])
return method(url, readOptionsMask, error);

id<SentrySpan> span = [self startTrackingReadingFilePath:url.path];
id<SentrySpan> span = [self startTrackingReadingFilePath:url.path
origin:origin
operation:SentrySpanOperation.fileRead];

Check warning on line 146 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L144-L146

Added lines #L144 - L146 were not covered by tests

NSData *result = method(url, readOptionsMask, error);

Expand All @@ -146,11 +158,12 @@ - (NSData *)measureNSDataFromURL:(NSURL *)url
- (BOOL)measureNSFileManagerCreateFileAtPath:(NSString *)path
data:(NSData *)data
attributes:(NSDictionary<NSFileAttributeKey, id> *)attributes
origin:(NSString *)origin
method:
(BOOL (^)(NSString *_Nonnull, NSData *_Nonnull,
NSDictionary<NSFileAttributeKey, id> *_Nonnull))method
{
id<SentrySpan> span = [self startTrackingWritingNSData:data filePath:path];
id<SentrySpan> span = [self startTrackingWritingNSData:data filePath:path origin:origin];

Check warning on line 166 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L166

Added line #L166 was not covered by tests

BOOL result = method(path, data, attributes);

Expand All @@ -161,6 +174,7 @@ - (BOOL)measureNSFileManagerCreateFileAtPath:(NSString *)path
}

- (nullable id<SentrySpan>)spanForPath:(NSString *)path
origin:(NSString *)origin
operation:(NSString *)operation
size:(NSUInteger)size
{
Expand All @@ -179,19 +193,18 @@ - (BOOL)measureNSFileManagerCreateFileAtPath:(NSString *)path
ioSpan = [span startChildWithOperation:operation
description:[self transactionDescriptionForFile:path
fileSize:size]];
ioSpan.origin = SentryTraceOrigin.autoNSData;
ioSpan.origin = origin;

Check warning on line 196 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L196

Added line #L196 was not covered by tests
}];

if (ioSpan == nil) {
SENTRY_LOG_DEBUG(@"No transaction bound to scope. Won't track file IO operation.");
return nil;
}

SENTRY_LOG_DEBUG(
@"SentryNSDataTracker automatically started a new span with description: %@, operation: %@",
SENTRY_LOG_DEBUG(@"Automatically started a new span with description: %@, operation: %@",

Check warning on line 204 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L204

Added line #L204 was not covered by tests
ioSpan.description, operation);

[ioSpan setDataValue:path forKey:@"file.path"];
[ioSpan setDataValue:path forKey:SentrySpanKey.filePath];

Check warning on line 207 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L207

Added line #L207 was not covered by tests

[self mainThreadExtraInfo:ioSpan];

Expand Down Expand Up @@ -228,12 +241,19 @@ - (void)mainThreadExtraInfo:(id<SentrySpan>)span
}
}

- (nullable id<SentrySpan>)startTrackingWritingNSData:(NSData *)data filePath:(NSString *)path
- (nullable id<SentrySpan>)startTrackingWritingNSData:(NSData *)data
filePath:(NSString *)path
origin:(NSString *)origin
{
return [self spanForPath:path operation:SentrySpanOperation.fileWrite size:data.length];
return [self spanForPath:path
origin:origin
operation:SentrySpanOperation.fileWrite
size:data.length];

Check warning on line 251 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L248-L251

Added lines #L248 - L251 were not covered by tests
}

- (nullable id<SentrySpan>)startTrackingReadingFilePath:(NSString *)path
origin:(NSString *)origin
operation:(NSString *)operation
{
// Some iOS versions nest constructors calls. This counter help us avoid create more than one
// span for the same operation.
Expand All @@ -245,7 +265,7 @@ - (void)mainThreadExtraInfo:(id<SentrySpan>)span
if (count)
return nil;

return [self spanForPath:path operation:SentrySpanOperation.fileRead size:0];
return [self spanForPath:path origin:origin operation:operation size:0];

Check warning on line 268 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L268

Added line #L268 was not covered by tests
}

- (void)endTrackingFile
Expand All @@ -266,10 +286,11 @@ - (void)endTrackingFile

- (void)finishTrackingNSData:(NSData *)data span:(id<SentrySpan>)span
{
[span setDataValue:[NSNumber numberWithUnsignedInteger:data.length] forKey:@"file.size"];
[span setDataValue:[NSNumber numberWithUnsignedInteger:data.length]
forKey:SentrySpanKey.fileSize];

Check warning on line 290 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L289-L290

Added lines #L289 - L290 were not covered by tests
[span finish];

SENTRY_LOG_DEBUG(@"SentryNSDataTracker automatically finished span %@", span.description);
SENTRY_LOG_DEBUG(@"Automatically finished span %@", span.description);

Check warning on line 293 in Sources/Sentry/SentryFileIOTracker.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryFileIOTracker.m#L293

Added line #L293 was not covered by tests
}

- (BOOL)ignoreFile:(NSString *)path
Expand Down
5 changes: 5 additions & 0 deletions Sources/Sentry/SentryNSDataSwizzling.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ + (void)swizzle
measureNSData:self
writeToFile:path
atomically:useAuxiliaryFile
origin:SentryTraceOrigin.autoNSData

Check warning on line 48 in Sources/Sentry/SentryNSDataSwizzling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryNSDataSwizzling.m#L48

Added line #L48 was not covered by tests
method:^BOOL(NSString *_Nonnull filePath, BOOL isAtomically) {
return SentrySWCallOriginal(filePath, isAtomically);
}];
Expand All @@ -60,6 +61,7 @@ + (void)swizzle
measureNSData:self
writeToFile:path
options:writeOptionsMask
origin:SentryTraceOrigin.autoNSData

Check warning on line 64 in Sources/Sentry/SentryNSDataSwizzling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryNSDataSwizzling.m#L64

Added line #L64 was not covered by tests
error:error
method:^BOOL(
NSString *filePath, NSDataWritingOptions options, NSError **outError) {
Expand All @@ -77,6 +79,7 @@ + (void)swizzle
return [SentryNSDataSwizzling.shared.tracker
measureNSDataFromFile:path
options:options
origin:SentryTraceOrigin.autoNSData

Check warning on line 82 in Sources/Sentry/SentryNSDataSwizzling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryNSDataSwizzling.m#L82

Added line #L82 was not covered by tests
error:error
method:^NSData *(NSString *filePath, NSDataReadingOptions options,
NSError **outError) {
Expand All @@ -91,6 +94,7 @@ + (void)swizzle
SentrySWReturnType(NSData *), SentrySWArguments(NSString * path), SentrySWReplacement({
return [SentryNSDataSwizzling.shared.tracker
measureNSDataFromFile:path
origin:SentryTraceOrigin.autoNSData

Check warning on line 97 in Sources/Sentry/SentryNSDataSwizzling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryNSDataSwizzling.m#L97

Added line #L97 was not covered by tests
method:^NSData *(
NSString *filePath) { return SentrySWCallOriginal(filePath); }];
}),
Expand All @@ -105,6 +109,7 @@ + (void)swizzle
return [SentryNSDataSwizzling.shared.tracker
measureNSDataFromURL:url
options:options
origin:SentryTraceOrigin.autoNSData

Check warning on line 112 in Sources/Sentry/SentryNSDataSwizzling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryNSDataSwizzling.m#L112

Added line #L112 was not covered by tests
error:error
method:^NSData *(NSURL *fileUrl, NSDataReadingOptions options,
NSError **outError) {
Expand Down
1 change: 1 addition & 0 deletions Sources/Sentry/SentryNSFileManagerSwizzling.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ + (void)swizzle
measureNSFileManagerCreateFileAtPath:path
data:data
attributes:attributes
origin:SentryTraceOrigin.autoNSData

Check warning on line 62 in Sources/Sentry/SentryNSFileManagerSwizzling.m

View check run for this annotation

Codecov / codecov/patch

Sources/Sentry/SentryNSFileManagerSwizzling.m#L62

Added line #L62 was not covered by tests
method:^BOOL(NSString *path, NSData *data,
NSDictionary<NSFileAttributeKey, id>
*attributes) {
Expand Down
6 changes: 6 additions & 0 deletions Sources/Sentry/include/SentryFileIOTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SENTRY_NO_INIT
- (BOOL)measureNSData:(NSData *)data
writeToFile:(NSString *)path
atomically:(BOOL)useAuxiliaryFile
origin:(NSString *)origin
method:(BOOL (^)(NSString *, BOOL))method;

/**
Expand All @@ -29,20 +30,23 @@ SENTRY_NO_INIT
- (BOOL)measureNSData:(NSData *)data
writeToFile:(NSString *)path
options:(NSDataWritingOptions)writeOptionsMask
origin:(NSString *)origin
error:(NSError **)error
method:(BOOL (^)(NSString *, NSDataWritingOptions, NSError **))method;

/**
* Measure NSData 'initWithContentsOfFile:' method.
*/
- (nullable NSData *)measureNSDataFromFile:(NSString *)path
origin:(NSString *)origin
method:(NSData *_Nullable (^)(NSString *))method;

/**
* Measure NSData 'initWithContentsOfFile:options:error:' method.
*/
- (nullable NSData *)measureNSDataFromFile:(NSString *)path
options:(NSDataReadingOptions)readOptionsMask
origin:(NSString *)origin
error:(NSError **)error
method:(NSData *_Nullable (^)(
NSString *, NSDataReadingOptions, NSError **))method;
Expand All @@ -52,6 +56,7 @@ SENTRY_NO_INIT
*/
- (nullable NSData *)measureNSDataFromURL:(NSURL *)url
options:(NSDataReadingOptions)readOptionsMask
origin:(NSString *)origin
error:(NSError **)error
method:(NSData *_Nullable (^)(
NSURL *, NSDataReadingOptions, NSError **))method;
Expand All @@ -62,6 +67,7 @@ SENTRY_NO_INIT
- (BOOL)measureNSFileManagerCreateFileAtPath:(NSString *)path
data:(NSData *)data
attributes:(NSDictionary<NSFileAttributeKey, id> *)attributes
origin:(NSString *)origin
method:(BOOL (^)(NSString *, NSData *,
NSDictionary<NSFileAttributeKey, id> *))method;

Expand Down
10 changes: 10 additions & 0 deletions Sources/Swift/Transactions/SentrySpanKey.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Foundation

@objcMembers @objc(SentrySpanKey)
class SentrySpanKey: NSObject {
/// Used to set the number of bytes processed in a file span operation
static let fileSize = "file.size"

/// Used to set the path of the file in a file span operation
static let filePath = "file.path"
}
3 changes: 3 additions & 0 deletions Sources/Swift/Transactions/SentrySpanOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class SentrySpanOperation: NSObject {

static let fileRead = "file.read"
static let fileWrite = "file.write"
static let fileCopy = "file.copy"
static let fileRename = "file.rename"
static let fileDelete = "file.delete"

static let networkRequestOperation = "http.client"

Expand Down
1 change: 1 addition & 0 deletions Sources/Swift/Transactions/SentryTraceOrigin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ class SentryTraceOrigin: NSObject {
static let autoUITimeToDisplay = "auto.ui.time_to_display"
static let autoUIViewController = "auto.ui.view_controller"
static let manual = "manual"
static let manualFileData = "manual.file.data"
static let manualUITimeToDisplay = "manual.ui.time_to_display"
}
12 changes: 12 additions & 0 deletions Tests/SentryTests/Transactions/SentrySpanKeyTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@testable import Sentry
import XCTest

class SentrySpanKeyTests: XCTestCase {
func testFileSize_shouldBeExpectedValue() {
XCTAssertEqual(SentrySpanKey.fileSize, "file.size")
}

func testFilePath_shouldBeExpectedValue() {
XCTAssertEqual(SentrySpanKey.filePath, "file.path")
}
}
12 changes: 12 additions & 0 deletions Tests/SentryTests/Transactions/SentrySpanOperationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ class SentrySpanOperationTests: XCTestCase {
XCTAssertEqual(SentrySpanOperation.fileWrite, "file.write")
}

func testFileCopy_shouldBeExpectedValue() {
XCTAssertEqual(SentrySpanOperation.fileCopy, "file.copy")
}

func testFileRename_shouldBeExpectedValue() {
XCTAssertEqual(SentrySpanOperation.fileRename, "file.rename")
}

func testFileDelete_shouldBeExpectedValue() {
XCTAssertEqual(SentrySpanOperation.fileDelete, "file.delete")
}

func testNetworkRequestOperation_shouldBeExpectedValue() {
XCTAssertEqual(SentrySpanOperation.networkRequestOperation, "http.client")
}
Expand Down
4 changes: 4 additions & 0 deletions Tests/SentryTests/Transactions/SentryTraceOriginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class SentryTraceOriginTestsTests: XCTestCase {
XCTAssertEqual(SentryTraceOrigin.manual, "manual")
}

func testManualFileData_shouldBeExpectedValue() {
XCTAssertEqual(SentryTraceOrigin.manualFileData, "manual.file.data")
}

func testManualUITimeToDisplay_shouldBeExpectedValue() {
XCTAssertEqual(SentryTraceOrigin.manualUITimeToDisplay, "manual.ui.time_to_display")
}
Expand Down

0 comments on commit c5207e7

Please sign in to comment.