Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoNeedToMonitor = errors.New("container is not supposed to be monitored")
ErrNoNeedToMonitor is used to skip containers that shouldn't be monitored by collectd
Functions ¶
This section is empty.
Types ¶
type CollectdWriter ¶
type CollectdWriter struct {
// contains filtered or unexported fields
}
CollectdWriter is responsible for writing data to wrapped writer in collectd exec plugin format
func NewCollectdWriter ¶
func NewCollectdWriter(host string, writer io.Writer) CollectdWriter
NewCollectdWriter creates new CollectdWriter with specified hostname and writer
func (CollectdWriter) Write ¶
func (w CollectdWriter) Write(s Stats) error
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is responsible for discovering containers for monitoring and writing stats
func NewCollector ¶
func NewCollector(client *docker.Client, w CollectdWriter, interval int) *Collector
NewCollector creates new Collector with specified docker client, collectd stats writer and stat updating interval
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is responsible for monitoring of a single container (task)
func NewMonitor ¶
func NewMonitor(c MonitorDockerClient, id string, interval int) (*Monitor, error)
NewMonitor creates new monitor with specified docker client, container id and stat updating interval
type MonitorDockerClient ¶
type MonitorDockerClient interface { InspectContainer(id string) (*docker.Container, error) Stats(opts docker.StatsOptions) error }
MonitorDockerClient represents restricted interface for docker client that is used in monitor, docker.Client is a subset of this interface