bugsnag / bugsnag-js-performance

Monitor the performance of your JavaScript (web and React Native) and see the results in your BugSnag dashboard.
https://docs.bugsnag.com/performance/integration-guides
MIT License
5 stars 3 forks source link

[PLAT-11284] Cancel span on navigate #392

Closed gingerbenw closed 8 months ago

gingerbenw commented 8 months ago

Goal

Ensure that opening a new navigation span will cancel an existing one

Design

Make use of the existing span context features to discard spans with an invalid end time

Testing

Update existing unit tests to assert navigation spans are only created when the route changes Add new unit test to assert open navigation span is ended with an invalid time

github-actions[bot] commented 8 months ago

Browser bundle size

NPM build

Package
Before 177.95 kB
After 178.19 kB
± +236 bytes ⚠️

CDN build

Unminified Minfied Minified + gzipped
Before 85.60 kB 32.28 kB 9.89 kB
After 85.73 kB 32.30 kB 9.90 kB
± +123 bytes ⚠️ +17 bytes ⚠️ +6 bytes ⚠️

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/core/lib/span-factory.ts 100%
(+0%)
96.66%
(-3.34%)
100%
(+0%)
98.57%
(-1.43%)
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/browser/lib/id-generator.ts 88.88%
(-11.12%)
0%
(-100%)
100%
(+0%)
88.88%
(-11.12%)
🔴 ✨ /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/react-navigation/test/utils/react-native-platform-extensions.ts 0%
(+0%)
100%
(+100%)
0%
(+0%)
0%
(+0%)

Total:

Lines Branches Functions Statements
91.08%(-0.92%) 80.22%(-0.34%) 91.66%(-1.17%) 88.51%(-1.56%)

Generated against 9c7ba8dba53d8df39f59feb2277ca3bc5881ce97 on 15 January 2024 at 12:21:40 UTC