volatilitymonitor

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: AGPL-3.0 Imports: 4 Imported by: 3

README

Volatility monitor

You can use a volatility monitor to monitor writes, and to return blocks in order from least volatile to most.

Usage

VolatilityMonitor implements both storage.StorageProvider and also storage.BlockOrder. So you can put it in a chain of storage providers, and then use it as an orderer for a migrator.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VolatilityMonitor

type VolatilityMonitor struct {
	storage.ProviderWithEvents
	// contains filtered or unexported fields
}

func NewVolatilityMonitor

func NewVolatilityMonitor(prov storage.Provider, blockSize int, expiry time.Duration) *VolatilityMonitor

func (*VolatilityMonitor) Add

func (i *VolatilityMonitor) Add(block int)

func (*VolatilityMonitor) AddAll

func (i *VolatilityMonitor) AddAll()

func (*VolatilityMonitor) CancelWrites added in v0.0.5

func (i *VolatilityMonitor) CancelWrites(offset int64, length int64)

func (*VolatilityMonitor) Close

func (i *VolatilityMonitor) Close() error

func (*VolatilityMonitor) Flush

func (i *VolatilityMonitor) Flush() error

func (*VolatilityMonitor) GetNext

func (i *VolatilityMonitor) GetNext() *storage.BlockInfo

func (*VolatilityMonitor) GetTotalVolatility

func (i *VolatilityMonitor) GetTotalVolatility() int

func (*VolatilityMonitor) GetVolatility

func (i *VolatilityMonitor) GetVolatility(block int) int

func (*VolatilityMonitor) ReadAt

func (i *VolatilityMonitor) ReadAt(buffer []byte, offset int64) (int, error)

func (*VolatilityMonitor) Remove

func (i *VolatilityMonitor) Remove(block int)

func (*VolatilityMonitor) SendSiloEvent added in v0.0.10

func (i *VolatilityMonitor) SendSiloEvent(eventType storage.EventType, eventData storage.EventData) []storage.EventReturnData

Relay events to embedded StorageProvider

func (*VolatilityMonitor) Size

func (i *VolatilityMonitor) Size() uint64

func (*VolatilityMonitor) WriteAt

func (i *VolatilityMonitor) WriteAt(buffer []byte, offset int64) (int, error)

Jump to

Keyboard shortcuts

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