histogram

package
v7.3.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Histogram

type Histogram[T hvals] struct {
	Buckets []uint64 `json:"buckets"` // slot -> count
	Min     T        `json:"min"`
	Max     T        `json:"max"`
	Sum     float64  `json:"sum"`
	Count   uint64   `json:"count"`
	// contains filtered or unexported fields
}

func New

func New[T hvals](htype Type, base T, buckets int) *Histogram[T]

func NewExponential

func NewExponential[T hvals](base T, buckets int) *Histogram[T]

func NewLinear

func NewLinear[T hvals](base T, buckets int) *Histogram[T]

func (*Histogram[T]) Add

func (h *Histogram[T]) Add(v T)

func (*Histogram[T]) Average

func (h *Histogram[T]) Average() float64

func (*Histogram[T]) Clone

func (h *Histogram[T]) Clone() *Histogram[T]

func (*Histogram[T]) CloneAndReset

func (h *Histogram[T]) CloneAndReset() *Histogram[T]

func (*Histogram[T]) Median

func (h *Histogram[T]) Median() T

func (*Histogram[T]) Merge

func (h *Histogram[T]) Merge(other *Histogram[T]) error

func (*Histogram[T]) Reset

func (h *Histogram[T]) Reset()

func (*Histogram[T]) Reshape

func (h *Histogram[T]) Reshape(htype Type, base T, buckets int)

func (*Histogram[T]) String

func (h *Histogram[T]) String() string

type Log2

type Log2 struct {
	Buckets  []uint64 // slot -> count
	Min, Max uint64
	Sum      uint64
	Count    uint64
}

func NewLog2

func NewLog2(buckets int) *Log2

func (*Log2) Add

func (h *Log2) Add(v uint64)

func (*Log2) Clone

func (h *Log2) Clone() *Log2

func (*Log2) Diff

func (h *Log2) Diff(old *Log2) *Log2

func (*Log2) Median

func (h *Log2) Median() uint64

func (*Log2) Reset

func (h *Log2) Reset()

func (*Log2) String

func (h *Log2) String() string

type SyncHistogram

type SyncHistogram[T hvals] struct {
	Buckets []uint64 `json:"buckets"` // slot -> count
	Min     T        `json:"min"`
	Max     T        `json:"max"`
	Sum     float64  `json:"sum"`
	Count   uint64   `json:"count"`
	// contains filtered or unexported fields
}

func NewSync

func NewSync[T hvals](htype Type, base T, buckets int) *SyncHistogram[T]

func (*SyncHistogram[T]) Add

func (h *SyncHistogram[T]) Add(v T)

func (*SyncHistogram[T]) Average

func (h *SyncHistogram[T]) Average() float64

func (*SyncHistogram[T]) Clone

func (h *SyncHistogram[T]) Clone() *SyncHistogram[T]

func (*SyncHistogram[T]) CloneAndReset

func (h *SyncHistogram[T]) CloneAndReset() *SyncHistogram[T]

func (*SyncHistogram[T]) Median

func (h *SyncHistogram[T]) Median() T

func (*SyncHistogram[T]) Merge

func (h *SyncHistogram[T]) Merge(other *SyncHistogram[T]) error

func (*SyncHistogram[T]) Reset

func (h *SyncHistogram[T]) Reset()

func (*SyncHistogram[T]) Reshape

func (h *SyncHistogram[T]) Reshape(htype Type, base T, buckets int)

func (*SyncHistogram[T]) String

func (h *SyncHistogram[T]) String() string

type Type

type Type byte
const (
	Linear Type = iota
	Logarithmic
)

Jump to

Keyboard shortcuts

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