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: adjust imposter metrics creation (#1) #729

Merged
merged 1 commit into from Jun 4, 2023

Conversation

deividbatfish2
Copy link
Contributor

@deividbatfish2 deividbatfish2 commented Apr 26, 2023

I use mountebank to run load tests, because of that, I use the imposter metrics to get feedback about the time to generate the responses. After the release 2.8.1 the metrics about imposters stop showing. The reason is, the module imposter.js started to be loaded before the method prometheus.register.clear(); to be called. I created a method to create the metrics inside the function create and an object to control if metrics already created.

fix #718

* refactor: change metric creation to inside of imposters module

* refactor: use object metrics in memory

* refactor: use Boolean class to convert object to boolean

* refactor: adjust eslint appointments

* test: ensure Metrics only return imposter metrics only if a imposter exists

* test: ensure Metrics only return imposter metrics only if a imposter was called

* test: ensure Metrics returns imposter metrics after imposters calls
@bbyars
Copy link
Owner

bbyars commented Jun 4, 2023

Thanks!

@bbyars bbyars merged commit 00a49dc into bbyars:master Jun 4, 2023
2 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.

Mountebank doesn't show imposters metrics
2 participants