sample

package
v2.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSampleTable

func NewSampleTable() *sampleTable

Types

type Metric

type Metric struct {
	Count float64
	Last  float64
	Min   float64
	Max   float64
	Sum   float64
}

Metric is a simple counter like metric with its summary stats bundled in

func NewMetric

func NewMetric(value float64) Metric

func (*Metric) Add

func (m *Metric) Add(d float64)

func (*Metric) AddMetric

func (m *Metric) AddMetric(m2 Metric)

type Sample

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

func NewSample

func NewSample(keySize int, metricsSize int) Sample

func (*Sample) AddHitCount

func (s *Sample) AddHitCount(hitCount int)

func (*Sample) AddSample

func (s *Sample) AddSample(other *Sample) error

func (*Sample) HitCount

func (s *Sample) HitCount() int

func (*Sample) Key

func (s *Sample) Key() *SampleKey

func (*Sample) Metric

func (s *Sample) Metric(i int) (Metric, error)

func (*Sample) Metrics

func (s *Sample) Metrics() []Metric

func (*Sample) SetMetric

func (s *Sample) SetMetric(metricIndex int, value float64) error

type SampleKey

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

SampleTableKey is composite key which is constructed from multiple integers. Each key part integer is encoded into byte array with bit size accuracy.

func NewSampleKey

func NewSampleKey(size int) SampleKey

func (*SampleKey) AddKeyPart

func (s *SampleKey) AddKeyPart(keyPart int, keyBitSize int) error

func (*SampleKey) AsByteKey

func (s *SampleKey) AsByteKey() []byte

func (*SampleKey) AsStringKey

func (s *SampleKey) AsStringKey() string

func (*SampleKey) GetKeyParts

func (s *SampleKey) GetKeyParts(partSizes []int) []int

func (*SampleKey) SetKeyPart

func (s *SampleKey) SetKeyPart(keyPart int, keyBitSize int, keyStartPosition int)

Jump to

Keyboard shortcuts

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