ring

package
v0.0.0-...-856a469 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultCapacity is max size of ring
	DefaultCapacity = 256
)

Functions

This section is empty.

Types

type Measure

type Measure interface {
	//Value from the measure
	Value() float64
}

Measure value of the measure

type Ring

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

Ring structure

func (*Ring) Capacity

func (r *Ring) Capacity() int

Capacity returns the capacity of ringbuffer

func (*Ring) Dequeue

func (r *Ring) Dequeue() Measure

Dequeue dequeues measure of the ring

func (*Ring) DumpLine

func (r *Ring) DumpLine() (string, error)

DumpLine return String of ring

func (*Ring) Enqueue

func (r *Ring) Enqueue(c TimeMeasure)

Enqueue enqueues measure of the ring

func (*Ring) SetCapacity

func (r *Ring) SetCapacity(size int)

SetCapacity fix the maximum capacity of the ring

func (*Ring) Values

func (r *Ring) Values() []TimeMeasure

Values return array of timeMeasure

type Time

type Time interface {
	//Timestamp from the measure
	TimeStamp() time.Time
}

Time is the timestamp of enqueue

type TimeMeasure

type TimeMeasure interface {
	Time
	Measure
}

TimeMeasure compose Time and Measure

Jump to

Keyboard shortcuts

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