Manually stoping coverband
Closed this issue · 4 comments
Is your feature request related to a problem? Please describe.
I'd like to be able to collect data on production system for a specified period of time. Currently, it's possible to manually start coverband. However, there's no way to manually stop it at least not documented one.
Describe the solution you'd like
Introduce Coverband.stop
method to stop collecting data.
Additional context
I noticed that there's Background.stop
that might be used for this purpose. I haven't done the full research if that's the only thing that has to be done.
interesting idea, and we could implement something to help with this... I will note, the way Ruby's coverage works you can't start after the server is running you need to do it as it does code loading when the server is booting... You can stop collecting but most of the instrumentation hooks still run, so it wouldn't do much in terms of reducing performance overhead or anything like that.
So with that in mind what are you trying to achieve or why would you want not have it running all the time? If you are concerned with overhead, setting a stop ENV var and restarting the servers is the best way to ensure no overhead impacts performance.
Yes, I'm concerned about the overhead. I thought being able to start it manually and collect metrics for an hour or so and then stop it to have a look at the metrics.
I understand now what you mean. You mention the stop ENV is this something that coverband already provides?
yeah, correct... so you would do a configuration change of the environment to toggle the measuring on and off... This is because the performance impact even if you stop collection still exists as the code is instrumented when loaded...
so the workflow for this would be:
- deploy with the env var
COVERBAND_DISABLE_AUTO_START=true
for no coverband no performance impact - deploy with the env var
COVERBAND_DISABLE_AUTO_START
removed entirely, to turn on coverband - deploy with the env var
COVERBAND_DISABLE_AUTO_START=true
to turn back off coverband ensuring no performance impact
Great will try that! Thanks a lot!