-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdump_status_stats.sh
More file actions
executable file
·30 lines (26 loc) · 1.06 KB
/
dump_status_stats.sh
File metadata and controls
executable file
·30 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
OUT=www/status_stats.txt
set -e
psql cfbot -c "select branch_name,
status as build_status,
avg_elapsed,
stddev_elapsed,
n
from build_status_statistics
where status in ('CREATED', 'TRIGGERED', 'SCHEDULED', 'EXECUTING')
order by branch_name,
array_position(array['CREATED', 'TRIGGERED', 'SCHEDULED', 'EXECUTING'],
status)" > $OUT.tmp
psql cfbot -c "select branch_name,
task_name,
status as task_status,
avg_elapsed,
stddev_elapsed,
n
from task_status_statistics
where status in ('CREATED', 'TRIGGERED', 'SCHEDULED', 'EXECUTING')
order by branch_name,
task_name,
array_position(array['CREATED', 'TRIGGERED', 'SCHEDULED', 'EXECUTING'],
status)" >> $OUT.tmp
mv $OUT.tmp $OUT