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

Method Update

metric/loadavg.go:42–52  ·  view source on GitHub ↗
(ch chan<- prometheus.Metric)

Source from the content-addressed store, hash-verified

40}
41
42func (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}

Callers

nothing calls this directly

Calls 4

DebugfFunction · 0.92
ErrorfMethod · 0.80
getLoadFunction · 0.70
mustNewConstMetricMethod · 0.45

Tested by

no test coverage detected