MCPcopy
hub / github.com/prometheus/node_exporter / Update

Method Update

collector/logind_linux.go:93–101  ·  view source on GitHub ↗
(ch chan<- prometheus.Metric)

Source from the content-addressed store, hash-verified

91}
92
93func (lc *logindCollector) Update(ch chan<- prometheus.Metric) error {
94 c, err := newDbus()
95 if err != nil {
96 return fmt.Errorf("unable to connect to dbus: %w", err)
97 }
98 defer c.conn.Close()
99
100 return collectMetrics(ch, c)
101}
102
103func collectMetrics(ch chan<- prometheus.Metric, c logindInterface) error {
104 seats, err := c.listSeats()

Callers

nothing calls this directly

Calls 3

newDbusFunction · 0.85
collectMetricsFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected