diff options
author | Mario Trangoni <mario@mariotrangoni.de> | 2018-04-29 14:34:47 +0200 |
---|---|---|
committer | Johannes 'fish' Ziemke <github@freigeist.org> | 2018-04-29 14:34:47 +0200 |
commit | c9f421d0dd8699396b3fd94dc6e595475d28ad1e (patch) | |
tree | adb617ab040aedadc866056c205fc77356a30edb | |
parent | 7073dcdcb58de2697ee806da49d8a3297ee66184 (diff) | |
download | prometheus_node_collector-c9f421d0dd8699396b3fd94dc6e595475d28ad1e.tar.bz2 prometheus_node_collector-c9f421d0dd8699396b3fd94dc6e595475d28ad1e.tar.xz prometheus_node_collector-c9f421d0dd8699396b3fd94dc6e595475d28ad1e.zip |
Fix some golint issues (#927)
* collector/cpu_*: rename nodeCpuSecondsDesc to nodeCPUSecondsDesc
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* collector/qdisc_linux.go: add NewQdiscStatCollector comment
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* collector/cpu_linux.go: rename core_map to coreMap
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
-rw-r--r-- | collector/cpu_common.go | 2 | ||||
-rw-r--r-- | collector/cpu_darwin.go | 2 | ||||
-rw-r--r-- | collector/cpu_dragonfly.go | 2 | ||||
-rw-r--r-- | collector/cpu_freebsd.go | 2 | ||||
-rw-r--r-- | collector/cpu_linux.go | 6 | ||||
-rw-r--r-- | collector/cpu_openbsd.go | 2 | ||||
-rw-r--r-- | collector/qdisc_linux.go | 1 |
7 files changed, 9 insertions, 8 deletions
diff --git a/collector/cpu_common.go b/collector/cpu_common.go index 6a540f4..1a78607 100644 --- a/collector/cpu_common.go +++ b/collector/cpu_common.go | |||
@@ -24,7 +24,7 @@ const ( | |||
24 | ) | 24 | ) |
25 | 25 | ||
26 | var ( | 26 | var ( |
27 | nodeCpuSecondsDesc = prometheus.NewDesc( | 27 | nodeCPUSecondsDesc = prometheus.NewDesc( |
28 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "seconds_total"), | 28 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "seconds_total"), |
29 | "Seconds the cpus spent in each mode.", | 29 | "Seconds the cpus spent in each mode.", |
30 | []string{"cpu", "mode"}, nil, | 30 | []string{"cpu", "mode"}, nil, |
diff --git a/collector/cpu_darwin.go b/collector/cpu_darwin.go index caa59f8..74afafd 100644 --- a/collector/cpu_darwin.go +++ b/collector/cpu_darwin.go | |||
@@ -59,7 +59,7 @@ func init() { | |||
59 | // NewCPUCollector returns a new Collector exposing CPU stats. | 59 | // NewCPUCollector returns a new Collector exposing CPU stats. |
60 | func NewCPUCollector() (Collector, error) { | 60 | func NewCPUCollector() (Collector, error) { |
61 | return &statCollector{ | 61 | return &statCollector{ |
62 | cpu: nodeCpuSecondsDesc, | 62 | cpu: nodeCPUSecondsDesc, |
63 | }, nil | 63 | }, nil |
64 | } | 64 | } |
65 | 65 | ||
diff --git a/collector/cpu_dragonfly.go b/collector/cpu_dragonfly.go index 76ae33b..eb7f8f8 100644 --- a/collector/cpu_dragonfly.go +++ b/collector/cpu_dragonfly.go | |||
@@ -94,7 +94,7 @@ func init() { | |||
94 | // NewStatCollector returns a new Collector exposing CPU stats. | 94 | // NewStatCollector returns a new Collector exposing CPU stats. |
95 | func NewStatCollector() (Collector, error) { | 95 | func NewStatCollector() (Collector, error) { |
96 | return &statCollector{ | 96 | return &statCollector{ |
97 | cpu: nodeCpuSecondsDesc, | 97 | cpu: nodeCPUSecondsDesc, |
98 | }, nil | 98 | }, nil |
99 | } | 99 | } |
100 | 100 | ||
diff --git a/collector/cpu_freebsd.go b/collector/cpu_freebsd.go index e99174a..e8d2fb9 100644 --- a/collector/cpu_freebsd.go +++ b/collector/cpu_freebsd.go | |||
@@ -92,7 +92,7 @@ func init() { | |||
92 | // NewStatCollector returns a new Collector exposing CPU stats. | 92 | // NewStatCollector returns a new Collector exposing CPU stats. |
93 | func NewStatCollector() (Collector, error) { | 93 | func NewStatCollector() (Collector, error) { |
94 | return &statCollector{ | 94 | return &statCollector{ |
95 | cpu: typedDesc{nodeCpuSecondsDesc, prometheus.CounterValue}, | 95 | cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, |
96 | temp: typedDesc{prometheus.NewDesc( | 96 | temp: typedDesc{prometheus.NewDesc( |
97 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "temperature_celsius"), | 97 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "temperature_celsius"), |
98 | "CPU temperature", | 98 | "CPU temperature", |
diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index f935456..e79d00c 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go | |||
@@ -49,7 +49,7 @@ func init() { | |||
49 | // NewCPUCollector returns a new Collector exposing kernel/system statistics. | 49 | // NewCPUCollector returns a new Collector exposing kernel/system statistics. |
50 | func NewCPUCollector() (Collector, error) { | 50 | func NewCPUCollector() (Collector, error) { |
51 | return &cpuCollector{ | 51 | return &cpuCollector{ |
52 | cpu: nodeCpuSecondsDesc, | 52 | cpu: nodeCPUSecondsDesc, |
53 | cpuGuest: prometheus.NewDesc( | 53 | cpuGuest: prometheus.NewDesc( |
54 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "guest_seconds_total"), | 54 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "guest_seconds_total"), |
55 | "Seconds the cpus spent in guests (VMs) for each mode.", | 55 | "Seconds the cpus spent in guests (VMs) for each mode.", |
@@ -185,8 +185,8 @@ func (c *cpuCollector) updateCPUfreq(ch chan<- prometheus.Metric) error { | |||
185 | strconv.FormatUint(physicalPackageID, 10)) | 185 | strconv.FormatUint(physicalPackageID, 10)) |
186 | } | 186 | } |
187 | 187 | ||
188 | for physicalPackageID, core_map := range packageCoreThrottles { | 188 | for physicalPackageID, coreMap := range packageCoreThrottles { |
189 | for coreID, coreThrottleCount := range core_map { | 189 | for coreID, coreThrottleCount := range coreMap { |
190 | ch <- prometheus.MustNewConstMetric(c.cpuCoreThrottle, | 190 | ch <- prometheus.MustNewConstMetric(c.cpuCoreThrottle, |
191 | prometheus.CounterValue, | 191 | prometheus.CounterValue, |
192 | float64(coreThrottleCount), | 192 | float64(coreThrottleCount), |
diff --git a/collector/cpu_openbsd.go b/collector/cpu_openbsd.go index 0b05d55..e9b102f 100644 --- a/collector/cpu_openbsd.go +++ b/collector/cpu_openbsd.go | |||
@@ -39,7 +39,7 @@ func init() { | |||
39 | 39 | ||
40 | func NewCpuCollector() (Collector, error) { | 40 | func NewCpuCollector() (Collector, error) { |
41 | return &cpuCollector{ | 41 | return &cpuCollector{ |
42 | cpu: typedDesc{nodeCpuSecondsDesc, prometheus.CounterValue}, | 42 | cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, |
43 | }, nil | 43 | }, nil |
44 | } | 44 | } |
45 | 45 | ||
diff --git a/collector/qdisc_linux.go b/collector/qdisc_linux.go index d96e7bd..74757b3 100644 --- a/collector/qdisc_linux.go +++ b/collector/qdisc_linux.go | |||
@@ -41,6 +41,7 @@ func init() { | |||
41 | registerCollector("qdisc", defaultDisabled, NewQdiscStatCollector) | 41 | registerCollector("qdisc", defaultDisabled, NewQdiscStatCollector) |
42 | } | 42 | } |
43 | 43 | ||
44 | // NewQdiscStatCollector returns a new Collector exposing queuing discipline statistics. | ||
44 | func NewQdiscStatCollector() (Collector, error) { | 45 | func NewQdiscStatCollector() (Collector, error) { |
45 | return &qdiscStatCollector{ | 46 | return &qdiscStatCollector{ |
46 | bytes: typedDesc{prometheus.NewDesc( | 47 | bytes: typedDesc{prometheus.NewDesc( |