prom-client
prom-client copied to clipboard
add the ability to stop the event loop
Fixes https://github.com/siimon/prom-client/issues/494
Adds an optional "stop" function which when called will ultimately disable the histogram which will allow the node process to exit.
I also fixed a bug in the tests where a failed assertion in a setTimeout wasn't properly rejecting the test promise.

I also fixed a bug in the tests where a failed assertion in a setTimeout wasn't properly rejecting the test promise.
Since we're waiting for node to respond, maybe that could be pulled into a separate PR so we can land it? 🙂
Merged with the other PR that broke out the change to the tests.
Also, you probably don't need to wait for the node "unref" response since, even if they agree and add it, you'll still probably want a way to stop this as its reasonable to want to stop it without stopping the process. Also, if they do accept it it will likely go into node 17, in which case I'll have to wait for node 18 (lts) which could be years frankly.