MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / Update

Method Update

metric/diskstats_darwin.go:160–173  ·  view source on GitHub ↗
(ch chan<- prometheus.Metric)

Source from the content-addressed store, hash-verified

158}
159
160func (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}

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.80
mustNewConstMetricMethod · 0.45

Tested by

no test coverage detected