structs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocBroadcaster added in v0.6.0

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

AllocBroadcaster implements an allocation broadcast channel. The zero value is a usable unbuffered channel.

func NewAllocBroadcaster added in v0.6.0

func NewAllocBroadcaster(n int) *AllocBroadcaster

NewAllocBroadcaster returns a new AllocBroadcaster with the given capacity (0 means unbuffered).

func (*AllocBroadcaster) Close added in v0.6.0

func (b *AllocBroadcaster) Close()

Close closes the channel, disabling the sending of further messages.

func (*AllocBroadcaster) Listen added in v0.6.0

func (b *AllocBroadcaster) Listen() *AllocListener

Listen returns a Listener for the broadcast channel.

func (*AllocBroadcaster) Send added in v0.6.0

Send broadcasts a message to the channel. Send returns whether the message was sent to all channels.

type AllocListener added in v0.6.0

type AllocListener struct {
	// Ch receives the broadcast messages.
	Ch <-chan *structs.Allocation
	// contains filtered or unexported fields
}

AllocListener implements a listening endpoint for an allocation broadcast channel.

func (*AllocListener) Close added in v0.6.0

func (l *AllocListener) Close()

Close closes the Listener, disabling the receival of further messages.

type AllocResourceUsage

type AllocResourceUsage struct {
	// ResourceUsage is the summation of the task resources
	ResourceUsage *ResourceUsage

	// Tasks contains the resource usage of each task
	Tasks map[string]*TaskResourceUsage

	// The max timestamp of all the Tasks
	Timestamp int64
}

AllocResourceUsage holds the aggregated task resource usage of the allocation.

type CpuStats

type CpuStats struct {
	SystemMode       float64
	UserMode         float64
	TotalTicks       float64
	ThrottledPeriods uint64
	ThrottledTime    uint64
	Percent          float64

	// A list of fields whose values were actually sampled
	Measured []string
}

CpuStats holds cpu usage related stats

func (*CpuStats) Add

func (cs *CpuStats) Add(other *CpuStats)

type DriverNetwork added in v0.6.0

type DriverNetwork struct {
	// PortMap can be set by drivers to replace ports in environment
	// variables with driver-specific mappings.
	PortMap map[string]int

	// IP is the IP address for the task created by the driver.
	IP string

	// AutoAdvertise indicates whether the driver thinks services that
	// choose to auto-advertise-addresses should use this IP instead of the
	// host's. eg If a Docker network plugin is used
	AutoAdvertise bool
}

DriverNetwork is the network created by driver's (eg Docker's bridge network) during Prestart.

func (*DriverNetwork) Advertise added in v0.6.0

func (d *DriverNetwork) Advertise() bool

Advertise returns true if the driver suggests using the IP set. May be called on a nil Network in which case it returns false.

func (*DriverNetwork) Copy added in v0.6.0

func (d *DriverNetwork) Copy() *DriverNetwork

Copy a DriverNetwork struct. If it is nil, nil is returned.

func (*DriverNetwork) Hash added in v0.6.0

func (d *DriverNetwork) Hash() []byte

Hash the contents of a DriverNetwork struct to detect changes. If it is nil, an empty slice is returned.

type FSIsolation added in v0.5.3

type FSIsolation int

FSIsolation is an enumeration to describe what kind of filesystem isolation a driver supports.

const (
	// FSIsolationNone means no isolation. The host filesystem is used.
	FSIsolationNone FSIsolation = 0

	// FSIsolationChroot means the driver will use a chroot on the host
	// filesystem.
	FSIsolationChroot FSIsolation = 1

	// FSIsolationImage means the driver uses an image.
	FSIsolationImage FSIsolation = 2
)

func (FSIsolation) String added in v0.5.3

func (f FSIsolation) String() string

type MemoryStats

type MemoryStats struct {
	RSS            uint64
	Cache          uint64
	Swap           uint64
	MaxUsage       uint64
	KernelUsage    uint64
	KernelMaxUsage uint64

	// A list of fields whose values were actually sampled
	Measured []string
}

MemoryStats holds memory usage related stats

func (*MemoryStats) Add

func (ms *MemoryStats) Add(other *MemoryStats)

type ResourceUsage

type ResourceUsage struct {
	MemoryStats *MemoryStats
	CpuStats    *CpuStats
}

ResourceUsage holds information related to cpu and memory stats

func (*ResourceUsage) Add

func (ru *ResourceUsage) Add(other *ResourceUsage)

type TaskResourceUsage

type TaskResourceUsage struct {
	ResourceUsage *ResourceUsage
	Timestamp     int64
	Pids          map[string]*ResourceUsage
}

TaskResourceUsage holds aggregated resource usage of all processes in a Task and the resource usage of the individual pids

Jump to

Keyboard shortcuts

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