Use gague for go routines
This commit is contained in:
parent
1005dfb224
commit
e81513349f
1 changed files with 2 additions and 2 deletions
|
@ -34,11 +34,11 @@ var DaemonCommand = cli.Command{
|
||||||
Action: func(context *cli.Context) {
|
Action: func(context *cli.Context) {
|
||||||
if context.GlobalBool("debug") {
|
if context.GlobalBool("debug") {
|
||||||
l := log.New(os.Stdout, "[containerd] ", log.LstdFlags)
|
l := log.New(os.Stdout, "[containerd] ", log.LstdFlags)
|
||||||
goRoutineCounter := metrics.NewMeter()
|
goRoutineCounter := metrics.NewGauge()
|
||||||
metrics.DefaultRegistry.Register("goroutines", goRoutineCounter)
|
metrics.DefaultRegistry.Register("goroutines", goRoutineCounter)
|
||||||
go func() {
|
go func() {
|
||||||
for range time.Tick(30 * time.Second) {
|
for range time.Tick(30 * time.Second) {
|
||||||
goRoutineCounter.Mark(int64(runtime.NumGoroutine()))
|
goRoutineCounter.Update(int64(runtime.NumGoroutine()))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
go metrics.Log(metrics.DefaultRegistry, 60*time.Second, l)
|
go metrics.Log(metrics.DefaultRegistry, 60*time.Second, l)
|
||||||
|
|
Loading…
Reference in a new issue