sample

package
v2.47.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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