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

fix: only start timers if they are enabled via configuration option #97

Merged
merged 7 commits into from
Nov 28, 2023

Conversation

Neriuzz
Copy link
Contributor

@Neriuzz Neriuzz commented Nov 28, 2023

Hey again,

My last PR seems like it might have a nasty memory leak, as the summary and histogram timers would get started on every request even if they have been disabled via the configuration option.

This PR fixes that issue by only initialising the timers if the relevant histogram/summary collection has been enabled.

@Neriuzz Neriuzz requested a review from SkeLLLa as a code owner November 28, 2023 15:29
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c0cb240) 99.39% compared to head (0057ce7) 98.82%.
Report is 1 commits behind head on master.

Files Patch % Lines
src/fastify-metrics.ts 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   99.39%   98.82%   -0.58%     
==========================================
  Files           2        2              
  Lines         165      170       +5     
  Branches       64       70       +6     
==========================================
+ Hits          164      168       +4     
  Misses          1        1              
- Partials        0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SkeLLLa SkeLLLa merged commit 6f0b8e2 into SkeLLLa:master Nov 28, 2023
5 of 7 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 28, 2023
## [10.4.1](v10.4.0...v10.4.1) (2023-11-28)

### 🛠 Fixes

* only start timers if they are enabled via configuration option ([#97](#97)) ([6f0b8e2](6f0b8e2))
* rebuild ([a4fc811](a4fc811))
* rebuild ([82706e7](82706e7))
* remove old badges ([0730c2a](0730c2a))

### 🧾 Other

* **deps-dev:** bump @babel/traverse from 7.19.4 to 7.23.2 ([#91](#91)) ([b069b47](b069b47))
Copy link
Contributor

🎉 This PR is included in version 10.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants