Documentation
¶
Index ¶
- Constants
- Variables
- type AllocBroadcaster
- type AllocExecRequest
- type AllocFileInfo
- type AllocListener
- type AllocResourceUsage
- type AllocStatsRequest
- type AllocStatsResponse
- type ClientStatsResponse
- type CpuStats
- type FsListRequest
- type FsListResponse
- type FsLogsRequest
- type FsStatRequest
- type FsStatResponse
- type FsStreamRequest
- type HealthCheckIntervalRequest
- type HealthCheckIntervalResponse
- type HealthCheckRequest
- type HealthCheckResponse
- type MemoryStats
- type MonitorRequest
- type ResourceUsage
- type RpcError
- type StreamErrWrapper
- type TaskResourceUsage
Constants ¶
const CheckBufSize = 4 * 1024
CheckBufSize is the size of the buffer that is used for job output
Variables ¶
var DriverStatsNotImplemented = errors.New("stats not implemented for driver")
DriverStatsNotImplemented is the error to be returned if a driver doesn't implement stats.
var ErrAllocBroadcasterClosed = errors.New("alloc broadcaster closed")
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 where each listener receives allocation updates. Pending updates are dropped and replaced by newer allocation updates, so listeners may not receive every allocation update. However this ensures Sends never block and listeners only receive the latest allocation update -- never a stale version.
func NewAllocBroadcaster ¶ added in v0.6.0
func NewAllocBroadcaster(l hclog.Logger) *AllocBroadcaster
NewAllocBroadcaster returns a new AllocBroadcaster.
func (*AllocBroadcaster) Close ¶ added in v0.6.0
func (b *AllocBroadcaster) Close()
Close closes the channel, disabling the sending of further allocation updates. Pending updates are still received by listeners. Safe to call concurrently and more than once.
func (*AllocBroadcaster) Listen ¶ added in v0.6.0
func (b *AllocBroadcaster) Listen() *AllocListener
Listen returns a Listener for the broadcast channel. New listeners receive the last sent alloc update.
func (*AllocBroadcaster) Send ¶ added in v0.6.0
func (b *AllocBroadcaster) Send(v *structs.Allocation) error
Send broadcasts an allocation update. Any pending updates are replaced with this version of the allocation to prevent blocking on slow receivers. Returns ErrAllocBroadcasterClosed if called after broadcaster is closed.
type AllocExecRequest ¶ added in v0.9.2
type AllocExecRequest struct {
// AllocID is the allocation to stream logs from
AllocID string
// Task is the task to stream logs from
Task string
// Tty indicates whether to allocate a pseudo-TTY
Tty bool
// Cmd is the command to be executed
Cmd []string
structs.QueryOptions
}
AllocExecRequest is the initial request for execing into an Alloc task
type AllocFileInfo ¶ added in v0.8.0
type AllocFileInfo struct {
Name string
IsDir bool
Size int64
FileMode string
ModTime time.Time
ContentType string `json:",omitempty"`
}
AllocFileInfo holds information about a file inside the AllocDir
type AllocListener ¶ added in v0.6.0
type AllocListener struct {
// contains filtered or unexported fields
}
AllocListener implements a listening endpoint for an allocation broadcast channel.
func (*AllocListener) Ch ¶ added in v0.6.0
func (l *AllocListener) Ch() <-chan *structs.Allocation
func (*AllocListener) Close ¶ added in v0.6.0
func (l *AllocListener) Close()
Close closes the Listener, disabling the receival of further messages. Safe to call more than once and concurrently with receiving on Ch.
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 AllocStatsRequest ¶ added in v0.8.0
type AllocStatsRequest struct {
// AllocID is the allocation to retrieves stats for
AllocID string
// Task is an optional filter to only request stats for the task.
Task string
structs.QueryOptions
}
AllocStatsRequest is used to request the resource usage of a given allocation, potentially filtering by task
type AllocStatsResponse ¶ added in v0.8.0
type AllocStatsResponse struct {
Stats *AllocResourceUsage
structs.QueryMeta
}
AllocStatsResponse is used to return the resource usage of a given allocation.
type ClientStatsResponse ¶ added in v0.8.0
type ClientStatsResponse struct {
HostStats *