Documentation
¶
Index ¶
- type Backend
- type CapacityStore
- type Commands
- type Controller
- func (c *Controller) Admit(ctx context.Context, reserve func() error) error
- func (c *Controller) Check(ctx context.Context) error
- func (c *Controller) Ensure(ctx context.Context) error
- func (c *Controller) Maintain(ctx context.Context, trigger Trigger) (Status, error)
- func (c *Controller) Status() Status
- type DockerCommands
- type Host
- func (h *Host) Busy(ctx context.Context) (bool, error)
- func (h *Host) Emergency(ctx context.Context) error
- func (h *Host) Lock(ctx context.Context) (func(), error)
- func (h *Host) Reclaim(ctx context.Context, request ReclaimRequest) (ReclaimReport, error)
- func (h *Host) Snapshot(context.Context) (Snapshot, error)
- type HostConfig
- type ImagePolicy
- type Policy
- type ReclaimReport
- type ReclaimRequest
- type ResourceExhaustedError
- type Snapshot
- type Status
- type Thresholds
- type Trigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapacityStore ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(policy Policy, backend Backend) *Controller
func (*Controller) Admit ¶ added in v0.1.8
func (c *Controller) Admit(ctx context.Context, reserve func() error) error
Admit serializes the capacity decision and the caller's durable operation reservation with maintenance. This closes the idle-check/admission race: a collector cannot begin after capacity was checked but before the FIFO lease records the worker as busy.
func (*Controller) Status ¶
func (c *Controller) Status() Status
type DockerCommands ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
func NewHost ¶
func NewHost(config HostConfig) *Host
func (*Host) Reclaim ¶
func (h *Host) Reclaim(ctx context.Context, request ReclaimRequest) (ReclaimReport, error)
type HostConfig ¶
type Policy ¶
type Policy struct {
SoftFreePercent uint64
SoftFreeMinimumBytes uint64
HardFreePercent uint64
HardFreeMinimumBytes uint64
SweepPercent uint64
SweepMinimumBytes uint64
MinimumFreeInodes uint64
JobRetention time.Duration
CacheHighPercent uint64
CacheLowPercent uint64
NormalObjectAge time.Duration
PressureThrottle time.Duration
}
func DefaultPolicy ¶
func DefaultPolicy() Policy
func (Policy) Thresholds ¶
func (p Policy) Thresholds(total uint64) Thresholds
type ReclaimReport ¶
type ReclaimRequest ¶
type ResourceExhaustedError ¶
type ResourceExhaustedError struct {
FreeBytes uint64
RequiredBytes uint64
FreeInodes uint64
RequiredInodes uint64
}
func (*ResourceExhaustedError) Error ¶
func (e *ResourceExhaustedError) Error() string
type Status ¶
type Status struct {
State string `json:"state"`
Trigger Trigger `json:"trigger"`
Before Snapshot `json:"before"`
After Snapshot `json:"after"`
Thresholds Thresholds `json:"thresholds"`
Reclaim ReclaimReport `json:"reclaim"`
Error string `json:"error,omitempty"`
CompletedAt time.Time `json:"completed_at"`
}
type Thresholds ¶
Click to show internal directories.
Click to hide internal directories.