Documentation
¶
Overview ¶
Package threshold provides CEL-based evaluation of performance thresholds. Threshold expressions use a single `value` variable (float64) and must return a boolean. Example: "value >= 900".
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Registry = []Definition{
{Key: "busBandwidthGBps", Unit: "GB/s", Description: "Bus bandwidth (from BandwidthMeasurement)"},
{Key: "algBandwidthGBps", Unit: "GB/s", Description: "Algorithm bandwidth (from BandwidthMeasurement)"},
{Key: "goodputRatio", Unit: "ratio (0-1)", Description: "Goodput ratio (from GoodputMeasurement)"},
{Key: "avgTFLOPsPerGPU", Unit: "TFLOPS", Description: "Average TFLOPS per GPU (from GoodputMeasurement)"},
{Key: "avgStepTimeSec", Unit: "seconds", Description: "Average step time (from GoodputMeasurement)"},
}
Registry lists all known threshold keys. Unknown keys are rejected by ValidateKeys.
Functions ¶
func Evaluate ¶
Evaluate compiles and evaluates a CEL expression with the measured value. Returns true if the threshold is satisfied (expression returns true), false if violated (expression returns false). Returns an error if the expression fails to compile or evaluate.
func ValidateKeys ¶
ValidateKeys returns any keys in thresholds that are not in the Registry.
Types ¶
type Definition ¶
type Definition struct {
// Key is the camelCase metric name with unit suffix.
Key string
// Unit is the human-readable unit for display (e.g., "GB/s", "seconds").
Unit string
// Description is a short help text for the metric.
Description string
}
Definition describes a known threshold key.
Click to show internal directories.
Click to hide internal directories.