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

feat: add option to disable stats snapshots #799

Merged
merged 3 commits into from
Jul 31, 2023
Merged

feat: add option to disable stats snapshots #799

merged 3 commits into from
Jul 31, 2023

Conversation

gjethwani
Copy link
Contributor

Hello! I had a small feature request

Motivation

As I understand it, every bucket_interval (1s by default), opossum emits a snapshot of the stats in the Status class

this[SNAPSHOT_INTERVAL] = setInterval(_ => this.emit('snapshot', this.stats), bucketInterval);
My app doesn't actually listen to these stats and the extra call to setInterval clogs up the memory

Solution

Could we have a configurable option to disable the stats snapshots, thereby removing the extra call to setInterval?

Issue here: #798

Gautam Jethwani added 2 commits July 30, 2023 04:02
Add option to disable snapshots as an optimization
Add a missing semicolon
@gjethwani
Copy link
Contributor Author

Corresponding PR in DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#66220

@coveralls
Copy link

coveralls commented Jul 31, 2023

Pull Request Test Coverage Report for Build 5718902301

  • 9 of 9 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 98.258%

Totals Coverage Status
Change from base Build 5577235603: 0.03%
Covered Lines: 358
Relevant Lines: 359

💛 - Coveralls

Copy link
Member

@lholmquist lholmquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good. can you please add a test for this

@gjethwani
Copy link
Contributor Author

Thanks @lholmquist , just added some tests. Could you please give it a re-review?

@gjethwani
Copy link
Contributor Author

Also, would you like me to take care of the PR in DefinitelyTyped or is that something you would do when you release a new version?

Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thank you for the contribution!

@lance lance merged commit a9c5935 into nodeshift:main Jul 31, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants