seriesgen

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(ctx context.Context, goroutines int, appendable storage.Appendable, series SeriesSet) error

Types

type Characteristics

type Characteristics struct {
	Jitter         float64       `yaml:"jitter"`
	ScrapeInterval time.Duration `yaml:"scrapeInterval"`
	ChangeInterval time.Duration `yaml:"changeInterval"`
	Max            float64       `yaml:"max"`
	Min            float64       `yaml:"min"`
}

type CounterGen

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

TODO(bwplotka): Improve. Does not work well (: Too naive. Add resets etc.

func NewCounterGen

func NewCounterGen(random *rand.Rand, mint, maxt int64, opts Characteristics) *CounterGen

func (*CounterGen) At

func (g *CounterGen) At() (int64, float64)

func (*CounterGen) Err

func (g *CounterGen) Err() error

func (*CounterGen) Next

func (g *CounterGen) Next() bool

type GaugeGen

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

func NewGaugeGen

func NewGaugeGen(random *rand.Rand, mint, maxt int64, opts Characteristics) *GaugeGen

func (*GaugeGen) At

func (g *GaugeGen) At() (t int64, v float64)

func (*GaugeGen) Err

func (g *GaugeGen) Err() error

func (*GaugeGen) Next

func (g *GaugeGen) Next() bool

type Series

type Series interface {
	// Labels returns the complete set of labels identifying the series.
	Labels() labels.Labels

	// Iterator returns a new iterator of the data of the series.
	// TODO(bwplotka): Consider moving this to tsdb.SeriesIterator if required. This means adding `Seek` method.
	Iterator() SeriesIterator
}

Series exposes a single time series.

type SeriesGen

type SeriesGen struct {
	SeriesIterator
	// contains filtered or unexported fields
}

func NewSeriesGen

func NewSeriesGen(lset labels.Labels, si SeriesIterator) *SeriesGen

func (*SeriesGen) Iterator

func (s *SeriesGen) Iterator() SeriesIterator

func (*SeriesGen) Labels

func (s *SeriesGen) Labels() labels.Labels

type SeriesIterator

type SeriesIterator interface {
	// At returns the current timestamp/value pair.
	At() (t int64, v float64)
	// Next advances the iterator by one.
	Next() bool
	// Err returns current error.
	Err() error
}

SeriesIterator iterates over the data of a time series. Simplified version of github.com/prometheus/prometheus/tsdb.SeriesIterator

type SeriesSet

type SeriesSet interface {
	Next() bool
	At() Series
	Err() error
}

SeriesSet contains a set of series.

type ValGen

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

func NewValGen

func NewValGen(random *rand.Rand, mint, maxt int64, opts Characteristics) *ValGen

func (*ValGen) At

func (g *ValGen) At() (t int64, v float64)

func (*ValGen) Err

func (g *ValGen) Err() error

func (*ValGen) Next

func (g *ValGen) Next() bool

Jump to

Keyboard shortcuts

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