Files
mtusi2026lab7/backend/db/sqlc/queries/observability.sql
T
rey eb1b5c7b84
Skeleton contracts / contracts (pull_request) Canceled after 0s
Prepare verified laboratory 7 implementation and evidence
2026-11-17 17:32:06 +03:00

6 lines
322 B
SQL

-- name: PipelineMetrics :one
SELECT count(*)::bigint AS depth,
COALESCE(EXTRACT(EPOCH FROM clock_timestamp()-min(j.created_at)),0)::float8 AS oldest
FROM attachments a JOIN attachment_jobs j ON j.attachment_id=a.id AND j.pipeline_version=a.pipeline_version
WHERE a.status IN ('queued','processing') AND NOT j.completed;