hashicorp / go-metrics

A Golang library for exporting performance and runtime metrics to external metrics systems (i.e. statsite, statsd)
MIT License
1.46k stars 177 forks source link

Export emitRuntimeStats to provide a workaround for goroutine leak. #121

Closed ncabatoff closed 3 years ago

ncabatoff commented 3 years ago

When EnableRuntimeMetrics is true, New will leak a goroutine that collects stats periodically. Export the method that does the stats collection so that those who are willing to call it themselves can avoid that goroutine leak.

jefferai commented 3 years ago

Doesn't seem like it's a leak if you've enabled the option :-) But happy to have the change.