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-11799] Add flush queue and test sampling values #435

Closed gingerbenw closed 7 months ago

gingerbenw commented 7 months ago

Goal

This PR adds a queue to the flush method in the batch processor, ensuring that an existing flush is completed before flushing again. The batch process is now more likely to send a payload with more than the defined batch size, but will always await the initial sampling request before delivering spans.

Testing

Assert on sampling value attributes in end to end tests

github-actions[bot] commented 7 months ago

Browser bundle size

NPM build

Package
Before 183.98 kB
After 184.31 kB
± +332 bytes ⚠️

CDN build

Unminified Minfied Minified + gzipped
Before 92.67 kB 34.77 kB 10.48 kB
After 92.95 kB 34.88 kB 10.50 kB
± +281 bytes ⚠️ +107 bytes ⚠️ +16 bytes ⚠️

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
/home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/core/lib/batch-processor.ts 96.61%
(+1.97%)
94.11%
(+5.88%)
100%
(+0%)
96.61%
(+1.97%)

Total:

Lines Branches Functions Statements
87.66%(+0.08%) 78.78%(+0.16%) 88.16%(+0.02%) 84.29%(+0.08%)

Generated against 346ddec9699e3bd31721632504434a9f7c192813 on 18 April 2024 at 09:36:05 UTC