Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents in-memory storage of container.SizeEstimation values.
The write operation has the usual behavior - to save the next number of used container space for a specific epoch. All values related to one key (epoch, container ID) are stored as a list.
Storage also provides an iterator interface, into the handler of which the final score is passed, built on all values saved at the time of the call. Currently the only possible estimation formula is used - the average between 10th and 90th percentile.
For correct operation, Storage must be created using the constructor (New) based on the required parameters and optional components. After successful creation, Storage is immediately ready to work through API.
func New ¶
New creates a new instance of the Storage.
The created Storage does not require additional initialization and is completely ready for work.
estimationsLifeCycle is a longevity (in epochs) of estimations that are kept in the Storage instance. Note, current epoch is controlled with Storage.EpochEvent.
func (*Storage) EpochEvent ¶ added in v0.38.0
EpochEvent notifies Storage about epoch counter updating. Used to remove unused estimations. See [Prm.EstimationsLifeCycle]. Blocking operation.
func (*Storage) Iterate ¶
func (s *Storage) Iterate(f loadcontroller.UsedSpaceFilter, h loadcontroller.UsedSpaceHandler) (err error)
Iterate goes through all the lists with the key (container ID, epoch), calculates the final grade for all values, and passes it to the handler.
Final grade is the average between 10th and 90th percentiles.