container

package
v0.0.0-...-e051822 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIST_SELF = iota
	LIST_RECURSIVE
)

Listing types.

Variables

This section is empty.

Functions

func NewSampler

func NewSampler(param *StatsParameter) (sampling.Sampler, error)

func RegisterContainerHandlerFactory

func RegisterContainerHandlerFactory(path string, factory ContainerHandlerFactory)

func SetStatsParameter

func SetStatsParameter(param *StatsParameter)

Types

type ContainerHandler

type ContainerHandler interface {
	GetSpec() (*info.ContainerSpec, error)
	GetStats() (*info.ContainerStats, error)
	ListContainers(listType ListType) ([]info.ContainerReference, error)
	ListThreads(listType ListType) ([]int, error)
	ListProcesses(listType ListType) ([]int, error)
	StatsSummary() (*info.ContainerStatsPercentiles, error)
}

Interface for container operation handlers.

func AddStatsSummary

func AddStatsSummary(handler ContainerHandler, parameter *StatsParameter) (ContainerHandler, error)

func NewBlackListFilter

func NewBlackListFilter(handler ContainerHandler, forbiddenPaths ...string) ContainerHandler

func NewContainerHandler

func NewContainerHandler(path string) (ContainerHandler, error)

func NewWhiteListFilter

func NewWhiteListFilter(handler ContainerHandler, acceptedPaths ...string) ContainerHandler

type ContainerHandlerFactory

type ContainerHandlerFactory interface {
	NewContainerHandler(name string) (ContainerHandler, error)

	// for testability
	String() string
}

func AddStatsSummaryToFactory

func AddStatsSummaryToFactory(factory ContainerHandlerFactory) ContainerHandlerFactory

This is a decorator for container factory. If the container handler created by a container factory does not implement stats summary method, then the factory could be decorated with this structure.

type ListType

type ListType int

type NoStatsSummary

type NoStatsSummary struct {
}

func (*NoStatsSummary) StatsSummary

func (self *NoStatsSummary) StatsSummary() (*info.ContainerStatsPercentiles, error)

type StatsParameter

type StatsParameter struct {
	Sampler     string
	NumSamples  int
	WindowSize  int
	ResetPeriod time.Duration
}

Directories

Path Synopsis
Package containers is a generated protocol buffer package.
Package containers is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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