evcalc

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor interface {
	StoreDataFlushed(timestamp time.Time, countFlushed int, countInStorage int64)
	Lambda() float64
	Acquire() bool
	Release()
	Busy() bool
}

Monitor specifies the interface for a lambda calculator

type MonitorImpl

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

MonitorImpl struct that will has a window of statistics for eviction lambda calculation

func New

func New(threads int) *MonitorImpl

New constructs a new eviction calculation monitor

func (*MonitorImpl) Acquire

func (m *MonitorImpl) Acquire() bool

Acquire requests permission to flush whichever resource this monitor is associated to

func (*MonitorImpl) Busy

func (m *MonitorImpl) Busy() bool

Busy returns true if the permission is currently acquired and hasn't yet been released

func (*MonitorImpl) Lambda

func (m *MonitorImpl) Lambda() float64

Lambda the returns the last known lambda value

func (*MonitorImpl) Release

func (m *MonitorImpl) Release()

Release signals the end of a syncrhonization operation which was previously acquired

func (*MonitorImpl) StoreDataFlushed

func (m *MonitorImpl) StoreDataFlushed(timestamp time.Time, countFlushed int, countInStorage int64)

StoreDataFlushed stores data flushed into the monitor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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