-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathstatistics.sql
49 lines (31 loc) · 1.5 KB
/
statistics.sql
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--select * from jobs order by RunAt asc
select count(*), action
from workerlogs
--where action = 'QUERYLIST'
group by action
select
count(*) as total,
avg(datediff(millisecond, RunAt, ExecuteAt)) as avg_delay,
stdev(datediff(millisecond, RunAt, ExecuteAt)) as std_delay
from jobs
where State = 2 and RunAt < ExecuteAt
-------------------------------------------------------------------------------------------------------
--select * from jobs order by RunAt asc
select count(*) as count from workerlogs where action = 'CREATE'
select count(*) as count from workerlogs where action = 'ACQUIRE_SUCCESS'
select count(*) as count from workerlogs where action = 'ACQUIRE_FAILURE'
select count(*) as count from workerlogs where action = 'COMPLETE'
select count(*) as count from workerlogs where action = 'QUERYJOB'
select count(*) as count from workerlogs where action = 'QUERYLIST'
-- CREATE | ACQUIRE_SUCCESS | ACQUIRE_FAILURE | COMPLETE | QUERYJOB | QUERYLIST
--select
-- count(*) as total,
-- avg(datediff(millisecond, RunAt, ExecuteAt)) as avg_delay,
-- stdev(datediff(millisecond, RunAt, ExecuteAt)) as std_delay
--from jobs
--where State = 2 and RunAt < ExecuteAt
select count(*) as total from jobs where state = 0
select count(*) as total from jobs where state = 1
select count(*) as total from jobs where state = 2
select avg(datediff(millisecond, RunAt, ExecuteAt)) as average_delay from jobs where state = 2
select stdev(datediff(millisecond, RunAt, ExecuteAt)) as stdev_delay from jobs where state = 2