Documentation ¶
Overview ¶
Package exchange groups together pieces of data shared between publisher components and some common configuration. Package contains code from Kubernetes Heapster (https://github.com/kubernetes/heapster) with following changes: - structure StatsRequest:
- added comment for the StatsRequest structure
- altered comments for all fields in the structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var LogControl = &logcontrol.LogControl{}
LogControl is a controller for loggers shared between publisher subsystems. Each subsystem should this package first, and wire its logger.
Functions ¶
This section is empty.
Types ¶
type MetricMemory ¶
type MetricMemory struct { sync.RWMutex // ContainerMap refers to all containers known to publisher., ref by Id ContainerMap map[string]*cadv.ContainerInfo // PendingMetrics holds custom metrics that await publishing, ref by Id PendingMetrics map[string]map[string][]cadv.MetricVal }
MetricMemory constitutes a metric storage shared between processor and server parts of the plugin. MetricMemory is equipped with RW lock that should be obtained separately for read and update operations.
func NewMetricMemory ¶
func NewMetricMemory() *MetricMemory
NewMetricMemory return new instance of metric memory to be shared between subsystems.
type StatsRequest ¶
type StatsRequest struct { // ContainerName is name of the container to retrieve stats for // (defaults to root or '/'). ContainerName string `json:"containerName,omitempty"` // NumStats defines amount of stats to return per container, maximum. // Ignored if start and end time is given. NumStats int `json:"num_stats,omitempty"` // Start defines time window limiting the stats to fetch per container. // Defaults to beginning of time. Start time.Time `json:"start,omitempty"` // End defines time window limiting the stats to fetch per container. // Defaults to current time. End time.Time `json:"end,omitempty"` // Subcontainers controls depth of query, allowing to fetch stats for // subcontainers. Subcontainers bool `json:"subcontainers,omitempty"` }
StatsRequest is a struct representing HTTP request for stats.
type Subsystem ¶
type Subsystem struct {
// contains filtered or unexported fields
}
Subsystem is a common interface for all publisher subsystems
type SystemConfig ¶
type SystemConfig struct { // StatsDepth limits the maximum number of stats that should be //buffered for a container. Disabled if zero. Evaluated in combination //with StatsSpan. StatsDepth int // StatsSpan limits the maximum time span of stats that should //be buffered for a container. Stats will be limited by this limit and //the value of StatsDepth. StatsSpan time.Duration // ServerAddr is an address that the server should bind to. ServerAddr string // ServerPort is a port number that the server should listen at. ServerPort int // VerboseAt holds a list of logger name prefixes (field 'at') //that should be set to verbose (Debug level). VerboseAt []string // SilentAt holds a list of logger name prefixes (field 'at') //that should be set to silent (Warning level). SilentAt []string // MuteAt holds a list of logger name prefixes (field 'at') //that should be set to mute (Error level). MuteAt []string }
SystemConfig contains all configuration items extracted from plugin's config in task manifest.
func NewSystemConfig ¶
func NewSystemConfig() *SystemConfig
NewSystemConfig returns zero-valued instance of SystemConfig.