Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-11294] View load spanfix for firstClass and set current context #369

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog

### Bug fixes

* View load spans are now not first class by default, and don't set the current context.
[369](https://github.com/bugsnag/bugsnag-cocoa-performance/pull/369)

* Improved Swift mangled name handling when reporting view spans.
[344](https://github.com/bugsnag/bugsnag-cocoa-performance/pull/344)

Expand Down
4 changes: 3 additions & 1 deletion Sources/BugsnagPerformance/Private/Tracer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@
Tracer::startViewLoadSpan(BugsnagPerformanceViewType viewType,
NSString *className,
SpanOptions options) noexcept {
// Always override this on a view load span
options.makeCurrentContext = false;
NSString *type = getBugsnagPerformanceViewTypeName(viewType);
onViewLoadSpanStarted_(className);
NSString *name = [NSString stringWithFormat:@"[ViewLoad/%@]/%@", type, className];
Expand All @@ -259,7 +261,7 @@
options.firstClass = BSGFirstClassNo;
}
}
auto span = startSpan(name, options, BSGFirstClassYes);
auto span = startSpan(name, options, BSGFirstClassNo);
if (willDiscardPrewarmSpans_) {
markPrewarmSpan(span);
}
Expand Down
4 changes: 2 additions & 2 deletions features/default/manual_spans.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Feature: Manual creation of spans
* a span field "name" equals "[ViewLoad/SwiftUI]/ManualView"
* a span string attribute "bugsnag.view.name" equals "ManualView"
* a span string attribute "bugsnag.view.type" equals "SwiftUI"
* every span bool attribute "bugsnag.span.first_class" is true
* every span bool attribute "bugsnag.span.first_class" is false
* every span field "kind" equals 1
* every span field "startTimeUnixNano" matches the regex "^[0-9]+$"
* every span field "endTimeUnixNano" matches the regex "^[0-9]+$"
Expand Down Expand Up @@ -116,7 +116,7 @@ Feature: Manual creation of spans
* every span field "startTimeUnixNano" matches the regex "^[0-9]+$"
* every span field "endTimeUnixNano" matches the regex "^[0-9]+$"
* every span string attribute "bugsnag.span.category" equals "view_load"
* every span bool attribute "bugsnag.span.first_class" is true
* every span bool attribute "bugsnag.span.first_class" is false

Scenario: Manually start a network span
Given I run "ManualNetworkSpanScenario"
Expand Down
Loading