cgroups

package
v1.0.0-alpha2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyCollected = errors.New("cgroup is already being collected")
	ErrCgroupNotExists  = errors.New("cgroup does not exist in the collector")
)

Functions

func New

func New(ic *plugin.InitContext) (interface{}, error)

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector provides the ability to collect container stats and export them in the prometheus format

func NewCollector

func NewCollector(ns *metrics.Namespace) *Collector

New registers the Collector with the provided namespace and returns it so that cgroups can be added for collection

func (*Collector) Add

func (c *Collector) Add(id, namespace string, cg cgroups.Cgroup) error

Add adds the provided cgroup and id so that metrics are collected and exported

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

func (*Collector) Get

func (c *Collector) Get(id, namespace string) (cgroups.Cgroup, error)

Get returns the cgroup that is being collected under the provided id returns ErrCgroupNotExists if the id is not being collected

func (*Collector) Remove

func (c *Collector) Remove(id, namespace string)

Remove removes the provided cgroup by id from the collector

type OOMCollector

type OOMCollector struct {
	// contains filtered or unexported fields
}

func NewOOMCollector

func NewOOMCollector(ns *metrics.Namespace) (*OOMCollector, error)

func (*OOMCollector) Add

func (o *OOMCollector) Add(id, namespace string, cg cgroups.Cgroup, triggers ...Trigger) error

func (*OOMCollector) Close

func (o *OOMCollector) Close() error

Close closes the epoll fd

type Trigger

type Trigger func(string, cgroups.Cgroup)

Trigger will be called when an event happens and provides the cgroup where the event originated from

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL