(ch chan<- prometheus.Metric)
| 158 | } |
| 159 | |
| 160 | func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error { |
| 161 | diskStats, err := iostat.ReadDriveStats() |
| 162 | if err != nil { |
| 163 | return fmt.Errorf("couldn't get diskstats: %s", err) |
| 164 | } |
| 165 | |
| 166 | for _, stats := range diskStats { |
| 167 | for _, desc := range c.descs { |
| 168 | v := desc.value(stats) |
| 169 | ch <- desc.mustNewConstMetric(v, stats.Name) |
| 170 | } |
| 171 | } |
| 172 | return nil |
| 173 | } |
nothing calls this directly
no test coverage detected