Skip to content

Commit

Permalink
[CH] Migrate number_of_force_pushes_historical KPI (#5883)
Browse files Browse the repository at this point in the history
Just migrate this straight to CH and compare the chart manually with HUD
  • Loading branch information
huydhn authored Nov 8, 2024
1 parent b20bd8d commit 0336c48
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"granularity": "String",
"startTime": "DateTime64(3)",
"stopTime": "DateTime64(3)"
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
-- !!! Query is not converted to CH syntax yet. Delete this line when it gets converted
-- This is used by KPI pages to get the number of force pushes
SELECT
FORMAT_TIMESTAMP('%Y-%m-%d', DATE_TRUNC(:granularity, issue_comment.created)) AS bucket,
formatDateTime(
DATE_TRUNC({granularity: String }, issue_comment.created_at),
'%Y-%m-%d'
) AS bucket,
COUNT(DISTINCT issue_comment.issue_url) AS count
FROM
commons.issue_comment
default .issue_comment FINAL
WHERE
issue_comment.body LIKE '%@pytorchbot merge -f%'
AND created >= PARSE_DATETIME_ISO8601(:startTime)
AND created < PARSE_DATETIME_ISO8601(:stopTime)
AND created_at >= {startTime: DateTime64(3) }
AND created_at < {stopTime: DateTime64(3) }
AND issue_comment.user.login NOT LIKE '%pytorch-bot%'
AND issue_comment.user.login NOT LIKE '%facebook-github-bot%'
AND issue_comment.user.login NOT LIKE '%pytorchmergebot%'
Expand Down
3 changes: 2 additions & 1 deletion torchci/pages/kpis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ export default function Kpis() {
title={"# of force merges (Weekly)"}
queryName={"number_of_force_pushes_historical"}
queryCollection={"pytorch_dev_infra_kpis"}
queryParams={[...timeParams]}
queryParams={clickhouseTimeParams}
granularity={"week"}
timeFieldName={"bucket"}
yAxisFieldName={"count"}
yAxisRenderer={(unit) => `${unit}`}
useClickHouse={true}
/>
</Grid>

Expand Down

0 comments on commit 0336c48

Please sign in to comment.