Skip to content

Commit

Permalink
ref: Remove SentryPerformanceTracker+Private.h (#2897)
Browse files Browse the repository at this point in the history
There is not need for a SentryPerformanceTracker+Private.h as SentryPerformanceTracker.h
is internal anyways.
  • Loading branch information
philipphofmann authored Apr 14, 2023
1 parent f8c8a0a commit 3b782cc
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 63 deletions.
4 changes: 0 additions & 4 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
0A2D8D9828997887008720F6 /* NSLocale+Sentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A2D8D9728997887008720F6 /* NSLocale+Sentry.h */; };
0A2D8DA8289BC905008720F6 /* SentryViewHierarchy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A2D8DA6289BC905008720F6 /* SentryViewHierarchy.h */; };
0A2D8DA9289BC905008720F6 /* SentryViewHierarchy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A2D8DA7289BC905008720F6 /* SentryViewHierarchy.m */; };
0A4EDEA928D3461B00FA67CB /* SentryPerformanceTracker+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4EDEA828D3461B00FA67CB /* SentryPerformanceTracker+Private.h */; };
0A5370A128A3EC2400B2DCDE /* SentryViewHierarchyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A5370A028A3EC2400B2DCDE /* SentryViewHierarchyTests.swift */; };
0A56DA5F28ABA01B00C400D5 /* SentryTransactionContext+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A56DA5E28ABA01B00C400D5 /* SentryTransactionContext+Private.h */; };
0A6EEADD28A657970076B469 /* UIViewRecursiveDescriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A6EEADC28A657970076B469 /* UIViewRecursiveDescriptionTests.swift */; };
Expand Down Expand Up @@ -889,7 +888,6 @@
0A2D8D9728997887008720F6 /* NSLocale+Sentry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSLocale+Sentry.h"; path = "include/NSLocale+Sentry.h"; sourceTree = "<group>"; };
0A2D8DA6289BC905008720F6 /* SentryViewHierarchy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryViewHierarchy.h; path = include/SentryViewHierarchy.h; sourceTree = "<group>"; };
0A2D8DA7289BC905008720F6 /* SentryViewHierarchy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryViewHierarchy.m; sourceTree = "<group>"; };
0A4EDEA828D3461B00FA67CB /* SentryPerformanceTracker+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryPerformanceTracker+Private.h"; path = "include/SentryPerformanceTracker+Private.h"; sourceTree = "<group>"; };
0A5370A028A3EC2400B2DCDE /* SentryViewHierarchyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyTests.swift; sourceTree = "<group>"; };
0A56DA5E28ABA01B00C400D5 /* SentryTransactionContext+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryTransactionContext+Private.h"; path = "include/SentryTransactionContext+Private.h"; sourceTree = "<group>"; };
0A6EEADC28A657970076B469 /* UIViewRecursiveDescriptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewRecursiveDescriptionTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2834,7 +2832,6 @@
8EAE9804261E87120073B6B3 /* SentryUIViewControllerPerformanceTracker.m */,
8EAE9809261E9F530073B6B3 /* SentryPerformanceTracker.h */,
8EBF870726140D37001A6853 /* SentryPerformanceTracker.m */,
0A4EDEA828D3461B00FA67CB /* SentryPerformanceTracker+Private.h */,
D8BFE37029A3782F002E73F3 /* SentryTimeToDisplayTracker.h */,
D8BFE37129A3782F002E73F3 /* SentryTimeToDisplayTracker.m */,
);
Expand Down Expand Up @@ -3380,7 +3377,6 @@
63AA76991EB9C1C200D153DE /* SentryDefines.h in Headers */,
D86B6835294348A400B8B1FC /* SentryAttachment+Private.h in Headers */,
84AF45A629A7FFA500FBB177 /* SentryTracerConcurrency.h in Headers */,
0A4EDEA928D3461B00FA67CB /* SentryPerformanceTracker+Private.h in Headers */,
7B2A70DB27D607CF008B0D15 /* SentryThreadWrapper.h in Headers */,
8EAE980B261E9F530073B6B3 /* SentryPerformanceTracker.h in Headers */,
63FE718520DA4C1100CDBAE8 /* SentryCrashC.h in Headers */,
Expand Down
29 changes: 0 additions & 29 deletions Sources/Sentry/SentryPerformanceTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ - (instancetype)init
return self;
}

- (SentrySpanId *)startSpanWithName:(NSString *)name operation:(NSString *)operation
{
return [self startSpanWithName:name
nameSource:kSentryTransactionNameSourceCustom
operation:operation];
}

- (SentrySpanId *)startSpanWithName:(NSString *)name
nameSource:(SentryTransactionNameSource)source
operation:(NSString *)operation
Expand Down Expand Up @@ -107,16 +100,6 @@ - (SentrySpanId *)startSpanWithName:(NSString *)name
return spanId;
}

- (void)measureSpanWithDescription:(NSString *)description
operation:(NSString *)operation
inBlock:(void (^)(void))block
{
[self measureSpanWithDescription:description
nameSource:kSentryTransactionNameSourceCustom
operation:operation
inBlock:block];
}

- (void)measureSpanWithDescription:(NSString *)description
nameSource:(SentryTransactionNameSource)source
operation:(NSString *)operation
Expand All @@ -133,18 +116,6 @@ - (void)measureSpanWithDescription:(NSString *)description
[self finishSpan:spanId];
}

- (void)measureSpanWithDescription:(NSString *)description
operation:(NSString *)operation
parentSpanId:(SentrySpanId *)parentSpanId
inBlock:(void (^)(void))block
{
[self measureSpanWithDescription:description
nameSource:kSentryTransactionNameSourceCustom
operation:operation
parentSpanId:parentSpanId
inBlock:block];
}

- (void)measureSpanWithDescription:(NSString *)description
nameSource:(SentryTransactionNameSource)source
operation:(NSString *)operation
Expand Down
1 change: 0 additions & 1 deletion Sources/Sentry/SentryUIViewControllerPerformanceTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#import "SentryFramesTracker.h"
#import "SentryHub.h"
#import "SentryLog.h"
#import "SentryPerformanceTracker+Private.h"
#import "SentryPerformanceTracker.h"
#import "SentrySDK+Private.h"
#import "SentryScope.h"
Expand Down
21 changes: 0 additions & 21 deletions Sources/Sentry/include/SentryPerformanceTracker+Private.h

This file was deleted.

9 changes: 8 additions & 1 deletion Sources/Sentry/include/SentryPerformanceTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ NS_ASSUME_NONNULL_BEGIN
* Starts a new span if no span is active, then bind it to the scope if no span is bound.
* @note If there's an active span, starts a child of the active span.
* @param name Span name.
* @param source the transaction name source.
* @param operation Span operation.
* @return The span id.
*/
- (SentrySpanId *)startSpanWithName:(NSString *)name operation:(NSString *)operation;
- (SentrySpanId *)startSpanWithName:(NSString *)name
nameSource:(SentryTransactionNameSource)source
operation:(NSString *)operation;

/**
* Activate the span with @c spanId to create any call to @c startSpan as a child.
Expand All @@ -37,22 +40,26 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Measure the given @c block execution.
* @param description The description of the span.
* @param source the transaction name source.
* @param operation Span operation.
* @param block Block to be measured.
*/
- (void)measureSpanWithDescription:(NSString *)description
nameSource:(SentryTransactionNameSource)source
operation:(NSString *)operation
inBlock:(void (^)(void))block;

/**
* Measure the given @c block execution adding it as a child of given parent span.
* @note If @c parentSpanId does not exist this measurement is not performed.
* @param description The description of the span.
* @param source the transaction name source.
* @param operation Span operation.
* @param parentSpanId Id of the span to use as parent.
* @param block Block to be measured.
*/
- (void)measureSpanWithDescription:(NSString *)description
nameSource:(SentryTransactionNameSource)source
operation:(NSString *)operation
parentSpanId:(SentrySpanId *)parentSpanId
inBlock:(void (^)(void))block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class SentryPerformanceTrackerTests: XCTestCase {

let expect = expectation(description: "Callback Expectation")

sut.measureSpan(withDescription: fixture.someTransaction, operation: fixture.someOperation) {
sut.measureSpan(withDescription: fixture.someTransaction, nameSource: .custom, operation: fixture.someOperation) {
let spanId = sut.activeSpanId()!

span = sut.getSpan(spanId)
Expand All @@ -175,7 +175,7 @@ class SentryPerformanceTrackerTests: XCTestCase {

let expect = expectation(description: "Callback Expectation")

sut.measureSpan(withDescription: fixture.someTransaction, operation: fixture.someOperation, parentSpanId: SpanId()) {
sut.measureSpan(withDescription: fixture.someTransaction, nameSource: .custom, operation: fixture.someOperation, parentSpanId: SpanId()) {
expect.fulfill()
}

Expand All @@ -186,7 +186,7 @@ class SentryPerformanceTrackerTests: XCTestCase {
func testNotSampled() {
fixture.client.options.tracesSampleRate = 0
let sut = fixture.getSut()
let spanId = sut.startSpan(withName: fixture.someTransaction, operation: fixture.someOperation)
let spanId = sut.startSpan(withName: fixture.someTransaction, nameSource: .custom, operation: fixture.someOperation)
let span = sut.getSpan(spanId)

XCTAssertEqual(span!.sampled, .no)
Expand All @@ -195,7 +195,7 @@ class SentryPerformanceTrackerTests: XCTestCase {
func testSampled() {
fixture.client.options.tracesSampleRate = 1
let sut = fixture.getSut()
let spanId = sut.startSpan(withName: fixture.someTransaction, operation: fixture.someOperation)
let spanId = sut.startSpan(withName: fixture.someTransaction, nameSource: .custom, operation: fixture.someOperation)
let span = sut.getSpan(spanId)

XCTAssertEqual(span!.sampled, .yes)
Expand Down Expand Up @@ -273,7 +273,7 @@ class SentryPerformanceTrackerTests: XCTestCase {
let activeSpans = Dynamic(sut).activeSpanStack as NSMutableArray?
activeSpans?.add(TestSentrySpan())

let spanId = sut.startSpan(withName: fixture.someTransaction, operation: fixture.someOperation)
let spanId = sut.startSpan(withName: fixture.someTransaction, nameSource: .custom, operation: fixture.someOperation)

XCTAssertEqual(spanId, SpanId.empty)
}
Expand Down Expand Up @@ -342,7 +342,7 @@ class SentryPerformanceTrackerTests: XCTestCase {
}

private func startSpan(tracker: SentryPerformanceTracker) -> SpanId {
return tracker.startSpan(withName: fixture.someTransaction, operation: fixture.someOperation)
return tracker.startSpan(withName: fixture.someTransaction, nameSource: .custom, operation: fixture.someOperation)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class SentryUIViewControllerPerformanceTrackerTests: XCTestCase {
sut.viewControllerLoadView(viewController) {
transactionSpan = self.getStack(tracker).first
lastSpan = self.getStack(tracker).last
customSpanId = tracker.startSpan(withName: self.spanName, operation: self.spanOperation)
customSpanId = tracker.startSpan(withName: self.spanName, nameSource: .custom, operation: self.spanOperation)
}
let unwrappedLastSpan = try XCTUnwrap(lastSpan)
XCTAssertTrue(unwrappedLastSpan.isFinished)
Expand Down

0 comments on commit 3b782cc

Please sign in to comment.