mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 13:40:05 +00:00
23 lines
518 B
Go
23 lines
518 B
Go
// Go port of Coda Hale's Metrics library
|
|
//
|
|
// <https://github.com/rcrowley/go-metrics>
|
|
//
|
|
// Coda Hale's original work: <https://github.com/codahale/metrics>
|
|
package metrics
|
|
|
|
import (
|
|
"runtime/metrics"
|
|
"sync/atomic"
|
|
)
|
|
|
|
// callbacks - storing list of callbacks as type []func()
|
|
// use metrics.AddCallback to add your function to metrics collection loop (to avoid multiple goroutines collecting metrics)
|
|
var callbacks atomic.Value
|
|
|
|
func init() {
|
|
metrics.All()
|
|
callbacks.Store([]func(){})
|
|
}
|
|
|
|
// Calling Load method
|