Use strconv.Itoa() instead of fmt.Sprintf() (#1566)
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
This commit is contained in:
parent
6ad94ae4bc
commit
cfcaeee145
4 changed files with 9 additions and 9 deletions
|
|
@ -106,7 +106,7 @@ func (c *cpuCollector) updateInfo(ch chan<- prometheus.Metric) error {
|
|||
1,
|
||||
cpu.PhysicalID,
|
||||
cpu.CoreID,
|
||||
fmt.Sprintf("%d", cpu.Processor),
|
||||
strconv.Itoa(int(cpu.Processor)),
|
||||
cpu.VendorID,
|
||||
cpu.CPUFamily,
|
||||
cpu.Model,
|
||||
|
|
@ -202,7 +202,7 @@ func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error {
|
|||
}
|
||||
|
||||
for cpuID, cpuStat := range stats.CPU {
|
||||
cpuNum := fmt.Sprintf("%d", cpuID)
|
||||
cpuNum := strconv.Itoa(cpuID)
|
||||
ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.User, cpuNum, "user")
|
||||
ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Nice, cpuNum, "nice")
|
||||
ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.System, cpuNum, "system")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue