cadvisor: github.com/google/cadvisor/events Index | Files

package events

import "github.com/google/cadvisor/events"

Index

Package Files

handler.go

func NewEventManager Uses

func NewEventManager(storagePolicy StoragePolicy) *events

returns a pointer to an initialized Events object.

type EventChannel Uses

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

func NewEventChannel Uses

func NewEventChannel(watchId int) *EventChannel

func (*EventChannel) GetChannel Uses

func (self *EventChannel) GetChannel() chan *info.Event

func (*EventChannel) GetWatchId Uses

func (self *EventChannel) GetWatchId() int

type EventManager Uses

type EventManager interface {
    // WatchEvents() allows a caller to register for receiving events based on the specified request.
    // On successful registration, an EventChannel object is returned.
    WatchEvents(request *Request) (*EventChannel, error)
    // GetEvents() returns all detected events based on the filters specified in request.
    GetEvents(request *Request) ([]*info.Event, error)
    // AddEvent allows the caller to add an event to an EventManager
    // object
    AddEvent(e *info.Event) error
    // Cancels a previously requested watch event.
    StopWatch(watch_id int)
}

EventManager is implemented by Events. It provides two ways to monitor events and one way to add events

type Request Uses

type Request struct {
    // events falling before StartTime do not satisfy the request. StartTime
    // must be left blank in calls to WatchEvents
    StartTime time.Time
    // events falling after EndTime do not satisfy the request. EndTime
    // must be left blank in calls to WatchEvents
    EndTime time.Time
    // EventType is a map that specifies the type(s) of events wanted
    EventType map[info.EventType]bool
    // allows the caller to put a limit on how many
    // events to receive. If there are more events than MaxEventsReturned
    // then the most chronologically recent events in the time period
    // specified are returned. Must be >= 1
    MaxEventsReturned int
    // the absolute container name for which the event occurred
    ContainerName string
    // if IncludeSubcontainers is false, only events occurring in the specific
    // container, and not the subcontainers, will be returned
    IncludeSubcontainers bool
}

Request holds a set of parameters by which Event objects may be screened. The caller may want events that occurred within a specific timeframe or of a certain type, which may be specified in the *Request object they pass to an EventManager function

func NewRequest Uses

func NewRequest() *Request

returns a pointer to an initialized Request object

type StoragePolicy Uses

type StoragePolicy struct {
    // Defaults limites, used if a per-event limit is not set.
    DefaultMaxAge       time.Duration
    DefaultMaxNumEvents int

    // Per-event type limits.
    PerTypeMaxAge       map[info.EventType]time.Duration
    PerTypeMaxNumEvents map[info.EventType]int
}

Policy specifying how many events to store. MaxAge is the max duration for which to keep events. MaxNumEvents is the max number of events to keep (-1 for no limit).

func DefaultStoragePolicy Uses

func DefaultStoragePolicy() StoragePolicy

Package events imports 8 packages (graph) and is imported by 487 packages. Updated 2018-12-13. Refresh now. Tools for package owners.