diff options
-rw-r--r-- | collector/cpu_dragonfly.go | 4 | ||||
-rw-r--r-- | collector/cpu_linux.go | 4 | ||||
-rw-r--r-- | collector/interrupts_openbsd.go | 2 | ||||
-rw-r--r-- | collector/perf_linux.go | 8 |
4 files changed, 9 insertions, 9 deletions
diff --git a/collector/cpu_dragonfly.go b/collector/cpu_dragonfly.go index beef390..4ccb729 100644 --- a/collector/cpu_dragonfly.go +++ b/collector/cpu_dragonfly.go | |||
@@ -17,7 +17,7 @@ package collector | |||
17 | 17 | ||
18 | import ( | 18 | import ( |
19 | "errors" | 19 | "errors" |
20 | "fmt" | 20 | "strconv" |
21 | "unsafe" | 21 | "unsafe" |
22 | 22 | ||
23 | "github.com/go-kit/kit/log" | 23 | "github.com/go-kit/kit/log" |
@@ -131,7 +131,7 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) error { | |||
131 | // Export order: user nice sys intr idle | 131 | // Export order: user nice sys intr idle |
132 | cpuFields := []string{"user", "nice", "sys", "interrupt", "idle"} | 132 | cpuFields := []string{"user", "nice", "sys", "interrupt", "idle"} |
133 | for i, value := range cpuTimes { | 133 | for i, value := range cpuTimes { |
134 | cpux := fmt.Sprintf("%d", i/fieldsCount) | 134 | cpux := strconv.Itoa(i / fieldsCount) |
135 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, value, cpux, cpuFields[i%fieldsCount]) | 135 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, value, cpux, cpuFields[i%fieldsCount]) |
136 | } | 136 | } |
137 | 137 | ||
diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index 1cb6f2c..f5e9ce8 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go | |||
@@ -106,7 +106,7 @@ func (c *cpuCollector) updateInfo(ch chan<- prometheus.Metric) error { | |||
106 | 1, | 106 | 1, |
107 | cpu.PhysicalID, | 107 | cpu.PhysicalID, |
108 | cpu.CoreID, | 108 | cpu.CoreID, |
109 | fmt.Sprintf("%d", cpu.Processor), | 109 | strconv.Itoa(int(cpu.Processor)), |
110 | cpu.VendorID, | 110 | cpu.VendorID, |
111 | cpu.CPUFamily, | 111 | cpu.CPUFamily, |
112 | cpu.Model, | 112 | cpu.Model, |
@@ -202,7 +202,7 @@ func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error { | |||
202 | } | 202 | } |
203 | 203 | ||
204 | for cpuID, cpuStat := range stats.CPU { | 204 | for cpuID, cpuStat := range stats.CPU { |
205 | cpuNum := fmt.Sprintf("%d", cpuID) | 205 | cpuNum := strconv.Itoa(cpuID) |
206 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.User, cpuNum, "user") | 206 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.User, cpuNum, "user") |
207 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Nice, cpuNum, "nice") | 207 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Nice, cpuNum, "nice") |
208 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.System, cpuNum, "system") | 208 | ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.System, cpuNum, "system") |
diff --git a/collector/interrupts_openbsd.go b/collector/interrupts_openbsd.go index 5a61e68..c9aae3c 100644 --- a/collector/interrupts_openbsd.go +++ b/collector/interrupts_openbsd.go | |||
@@ -108,7 +108,7 @@ func (c *interruptsCollector) Update(ch chan<- prometheus.Metric) error { | |||
108 | ch <- c.desc.mustNewConstMetric( | 108 | ch <- c.desc.mustNewConstMetric( |
109 | value, | 109 | value, |
110 | strconv.Itoa(cpuNo), | 110 | strconv.Itoa(cpuNo), |
111 | fmt.Sprintf("%d", interrupt.vector), | 111 | strconv.Itoa(interrupt.vector), |
112 | dev, | 112 | dev, |
113 | ) | 113 | ) |
114 | } | 114 | } |
diff --git a/collector/perf_linux.go b/collector/perf_linux.go index 0e8a3cc..e8a52b4 100644 --- a/collector/perf_linux.go +++ b/collector/perf_linux.go | |||
@@ -14,8 +14,8 @@ | |||
14 | package collector | 14 | package collector |
15 | 15 | ||
16 | import ( | 16 | import ( |
17 | "fmt" | ||
18 | "runtime" | 17 | "runtime" |
18 | "strconv" | ||
19 | 19 | ||
20 | "github.com/go-kit/kit/log" | 20 | "github.com/go-kit/kit/log" |
21 | "github.com/hodgesds/perf-utils" | 21 | "github.com/hodgesds/perf-utils" |
@@ -334,7 +334,7 @@ func (c *perfCollector) Update(ch chan<- prometheus.Metric) error { | |||
334 | 334 | ||
335 | func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error { | 335 | func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error { |
336 | for cpu, profiler := range c.perfHwProfilers { | 336 | for cpu, profiler := range c.perfHwProfilers { |
337 | cpuStr := fmt.Sprintf("%d", cpu) | 337 | cpuStr := strconv.Itoa(cpu) |
338 | hwProfile, err := profiler.Profile() | 338 | hwProfile, err := profiler.Profile() |
339 | if err != nil { | 339 | if err != nil { |
340 | return err | 340 | return err |
@@ -405,7 +405,7 @@ func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error { | |||
405 | 405 | ||
406 | func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error { | 406 | func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error { |
407 | for cpu, profiler := range c.perfSwProfilers { | 407 | for cpu, profiler := range c.perfSwProfilers { |
408 | cpuStr := fmt.Sprintf("%d", cpu) | 408 | cpuStr := strconv.Itoa(cpu) |
409 | swProfile, err := profiler.Profile() | 409 | swProfile, err := profiler.Profile() |
410 | if err != nil { | 410 | if err != nil { |
411 | return err | 411 | return err |
@@ -460,7 +460,7 @@ func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error { | |||
460 | 460 | ||
461 | func (c *perfCollector) updateCacheStats(ch chan<- prometheus.Metric) error { | 461 | func (c *perfCollector) updateCacheStats(ch chan<- prometheus.Metric) error { |
462 | for cpu, profiler := range c.perfCacheProfilers { | 462 | for cpu, profiler := range c.perfCacheProfilers { |
463 | cpuStr := fmt.Sprintf("%d", cpu) | 463 | cpuStr := strconv.Itoa(cpu) |
464 | cacheProfile, err := profiler.Profile() | 464 | cacheProfile, err := profiler.Profile() |
465 | if err != nil { | 465 | if err != nil { |
466 | return err | 466 | return err |