mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-01-20 07:19:01 +01:00
restruct code
Signed-off-by: Xuhui Zhu <simon.zhu@canonical.com>
This commit is contained in:
parent
6f3c345632
commit
89a21a9c4c
@ -360,7 +360,7 @@ func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) er
|
||||
if sensorType == "freq" && element == "input" {
|
||||
if label, ok := sensorData["label"]; ok {
|
||||
sensorLabel := cleanMetricName(label)
|
||||
desc := prometheus.NewDesc("node_hwmon_freq_hertz", "Hardware monitor for GPU frequency in MHz", hwmonLabelDesc, nil)
|
||||
desc := prometheus.NewDesc(name+"_freq_mhz", "Hardware monitor for GPU frequency in MHz", hwmonLabelDesc, nil)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
desc, prometheus.GaugeValue, parsedValue/1000000.0, append(labels[:len(labels)-1], sensorLabel)...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user