From 86aee255fae883e860e47281e0bdadfc67e5c94a Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 14 Nov 2024 16:34:43 -0600 Subject: [PATCH] Show profile info on the UI Signed-off-by: Florent Poinsard --- go/exec/status.go | 2 +- .../components/ExecutionQueue/Columns.tsx | 15 +++++++++++++++ .../components/ExecutionQueue/Execution.tsx | 2 ++ .../components/PreviousExecutions/Columns.tsx | 15 +++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/go/exec/status.go b/go/exec/status.go index a13613d66..87050c587 100644 --- a/go/exec/status.go +++ b/go/exec/status.go @@ -42,7 +42,7 @@ func GetBenchmarkStats(client storage.SQLClient) (BenchmarkStats, error) { (SELECT COUNT(uuid) FROM execution) AS count_status, (SELECT COUNT(DISTINCT git_ref) FROM execution) AS count_commits, (SELECT COUNT(*) FROM execution WHERE started_at >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)) AS count_all, - (SELECT AVG(TIMESTAMPDIFF(MINUTE, started_at, finished_at)) AS avg_duration_minutes FROM execution WHERE started_at IS NOT NULL AND finished_at IS NOT NULL AND status NOT IN ('failed', 'started') ORDER BY avg_duration_minutes ASC) AS avg_duration_minutes + (SELECT IFNULL(AVG(TIMESTAMPDIFF(MINUTE, started_at, finished_at)), 0) AS avg_duration_minutes FROM execution WHERE profile_binary IS NULL AND started_at IS NOT NULL AND finished_at IS NOT NULL AND status NOT IN ('failed', 'started') ORDER BY avg_duration_minutes ASC) AS avg_duration_minutes FROM execution LIMIT 1;`) diff --git a/website/src/pages/StatusPage/components/ExecutionQueue/Columns.tsx b/website/src/pages/StatusPage/components/ExecutionQueue/Columns.tsx index 4353e437c..94e72d61e 100644 --- a/website/src/pages/StatusPage/components/ExecutionQueue/Columns.tsx +++ b/website/src/pages/StatusPage/components/ExecutionQueue/Columns.tsx @@ -29,6 +29,8 @@ export type ExecutionQueueExecution = { git_ref: string; workload: string; pull_nb: number; + profile_binary: string; + profile_mode: string; }; export const columns: ColumnDef[] = [ @@ -73,4 +75,17 @@ export const columns: ColumnDef[] = [ ); }, }, + { + header: "Profile", + accessorKey: "profile_binary", + cell: ({row}) => { + if (row.original.profile_mode !== "" && row.original.profile_binary !== "") { + return ( +
+ {row.original.profile_binary}|{row.original.profile_mode} +
+ ) + } + } + }, ]; diff --git a/website/src/pages/StatusPage/components/ExecutionQueue/Execution.tsx b/website/src/pages/StatusPage/components/ExecutionQueue/Execution.tsx index 5611edde5..88b918cbe 100644 --- a/website/src/pages/StatusPage/components/ExecutionQueue/Execution.tsx +++ b/website/src/pages/StatusPage/components/ExecutionQueue/Execution.tsx @@ -63,6 +63,8 @@ export default function ExecutionQueue() { git_ref: value.git_ref, workload: value.workload, pull_nb: value.pull_nb, + profile_binary: value.profile_binary, + profile_mode: value.profile_mode, }; }); diff --git a/website/src/pages/StatusPage/components/PreviousExecutions/Columns.tsx b/website/src/pages/StatusPage/components/PreviousExecutions/Columns.tsx index a73fef646..942f4bb09 100644 --- a/website/src/pages/StatusPage/components/PreviousExecutions/Columns.tsx +++ b/website/src/pages/StatusPage/components/PreviousExecutions/Columns.tsx @@ -35,6 +35,8 @@ export type PreviousExecutionExecution = { golang_version: string; started_at: string; finished_at: string; + profile_binary: string; + profile_mode: string; }; export type PreviousExecution = { @@ -170,6 +172,19 @@ export const columns: ColumnDef[] = [ return value.includes(row.getValue(id)); }, }, + { + header: "Profile", + accessorKey: "profile_binary", + cell: ({row}) => { + if (row.original.profile_mode !== "" && row.original.profile_binary !== "") { + return ( +
+ {row.original.profile_binary}|{row.original.profile_mode} +
+ ) + } + } + }, { id: "actions", cell: ({ row }) => {