Skip to content

Commit 05625d3

Browse files
authored
[HUD] Enhance queue time visualization with color coding and sorting (#6985)
Adds correct sorting by default & color coding. Before: <img width="688" height="392" alt="image" src="https://github.com/user-attachments/assets/b7682b74-8736-463c-8c37-3ebd7317149e" /> After: <img width="698" height="377" alt="image" src="https://github.com/user-attachments/assets/9ab82a9b-1cb2-4dfe-ba76-f0af40ea5da8" />
1 parent 4eb9d0c commit 05625d3

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

torchci/pages/metrics.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,33 @@ export default function Page() {
813813
headerName: "Queue time",
814814
flex: 1,
815815
valueFormatter: (params: number) => durationDisplay(params),
816+
cellClassName: (params) => {
817+
const queueTimeHours = params.value / 3600;
818+
if (queueTimeHours >= 4) return "queue-time-red";
819+
if (queueTimeHours >= 1) return "queue-time-yellow";
820+
return "";
821+
},
816822
},
817823
{ field: "machine_type", headerName: "Machine Type", flex: 4 },
818824
]}
819-
dataGridProps={{ getRowId: (el: any) => el.machine_type }}
825+
dataGridProps={{
826+
getRowId: (el: any) => el.machine_type,
827+
initialState: {
828+
sorting: {
829+
sortModel: [{ field: "avg_queue_s", sort: "desc" }],
830+
},
831+
},
832+
sx: {
833+
"& .queue-time-yellow": {
834+
backgroundColor: "#B8860B", // Dark goldenrod
835+
color: "white",
836+
},
837+
"& .queue-time-red": {
838+
backgroundColor: "#B22222", // Fire brick red
839+
color: "white",
840+
},
841+
},
842+
}}
820843
/>
821844
</Grid2>
822845

0 commit comments

Comments
 (0)