(ch chan<- prometheus.Metric)
| 40 | } |
| 41 | |
| 42 | func (c *loadavgCollector) Update(ch chan<- prometheus.Metric) error { |
| 43 | loads, err := getLoad() |
| 44 | if err != nil { |
| 45 | return fmt.Errorf("couldn't get load: %s", err) |
| 46 | } |
| 47 | for i, load := range loads { |
| 48 | log.Debugf("return load %d: %f", i, load) |
| 49 | ch <- c.metric[i].mustNewConstMetric(load) |
| 50 | } |
| 51 | return err |
| 52 | } |
nothing calls this directly
no test coverage detected