Skip to main content

TOTALS_SQL

Constant TOTALS_SQL 

Source
pub const TOTALS_SQL: &str = "
SELECT count(*)                                AS calls,
       count(*) FILTER (WHERE status <> 'ok')  AS errors,
       count(DISTINCT person)                  AS persons,
       coalesce(sum(result_tokens), 0)::BIGINT AS result_tokens,
       coalesce(sum(context_cost_usd), 0)      AS context_cost_usd
FROM mcp_events
WHERE ts >= $1 AND ts <= $2";
Expand description

Window totals for the admin summary strip.