aboutsummaryrefslogtreecommitdiff
path: root/collector/hwmon_linux.go
diff options
context:
space:
mode:
authorJohannes 'fish' Ziemke <github@freigeist.org>2017-01-03 14:41:05 +0100
committerJohannes 'fish' Ziemke <github@freigeist.org>2017-01-03 14:41:05 +0100
commit26c6182c8452b6a5990586e744695a1b5bc5fc54 (patch)
tree6260097f6ebf26dfd47c178f844ce01106763277 /collector/hwmon_linux.go
parentb68a9ec7afeea025bbfea8c6f2e4c3bff0b6966f (diff)
downloadprometheus_node_collector-26c6182c8452b6a5990586e744695a1b5bc5fc54.tar.bz2
prometheus_node_collector-26c6182c8452b6a5990586e744695a1b5bc5fc54.tar.xz
prometheus_node_collector-26c6182c8452b6a5990586e744695a1b5bc5fc54.zip
Move comment and remove superfluous newline
Diffstat (limited to 'collector/hwmon_linux.go')
-rw-r--r--collector/hwmon_linux.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/collector/hwmon_linux.go b/collector/hwmon_linux.go
index ef4b727..51bcb74 100644
--- a/collector/hwmon_linux.go
+++ b/collector/hwmon_linux.go
@@ -145,7 +145,6 @@ func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) (e
145 } 145 }
146 146
147 hwmonChipName, err := c.hwmonHumanReadableChipName(dir) 147 hwmonChipName, err := c.hwmonHumanReadableChipName(dir)
148
149 if err == nil { 148 if err == nil {
150 // sensor chip metadata 149 // sensor chip metadata
151 desc := prometheus.NewDesc( 150 desc := prometheus.NewDesc(
@@ -372,12 +371,9 @@ func (c *hwMonCollector) hwmonName(dir string) (string, error) {
372 return "", errors.New("Could not derive a monitoring name for " + dir) 371 return "", errors.New("Could not derive a monitoring name for " + dir)
373} 372}
374 373
374// hwmonHumanReadableChipName is similar to the methods in hwmonName, but with
375// different precedences -- we can allow duplicates here.
375func (c *hwMonCollector) hwmonHumanReadableChipName(dir string) (string, error) { 376func (c *hwMonCollector) hwmonHumanReadableChipName(dir string) (string, error) {
376 // this is similar to the methods in hwmonName, but with different
377 // precedences -- we can allow duplicates here.
378
379 // preference 1: is there a name file
380
381 sysnameRaw, nameErr := ioutil.ReadFile(path.Join(dir, "name")) 377 sysnameRaw, nameErr := ioutil.ReadFile(path.Join(dir, "name"))
382 if nameErr != nil { 378 if nameErr != nil {
383 return "", nameErr 379 return "", nameErr