Update implements Collector and exposes cpu related metrics from /proc/stat and /sys/.../cpu/.
(ch chan<- prometheus.Metric)
| 78 | |
| 79 | // Update implements Collector and exposes cpu related metrics from /proc/stat and /sys/.../cpu/. |
| 80 | func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { |
| 81 | if err := c.updateStat(ch); err != nil { |
| 82 | return err |
| 83 | } |
| 84 | return c.updateCPUfreq(ch) |
| 85 | } |
| 86 | |
| 87 | // updateCPUfreq reads /sys/devices/system/cpu/cpu* and expose cpu frequency statistics. |
| 88 | func (c *cpuCollector) updateCPUfreq(ch chan<- prometheus.Metric) error { |
nothing calls this directly
no test coverage detected