Documentation
¶
Index ¶
- func FilesystemName(wl *gridtypes.WorkloadWithID) string
- func GetCapacity(ctx context.Context) gridtypes.Capacity
- func NewStatisticsMessageBus(router rmb.Router, stats *Statistics) error
- func NewStatisticsStream(s *Statistics) pkg.Statistics
- type AtomicUnit
- type Counters
- type FListInfo
- type Primitives
- type Statistics
- func (s *Statistics) CanUpdate(ctx context.Context, typ gridtypes.WorkloadType) bool
- func (s *Statistics) Current() gridtypes.Capacity
- func (s *Statistics) Decommission(ctx context.Context, wl *gridtypes.WorkloadWithID) error
- func (s *Statistics) Provision(ctx context.Context, wl *gridtypes.WorkloadWithID) (result gridtypes.Result, err error)
- func (s *Statistics) Total() gridtypes.Capacity
- func (s *Statistics) Update(ctx context.Context, wl *gridtypes.WorkloadWithID) (gridtypes.Result, error)
- type ZDB
- type ZMachine
- type ZMachineResult
- type ZMount
- type ZMountResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilesystemName ¶
func FilesystemName(wl *gridtypes.WorkloadWithID) string
FilesystemName return a string to be used as filesystem name from a reservation object
func GetCapacity ¶
GetCapacity gets current capacity from context
func NewStatisticsMessageBus ¶
func NewStatisticsMessageBus(router rmb.Router, stats *Statistics) error
NewStatisticsMessageBus register statistics handlers for message bus
func NewStatisticsStream ¶
func NewStatisticsStream(s *Statistics) pkg.Statistics
Types ¶
type AtomicUnit ¶
AtomicUnit value for safe increment/decrement
func (*AtomicUnit) Current ¶
func (c *AtomicUnit) Current() gridtypes.Unit
Current returns the current value
type Counters ¶
type Counters struct {
SRU AtomicUnit // SSD storage in bytes
HRU AtomicUnit // HDD storage in bytes
MRU AtomicUnit // Memory storage in bytes
CRU AtomicUnit // CPU count absolute
IPv4 AtomicUnit // IPv4 count absolute
}
Counters tracks the amount of primitives workload deployed and the amount of resource unit used
type Primitives ¶
type Primitives struct {
provision.Provisioner
// contains filtered or unexported fields
}
Primitives hold all the logic responsible to provision and decomission the different primitives workloads defined by this package
func NewPrimitivesProvisioner ¶
func NewPrimitivesProvisioner(zbus zbus.Client) *Primitives
NewPrimitivesProvisioner creates a new 0-OS provisioner
func (*Primitives) InitializeZDB ¶
func (p *Primitives) InitializeZDB(ctx context.Context) error
InitializeZDB makes sure all required zdbs are running
type Statistics ¶
type Statistics struct {
// contains filtered or unexported fields
}
Statistics a provisioner interceptor that keeps track of consumed capacity. It also does validate of required capacity and then can report that this capacity can not be fulfilled
func NewStatistics ¶
func NewStatistics(total, initial gridtypes.Capacity, reserved Counters, inner provision.Provisioner) *Statistics
NewStatistics creates a new statistics provisioner interceptor. Statistics provisioner keeps track of used capacity and update explorer when it changes
func (*Statistics) CanUpdate ¶
func (s *Statistics) CanUpdate(ctx context.Context, typ gridtypes.WorkloadType) bool
CanUpdate implements the provisioner interface
func (*Statistics) Current ¶
func (s *Statistics) Current() gridtypes.Capacity
Current returns the current used capacity
func (*Statistics) Decommission ¶
func (s *Statistics) Decommission(ctx context.Context, wl *gridtypes.WorkloadWithID) error
Decommission implements the decomission interface
func (*Statistics) Provision ¶
func (s *Statistics) Provision(ctx context.Context, wl *gridtypes.WorkloadWithID) (result gridtypes.Result, err error)
Provision implements the provisioner interface
func (*Statistics) Total ¶
func (s *Statistics) Total() gridtypes.Capacity
Total returns the node total capacity
func (*Statistics) Update ¶
func (s *Statistics) Update(ctx context.Context, wl *gridtypes.WorkloadWithID) (gridtypes.Result, error)
Update implements the provisioner interface