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

Method entryWithCreate

collector/ethtool_linux.go:501–514  ·  view source on GitHub ↗
(key, metricFQName string)

Source from the content-addressed store, hash-verified

499}
500
501func (c *ethtoolCollector) entryWithCreate(key, metricFQName string) *prometheus.Desc {
502 c.entriesMutex.Lock()
503 defer c.entriesMutex.Unlock()
504
505 if _, ok := c.entries[key]; !ok {
506 c.entries[key] = prometheus.NewDesc(
507 metricFQName,
508 fmt.Sprintf("Network interface %s", key),
509 []string{"device"}, nil,
510 )
511 }
512
513 return c.entries[key]
514}
515
516func (c *ethtoolCollector) entry(key string) *prometheus.Desc {
517 c.entriesMutex.Lock()

Callers 1

UpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected