monitor

package
v0.0.0-...-7b2e207 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoContainerFound = errors.New("no container found")

ErrNoContainerFound represents a error about not finding containers

Functions

This section is empty.

Types

type HandleFunc

type HandleFunc func(map[string]interface{})

HandleFunc is the expected function signature

type Monitor

type Monitor struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Monitor defines a launcher monitor module checking resource useage of a cocoon code. This module provides a pubsub feature that allows other external modules to subscribe to events from it and to also emit events to the module.

func NewMonitor

func NewMonitor(cocoonID string) *Monitor

NewMonitor creates a new monitor instance.

func (*Monitor) GetEmitter

func (m *Monitor) GetEmitter() *emission.Emitter

GetEmitter returns the monitor's emitter

func (*Monitor) Monitor

func (m *Monitor) Monitor()

Monitor starts the monitor

func (*Monitor) SetContainerID

func (m *Monitor) SetContainerID(cID string)

SetContainerID sets the id of the container to monitor

func (*Monitor) SetDockerClient

func (m *Monitor) SetDockerClient(dckClient *docker.Client)

SetDockerClient sets the docker client

func (*Monitor) Stop

func (m *Monitor) Stop()

Stop the monitor

type Report

type Report struct {
	DiskUsage int64
	NetTx     uint64
	NetRx     uint64
}

Report represents the result of the monitors checks

Jump to

Keyboard shortcuts

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