From 0ed6f603d7b137294399bb1dd6174d54d7edbe1a Mon Sep 17 00:00:00 2001 From: Brian Carey Date: Mon, 30 Sep 2024 14:47:03 +0100 Subject: [PATCH] Update time to merge badge from days to hours Thanks to improvements over the last few months the average time to merge is no longer mulitple days but now can be measured in hours. This change only updates the badge to display the time to merge in hours rather than days. The underlying data has not been changed as to keep the historical results and graphs consistent. Signed-off-by: Brian Carey --- pkg/constants/main.go | 2 +- pkg/output/output.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/constants/main.go b/pkg/constants/main.go index 873eec88c4..a787208f41 100644 --- a/pkg/constants/main.go +++ b/pkg/constants/main.go @@ -49,7 +49,7 @@ const ( PlotFileName = "plot.png" MetricsFileName = "metrics" - TimeToMergeBadgeName = "days to merge" + TimeToMergeBadgeName = "hours to merge" MergeQueueLengthBadgeName = "avg merge queue length" RetestsToMergeBadgeName = "retests to merge" MergedPRsBadgeName = "merged PRs" diff --git a/pkg/output/output.go b/pkg/output/output.go index 8d8c4d198e..33a0b18d3a 100644 --- a/pkg/output/output.go +++ b/pkg/output/output.go @@ -184,6 +184,9 @@ func (b *Handler) writeBadge(name, filePath string, data types.RunningAverageDat if name == constants.MergedPRsNoRetestBadgeName { badgeString = data.SimpleBadgeString() } + if name == constants.TimeToMergeBadgeName { + badgeString = fmt.Sprintf("%.2f ± std %.2f", (data.Avg * 24), (data.Std * 24)) + } err = badge.Render(name, badgeString, color, f) return err