Cast transcription comparison averages
All checks were successful
CI / test (push) Successful in 14s
Build and Deploy / build-and-deploy (push) Successful in 23s

This commit is contained in:
Grendgi
2026-06-09 15:01:32 +03:00
parent 35c60f0e0e
commit add15f1385

View File

@@ -652,9 +652,9 @@ SELECT
count(*) FILTER (WHERE item->>'provider' = winner_provider) AS wins, count(*) FILTER (WHERE item->>'provider' = winner_provider) AS wins,
count(*) FILTER (WHERE completed_at > NOW() - INTERVAL '24 hours') AS last_24h_attempts, count(*) FILTER (WHERE completed_at > NOW() - INTERVAL '24 hours') AS last_24h_attempts,
count(*) FILTER (WHERE completed_at > NOW() - INTERVAL '24 hours' AND item->>'status' = 'ok') AS last_24h_success, count(*) FILTER (WHERE completed_at > NOW() - INTERVAL '24 hours' AND item->>'status' = 'ok') AS last_24h_success,
COALESCE(avg(NULLIF(item->>'duration_ms', '')::bigint), 0) AS avg_duration_ms, COALESCE(avg(NULLIF(item->>'duration_ms', '')::bigint)::double precision, 0) AS avg_duration_ms,
COALESCE(percentile_cont(0.5) WITHIN GROUP (ORDER BY NULLIF(item->>'duration_ms', '')::bigint), 0) AS p50_duration_ms, COALESCE(percentile_cont(0.5) WITHIN GROUP (ORDER BY NULLIF(item->>'duration_ms', '')::bigint), 0) AS p50_duration_ms,
COALESCE(avg(length(COALESCE(item->>'text', ''))), 0) AS avg_text_chars, COALESCE(avg(length(COALESCE(item->>'text', '')))::double precision, 0) AS avg_text_chars,
max(completed_at) AS last_at max(completed_at) AS last_at
FROM attempts FROM attempts
WHERE COALESCE(item->>'provider', '') <> '' WHERE COALESCE(item->>'provider', '') <> ''