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

Function newProcessCollector

pkg/util/process/collector.go:39–59  ·  view source on GitHub ↗
(pid int, procMountPoint string)

Source from the content-addressed store, hash-verified

37}
38
39func newProcessCollector(pid int, procMountPoint string) (prometheus.Collector, error) {
40 // Check whether it's supported on this platform.
41 if !isSupported(procMountPoint) {
42 return nil, ErrUnsupportedCollector
43 }
44
45 return &processCollector{
46 pid: pid,
47 procMountPoint: procMountPoint,
48 currMaps: prometheus.NewDesc(
49 "process_memory_map_areas",
50 "Number of memory map areas allocated by the process.",
51 nil, nil,
52 ),
53 maxMaps: prometheus.NewDesc(
54 "process_memory_map_areas_limit",
55 "Maximum number of memory map ares the process can allocate.",
56 nil, nil,
57 ),
58 }, nil
59}
60
61// Describe returns all descriptions of the collector.
62func (c *processCollector) Describe(ch chan<- *prometheus.Desc) {

Callers 3

TestProcessCollectorFunction · 0.85
NewProcessCollectorFunction · 0.85

Calls 1

isSupportedFunction · 0.70

Tested by 2

TestProcessCollectorFunction · 0.68