Skip to content

Commit

Permalink
Show profile info on the UI
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Nov 14, 2024
1 parent 1637c54 commit 86aee25
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/exec/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;`)
Expand Down
15 changes: 15 additions & 0 deletions website/src/pages/StatusPage/components/ExecutionQueue/Columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExecutionQueueExecution>[] = [
Expand Down Expand Up @@ -73,4 +75,17 @@ export const columns: ColumnDef<ExecutionQueueExecution>[] = [
);
},
},
{
header: "Profile",
accessorKey: "profile_binary",
cell: ({row}) => {
if (row.original.profile_mode !== "" && row.original.profile_binary !== "") {
return (
<div>
<Badge variant={"progress"}>{row.original.profile_binary}|{row.original.profile_mode}</Badge>
</div>
)
}
}
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -170,6 +172,19 @@ export const columns: ColumnDef<PreviousExecutionExecution>[] = [
return value.includes(row.getValue(id));
},
},
{
header: "Profile",
accessorKey: "profile_binary",
cell: ({row}) => {
if (row.original.profile_mode !== "" && row.original.profile_binary !== "") {
return (
<div>
<Badge variant={"progress"}>{row.original.profile_binary}|{row.original.profile_mode}</Badge>
</div>
)
}
}
},
{
id: "actions",
cell: ({ row }) => {
Expand Down

0 comments on commit 86aee25

Please sign in to comment.