Prepare verified laboratory 6 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 470d9d6f1e
commit 7d56e52fd0
335 changed files with 31206 additions and 72 deletions
+11
View File
@@ -0,0 +1,11 @@
-- name: ReadySLI :one
WITH clock AS (SELECT clock_timestamp() AS now), cohort AS (
SELECT a.accepted_at,a.first_ready_at,c.now FROM attachments a CROSS JOIN clock c
WHERE a.accepted_at>c.now-interval '310 seconds' AND a.accepted_at<=c.now-interval '10 seconds'
)
SELECT count(*) FILTER(WHERE accepted_at>now-interval '20 seconds')::bigint AS matured10,
count(*) FILTER(WHERE accepted_at>now-interval '20 seconds' AND first_ready_at>=accepted_at AND first_ready_at<=accepted_at+interval '10 seconds')::bigint AS timely10,
count(*) FILTER(WHERE accepted_at>now-interval '40 seconds')::bigint AS matured30,
count(*) FILTER(WHERE accepted_at>now-interval '40 seconds' AND first_ready_at>=accepted_at AND first_ready_at<=accepted_at+interval '10 seconds')::bigint AS timely30,
count(*)::bigint AS matured300,
count(*) FILTER(WHERE first_ready_at>=accepted_at AND first_ready_at<=accepted_at+interval '10 seconds')::bigint AS timely300 FROM cohort;