fix: handle single data point in performance percentiles
This commit is contained in:
+1
-1
@@ -424,7 +424,7 @@ def performance():
|
||||
return jsonify({"models": [], "reasons": [], "agents": [], "summary": {"total_requests": 0}})
|
||||
|
||||
def pct(values, p):
|
||||
if not values: return 0
|
||||
if len(values) < 2: return round(values[0], 1) if values else 0
|
||||
return round(statistics.quantiles(sorted(values), n=100, method='inclusive')[min(p-1, 98)], 1)
|
||||
|
||||
# Per-model stats
|
||||
|
||||
Reference in New Issue
Block a user