forked from kubernetes/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-stats.yaml
33 lines (32 loc) · 843 Bytes
/
build-stats.yaml
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
metric: build-stats
description: Calculate the number of builds started and passed each day
query: |
#standardSQL
select
unix_seconds(day) day,
invocations,
passes,
if (invocations > 0, passes / invocations, 1) rate
from (
SELECT
timestamp_trunc(started, day) day,
COUNT(started) invocations,
countif(result = 'SUCCESS') passes
FROM
`kubernetes-public.k8s_infra_kettle.all`
where
started >= TIMESTAMP_SECONDS(<LAST_DATA_TIME>)
and started < timestamp_trunc(current_timestamp(), day)
group by day
order by day
)
where day is not null
order by day
jqfilter: |
([(.[] | .day|tonumber)] | max) as $newestday |
[(.[] | select((.day|tonumber)==$newestday) | {
day: .day,
invocations: (.invocations|tonumber),
passes: (.passes|tonumber),
rate: (.rate|tonumber)
})]