Documentation
¶
Overview ¶
Package spec is what a vis declaration means, in one place: which measures are latencies, and which vis types hold latencies. The library's checks, vis gen and vis vet all read it, so they can't disagree; a test in vis ties the library's own measures to it.
Index ¶
Constants ¶
const LevelTrace = slog.LevelDebug - 4
LevelTrace is the level vis calls TRACE. slog has none; DEBUG-4 is the usual one (Ollama's, among others), so a range down to it reads as TRACE..ERROR instead of an offset nobody chose.
const MinDurationStep = time.Microsecond
MinDurationStep is the smallest step or drift that reads as meant on a Duration knob: below it, a bare number was almost surely meant in another unit, since a Duration knob counts nanoseconds.
const RouteP99 = Latency
RouteP99 is a route's p99, vis.RouteP99: a latency.
Variables ¶
var Measures = []Measure{ {"sched.p99", "SchedP99", Latency}, {"gc.cpu", "GCCPU", Number}, {"cpu.throttled", "CPUThrottled", Number}, {"cpu.used", "CPUUsed", Number}, {"goroutines", "Goroutines", Number}, }
Measures are vis's ready-made measures.
Functions ¶
func LevelName ¶
LevelName is how people and agents see a log level: TRACE, DEBUG, INFO, WARN or ERROR, with an offset for one in between, as slog writes it.
func Lurch ¶
Lurch is the first step of a rule's fixed step that cuts its knob by more than half: the value before and after it, as the rule steps from the knob's default def toward the end of its reach (drift, by default four steps, and no lower than lo). Sizes, counts and concurrency respond to ratios, so a fixed step gets harsher near the bottom of the range: -16 takes 64 to 48 but 16 to 1. A step that grows the knob, or a knob whose range reaches below zero, where a value isn't a size, never lurches.
Types ¶
type Kind ¶
type Kind int
Kind is what a measure or a threshold is: a latency (milliseconds, written as a time.Duration) or a plain number.
type Measure ¶
type Measure struct {
Name string // as a rule's when= names it: sched.p99
Var string // the vis variable: SchedP99
Kind Kind
}
Measure is one of vis's ready-made measures.
func MeasureNamed ¶
MeasureNamed is the ready-made measure a rule's when= names, if any.
func MeasureVar ¶
MeasureVar is the ready-made measure a vis variable holds, if any.