Skip to content

Commit fbbfed8

Browse files
macdiceCommitfest Bot
authored andcommitted
Use real master branch statistics.
Only one sample so far (have to watch all the state transitions to gather the timings, so no ability to backfill the data), but no need to use the "dirty" patched branches. The stddev is 0 for now but hopefully in a day or so... I should probably go and commit more patches in the postgresql repo...
1 parent 43e5939 commit fbbfed8

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

cfbot_cirrus.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -927,18 +927,17 @@ def refresh_task_status_statistics(conn):
927927
"""delete from task_status_history where sent < now() - interval '30 days'"""
928928
)
929929
cursor.execute("""delete from task_status_statistics""")
930-
# XXX waiting for more data before removing hard coded 'master' from here...
931930
cursor.execute("""insert into task_status_statistics
932931
(branch_name, task_name, status, avg_elapsed, stddev_elapsed, n)
933-
with elapsed as (select coalesce('master', build.branch_name) as branch_name,
932+
with elapsed as (select build.branch_name as branch_name,
934933
task.task_name,
935934
h.status,
936935
lead(h.sent) over(partition by h.task_id order by h.sent) - h.sent as elapsed
937936
from build
938937
join task using (build_id)
939938
join task_status_history h using (task_id)
940939
where task.status = 'COMPLETED'
941-
--- and (build.branch_name = 'master' or build.branch_name like 'REL_%%')
940+
and (build.branch_name = 'master' or build.branch_name like 'REL_%%')
942941
)
943942
select branch_name,
944943
task_name,
@@ -948,8 +947,7 @@ def refresh_task_status_statistics(conn):
948947
count(elapsed) as n
949948
from elapsed
950949
where elapsed is not null
951-
group by 1, 2, 3
952-
--- having count(*) > 1""")
950+
group by 1, 2, 3""")
953951

954952

955953
def refresh_build_status_statistics(conn):
@@ -960,13 +958,13 @@ def refresh_build_status_statistics(conn):
960958
cursor.execute("""delete from build_status_statistics""")
961959
cursor.execute("""insert into build_status_statistics
962960
(branch_name, status, avg_elapsed, stddev_elapsed, n)
963-
with elapsed as (select coalesce('master', build.branch_name) as branch_name,
961+
with elapsed as (select build.branch_name as branch_name,
964962
h.status,
965963
lead(received) over (partition by h.build_id order by received) - received as elapsed
966964
from build_status_history h
967965
join build using (build_id)
968966
where build.status = 'COMPLETED'
969-
--- and (build.branch_name = 'master' or build.branch_name like 'REL_%%')
967+
and (build.branch_name = 'master' or build.branch_name like 'REL_%%')
970968
)
971969
select branch_name,
972970
status,
@@ -975,8 +973,7 @@ def refresh_build_status_statistics(conn):
975973
count(elapsed) as n
976974
from elapsed
977975
where elapsed is not null
978-
group by 1, 2
979-
--- having count(*) > 1""")
976+
group by 1, 2""")
980977

981978

982979
if __name__ == "__main__":

0 commit comments

Comments
 (0)