Documentation
¶
Overview ¶
Package pgmetrics provides Prometheus metrics for cgroup resource usage under the opensvc.slice hierarchy.
It exposes cgroup metrics (CPU, memory, etc.) for the cgroups of the process groups: the opensvc slice itself, the slice of each namespace, and the slice of each object, told apart by the scope label.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // CgroupRoot is the root path for opensvc cgroups. A var rather than // a const so the tests can point collect() at a tree they built. CgroupRoot = "/sys/fs/cgroup/opensvc.slice" // BlockRoot holds a directory per block device, named by its // major:minor, as io.stat names them. A var for the tests. BlockRoot = "/sys/dev/block" // HostCgroupRoot is the root of the cgroup hierarchy, which holds the // opensvc slice and the other top level slices. ProcRoot and // CPUOnlineFile are where the host totals are read. Vars for the // tests. HostCgroupRoot = "/sys/fs/cgroup" ProcRoot = "/proc" CPUOnlineFile = "/sys/devices/system/cpu/online" )
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the collection and reporting of cgroup metrics
func New ¶
func New() *Manager
New creates a new pgmetrics manager.
It takes no queue sizer any more: it subscribes to nothing, having no goroutine left to receive on. The cgroup tree is read by the scrapes that ask for it.