Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadFileNoStat ¶
ReadFileNoStat uses ioutil.ReadAll to read contents of entire file. This is similar to ioutil.ReadFile but without the call to os.Stat, because many files in /proc and /sys report incorrect file sizes (either 0 or 4096). Reads a max file size of 512kB. For files larger than this, a scanner should be used. COPIED FROM prometheus/procfs WHICH ALSO USES APACHE 2.0
Types ¶
type CPUAcct ¶
type CPUAcct struct {
CPUs []CPUUsage
}
CPUAcct stores CPU accounting information (e.g. cpu usage) for a control group (cgroup) of tasks. Equivalent to cpuacct.usage_all
func NewCPUAcct ¶
NewCPUAcct will locate and read the kernel's cpu accounting info for the provided systemd cgroup subpath.
func (*CPUAcct) UsageAllNanosecs ¶
UsageAllNanosecs returns total cpu consumption in nanoseconds, across all available cpu cores, from the point that CPU accounting was enabled for this control group.
func (*CPUAcct) UsageSystemNanosecs ¶
UsageSystemNanosecs returns system (e.g. kernel) cpu consumption in nanoseconds, across all available cpu cores, from the point that CPU accounting was enabled for this control group.
func (*CPUAcct) UsageUserNanosecs ¶
UsageUserNanosecs returns user (e.g. non-kernel) cpu consumption in nanoseconds, across all available cpu cores, from the point that CPU accounting was enabled for this control group.
type CPUUsage ¶
CPUUsage stores one core's worth of CPU usage for a control group (aka cgroup) of tasks (e.g. both processes and threads). Equivalent to cpuacct.usage_percpu_user and cpuacct.usage_percpu_system
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
func NewCollector ¶
NewCollector returns a new Collector exposing systemd statistics.
func (*Collector) Collect ¶
func (c *Collector) Collect(ch chan<- prometheus.Metric)
Collect gathers metrics from systemd.
func (*Collector) Describe ¶
func (c *Collector) Describe(desc chan<- *prometheus.Desc)
Describe gathers descriptions of Metrics