scaleobs

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDurationBuckets = []time.Duration{
	5 * time.Millisecond,
	10 * time.Millisecond,
	25 * time.Millisecond,
	50 * time.Millisecond,
	100 * time.Millisecond,
	250 * time.Millisecond,
	500 * time.Millisecond,
	time.Second,
	5 * time.Second,
}

Functions

func Add

func Add(m *expvar.Map, key string, delta int64)

func IntValue

func IntValue(v expvar.Var) int64

func Key

func Key(in string) string

func MarkWarmStart added in v0.6.12

func MarkWarmStart(ctx context.Context)

MarkWarmStart marks the create running under ctx as warm. A ctx without a marker (a create that is not measured) is left alone.

func Set

func Set(m *expvar.Map, key string, value int64)

func WithWarmStart added in v0.6.12

func WithWarmStart(ctx context.Context) (context.Context, *atomic.Bool)

WithWarmStart returns ctx carrying a fresh warm marker, and the marker.

Types

type DurationBuckets

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

func NewDurationBuckets

func NewDurationBuckets(name string, bounds ...time.Duration) *DurationBuckets

func (*DurationBuckets) Count

func (b *DurationBuckets) Count() int64

func (*DurationBuckets) Observe

func (b *DurationBuckets) Observe(elapsed time.Duration)

func (*DurationBuckets) Value

func (b *DurationBuckets) Value(label string) int64

type NestedDurationBuckets added in v0.5.6

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

NestedDurationBuckets is a two-level expvar histogram: the outer map key is a caller label (e.g. create stage name) and inner keys are le_* buckets. The observability scraper emits these as key/key2 Prometheus labels.

func NewNestedDurationBuckets added in v0.5.6

func NewNestedDurationBuckets(name string, bounds ...time.Duration) *NestedDurationBuckets

func (*NestedDurationBuckets) Observe added in v0.5.6

func (n *NestedDurationBuckets) Observe(label string, elapsed time.Duration)

func (*NestedDurationBuckets) Value added in v0.5.6

func (n *NestedDurationBuckets) Value(label, bucket string) int64

Value returns the bucket count for a label pair (tests and diagnostics).

Jump to

Keyboard shortcuts

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