MCPcopy Create free account
hub / github.com/cortexproject/cortex / Collect

Method Collect

pkg/util/process/collector.go:68–76  ·  view source on GitHub ↗

Collect returns the current state of all metrics of the collector.

(ch chan<- prometheus.Metric)

Source from the content-addressed store, hash-verified

66
67// Collect returns the current state of all metrics of the collector.
68func (c *processCollector) Collect(ch chan<- prometheus.Metric) {
69 if value, err := c.getMapsCount(); err == nil {
70 ch <- prometheus.MustNewConstMetric(c.currMaps, prometheus.GaugeValue, value)
71 }
72
73 if value, err := c.getMapsCountLimit(); err == nil {
74 ch <- prometheus.MustNewConstMetric(c.maxMaps, prometheus.GaugeValue, value)
75 }
76}
77
78// getMapsCount returns the number of memory map ares the process has allocated.
79func (c *processCollector) getMapsCount() (float64, error) {

Callers

nothing calls this directly

Calls 2

getMapsCountMethod · 0.95
getMapsCountLimitMethod · 0.95

Tested by

no test coverage detected