rateio

package
v0.0.0-...-d8f7d12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_SPEED_PERCENT = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadIOMeasurer

type ReadIOMeasurer interface {
	MeasureReadIO(bytesSinceLastMeasurement uint64) (uint64, error)
	Reset()
}

type ReadMeasurer

type ReadMeasurer struct{}

func (*ReadMeasurer) MeasureReadIO

func (measurer *ReadMeasurer) MeasureReadIO(bytesSinceLastMeasurement uint64) (
	uint64, error)

func (*ReadMeasurer) Reset

func (measurer *ReadMeasurer) Reset()

type Reader

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

func (*Reader) Read

func (rd *Reader) Read(b []byte) (n int, err error)

type ReaderContext

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

func NewReaderContext

func NewReaderContext(maxIOPerSecond uint64, speedPercent uint64,
	measurer ReadIOMeasurer) *ReaderContext

func (*ReaderContext) InitialiseMaximumSpeed

func (ctx *ReaderContext) InitialiseMaximumSpeed(maxSpeed uint64)

func (*ReaderContext) MaximumSpeed

func (ctx *ReaderContext) MaximumSpeed() uint64

func (*ReaderContext) NewReader

func (ctx *ReaderContext) NewReader(rd io.Reader) *Reader

func (*ReaderContext) RegisterMetrics

func (ctx *ReaderContext) RegisterMetrics(dir *tricorder.DirectorySpec,
	unit units.Unit, description string) error

func (*ReaderContext) SetSpeedPercent

func (ctx *ReaderContext) SetSpeedPercent(percent uint)

func (*ReaderContext) SpeedPercent

func (ctx *ReaderContext) SpeedPercent() uint

func (*ReaderContext) String

func (ctx *ReaderContext) String() string

Jump to

Keyboard shortcuts

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