1
0
Fork 0
llvm-premerge-checks/scripts/metrics/SQL_queries/server_statistics.pgsql
2021-12-14 11:40:34 +01:00

7 lines
No EOL
321 B
PL/PgSQL

/* get server uptime statistics in percent */
SELECT DATE(timestamp) as date,
count(*) as measurements,
(100.0*count(CASE WHEN phabricator THEN 1 END)/count(*)) as phabricator_up_prcnt,
(100.0*count(CASE WHEN buildbot THEN 1 END)/count(*)) as buildbot_up_prcnt
FROM server_status GROUP BY date ORDER BY date ASC;