Add matched training signals, daily recovery and performance analysis
This commit is contained in:
+11
-1
@@ -8,6 +8,7 @@ import statistics
|
||||
from .stats_dsl import UNITS, QueryError, parse_dsl
|
||||
|
||||
FUNCTIONS = {
|
||||
"latest",
|
||||
"sum",
|
||||
"mean",
|
||||
"weighted_mean",
|
||||
@@ -134,6 +135,13 @@ EXTRA_UNITS = {
|
||||
}
|
||||
|
||||
|
||||
from .training_metrics import METRICS as TRAINING_METRICS
|
||||
from .training_metrics import UNITS as TRAINING_UNITS
|
||||
|
||||
EXTRA_METRICS.update(TRAINING_METRICS)
|
||||
EXTRA_UNITS.update(TRAINING_UNITS)
|
||||
|
||||
|
||||
def valid(value):
|
||||
return isinstance(value, (int, float)) and not isinstance(value, bool) and math.isfinite(value)
|
||||
|
||||
@@ -261,7 +269,7 @@ def parse_analysis(text, metrics, defaults):
|
||||
function, field = match.groups()
|
||||
if function not in FUNCTIONS or (not field and function != "count"):
|
||||
raise QueryError(
|
||||
"Use sum, mean, weighted_mean, median, min, max, stddev, count or p10/p25/p75/p90/p95/p99.",
|
||||
"Use latest, sum, mean, weighted_mean, median, min, max, stddev, count or p10/p25/p75/p90/p95/p99.",
|
||||
line,
|
||||
)
|
||||
if field and field not in catalog:
|
||||
@@ -531,6 +539,8 @@ def describe(key, catalog, aggregates):
|
||||
)
|
||||
+ ". Percentiles use linear interpolation; stddev is population standard deviation. Missing values are excluded."
|
||||
)
|
||||
if function == "latest":
|
||||
definition = "Value on the latest input by local date/time, including a missing value on that input. Sorting does not change which input is latest."
|
||||
return label, unit, definition
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user