8 SUM(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - state_change))::bigint)::float AS process_idle_seconds_sum,
9 COUNT(*) AS process_idle_seconds_count
12 GROUP BY state, application_name
20 CASE WHEN EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - state_change)) <= le
27 UNNEST(ARRAY[1, 2, 5, 15, 30, 60, 90, 120, 300]) AS le
28 GROUP BY state, application_name, le
29 ORDER BY state, application_name, le
34 process_idle_seconds_sum as seconds_sum,
35 process_idle_seconds_count as seconds_count,
36 ARRAY_AGG(le) AS seconds,
37 ARRAY_AGG(bucket) AS seconds_bucket
38 FROM metrics JOIN buckets USING (state, application_name)
47 description: "Application Name"
50 description: "Idle time of server processes"
53 query: "SELECT count(*) AS segment_count FROM pg_ls_waldir() WHERE name ~ '^[0-9A-Z]{24}$'"
58 description: "Number of WAL segments"