From 24a28fcc9e9123b3b39058918f98b64a1938a0a9 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 29 Apr 2018 14:35:43 +0200 Subject: [PATCH] Remove unused func, var, and const (#928) Signed-off-by: Mario Trangoni --- collector/collector.go | 4 ---- collector/cpu_linux.go | 5 ----- collector/textfile.go | 2 -- 3 files changed, 11 deletions(-) diff --git a/collector/collector.go b/collector/collector.go index e9a78f04..f657a66f 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -42,10 +42,6 @@ var ( ) ) -func warnDeprecated(collector string) { - log.Warnf("The %s collector is deprecated and will be removed in the future!", collector) -} - const ( defaultEnabled = true defaultDisabled = false diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index e79d00c3..e2a31228 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go @@ -19,7 +19,6 @@ import ( "fmt" "os" "path/filepath" - "regexp" "strconv" "strings" @@ -28,10 +27,6 @@ import ( "github.com/prometheus/procfs" ) -var ( - digitRegexp = regexp.MustCompile("[0-9]+") -) - type cpuCollector struct { cpu *prometheus.Desc cpuGuest *prometheus.Desc diff --git a/collector/textfile.go b/collector/textfile.go index 03a5e11e..bc2ac43c 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -22,7 +22,6 @@ import ( "path/filepath" "sort" "strings" - "sync" "time" "github.com/prometheus/client_golang/prometheus" @@ -34,7 +33,6 @@ import ( var ( textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("").String() - textFileAddOnce sync.Once mtimeDesc = prometheus.NewDesc( "node_textfile_mtime_seconds", "Unixtime mtime of textfiles successfully read.",