From e500586d8f48b50ed998d2fb9dc1c64aa055777f Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Thu, 24 Mar 2016 19:39:32 -0700 Subject: [PATCH] Disable metrics if interval is less or equal to 0 Signed-off-by: Kenfe-Mickael Laventure --- containerd/main_linux.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/containerd/main_linux.go b/containerd/main_linux.go index 49fc790..4c3aa22 100644 --- a/containerd/main_linux.go +++ b/containerd/main_linux.go @@ -34,8 +34,10 @@ func setAppBefore(app *cli.App) { app.Before = func(context *cli.Context) error { if context.GlobalBool("debug") { logrus.SetLevel(logrus.DebugLevel) - if err := debugMetrics(context.GlobalDuration("metrics-interval"), context.GlobalString("graphite-address")); err != nil { - return err + if context.GlobalDuration("metrics-interval") > 0 { + if err := debugMetrics(context.GlobalDuration("metrics-interval"), context.GlobalString("graphite-address")); err != nil { + return err + } } } if err := checkLimits(); err != nil {