Collect returns the current state of all metrics of the collector.
(ch chan<- prometheus.Metric)
| 66 | |
| 67 | // Collect returns the current state of all metrics of the collector. |
| 68 | func (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. |
| 79 | func (c *processCollector) getMapsCount() (float64, error) { |
nothing calls this directly
no test coverage detected