From 56bf8d4b2dab448fb56b387966ec4e0739701111 Mon Sep 17 00:00:00 2001 From: Rene Treffer Date: Tue, 27 Jun 2017 11:25:06 +0200 Subject: [PATCH] Add link to kernel documentation for sysfs/cpufreq files --- collector/cpu_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index 01255d7c..ebf47c72 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go @@ -104,7 +104,8 @@ func (c *cpuCollector) updateCPUfreq(ch chan<- prometheus.Metric) error { if _, err := os.Stat(filepath.Join(cpu, "cpufreq")); os.IsNotExist(err) { log.Debugf("CPU %q is missing cpufreq", cpu) } else { - // cpufreq values are kHz, multiply by 1000 for hz + // sysfs cpufreq values are kHz, thus multiply by 1000 to export base units (hz). + // See https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt if value, err = readUintFromFile(filepath.Join(cpu, "cpufreq/scaling_cur_freq")); err != nil { return err }