Documentation ¶
Index ¶
- Constants
- type ReadIOMeasurer
- type ReadMeasurer
- type Reader
- type ReaderContext
- func (ctx *ReaderContext) InitialiseMaximumSpeed(maxSpeed uint64)
- func (ctx *ReaderContext) MaximumSpeed() uint64
- func (ctx *ReaderContext) NewReader(rd io.Reader) *Reader
- func (ctx *ReaderContext) RegisterMetrics(dir *tricorder.DirectorySpec, unit units.Unit, description string) error
- func (ctx *ReaderContext) SetSpeedPercent(percent uint)
- func (ctx *ReaderContext) SpeedPercent() uint
- func (ctx *ReaderContext) String() string
Constants ¶
View Source
const (
DEFAULT_SPEED_PERCENT = 2
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadIOMeasurer ¶
type ReadMeasurer ¶
type ReadMeasurer struct{}
func (*ReadMeasurer) MeasureReadIO ¶
func (measurer *ReadMeasurer) MeasureReadIO(bytesSinceLastMeasurement uint64) ( uint64, error)
func (*ReadMeasurer) Reset ¶
func (measurer *ReadMeasurer) Reset()
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) 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
Click to show internal directories.
Click to hide internal directories.