Skip to content

Commit a5098b9

Browse files
committed
format
1 parent 02a3d89 commit a5098b9

File tree

4 files changed

+32
-26
lines changed

4 files changed

+32
-26
lines changed

torchci/components/metrics/vllm/CiStabilityTrendPanel.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
getCrosshairTooltipConfig,
88
GRID_DEFAULT,
99
} from "./chartUtils";
10-
import { COLOR_SUCCESS, COLOR_ERROR, COLOR_WARNING } from "./constants";
10+
import { COLOR_ERROR, COLOR_SUCCESS, COLOR_WARNING } from "./constants";
1111

1212
interface TrunkHealthData {
1313
build_started_at: string;
@@ -33,8 +33,7 @@ function calculateStabilityScore(healthValues: number[]): number {
3333

3434
// Calculate penalties
3535
const volatilityPenalty = volatility * 50;
36-
const transitionPenalty =
37-
Math.min(transitions / healthValues.length, 1) * 50;
36+
const transitionPenalty = Math.min(transitions / healthValues.length, 1) * 50;
3837

3938
// Return score as percentage (0-1)
4039
return Math.max(0, 100 - volatilityPenalty - transitionPenalty) / 100;
@@ -51,7 +50,9 @@ function formatTooltip(params: any, stabilityData: any[]): string {
5150
if (!data) return "";
5251

5352
let result = `<b>${date}</b><br/>`;
54-
result += `${params[0].marker} Stability Score: <b>${(data.score * 100).toFixed(1)}%</b><br/>`;
53+
result += `${params[0].marker} Stability Score: <b>${(
54+
data.score * 100
55+
).toFixed(1)}%</b><br/>`;
5556
result += `<span style="color: #999; font-size: 0.85em;">`;
5657
result += `Volatility: ${(data.volatility * 100).toFixed(1)}% | `;
5758
result += `Transitions: ${data.transitions}`;

torchci/components/metrics/vllm/ContinuousBuildTracker.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,11 @@ export default function ContinuousBuildTracker({
109109
// Fetch failed jobs for selected build
110110
const { data: failedJobsData } = useClickHouseAPIImmutable(
111111
"vllm/build_failed_jobs",
112-
selectedBuildNumber !== null
113-
? {
114-
repo: VLLM_REPO_URL,
115-
pipelineName: PIPELINE_NAME,
116-
buildNumber: selectedBuildNumber,
117-
}
118-
: null,
112+
{
113+
repo: VLLM_REPO_URL,
114+
pipelineName: PIPELINE_NAME,
115+
buildNumber: selectedBuildNumber || 0,
116+
},
119117
selectedBuildNumber !== null
120118
);
121119

torchci/components/metrics/vllm/JobBuildsPanel.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ interface RecentBuildData {
5353
duration_hours: number | null;
5454
}
5555

56-
type JobSortField = "job_name" | "total_runs" | "passed_count" | "failed_count";
56+
type JobSortField =
57+
| "job_name"
58+
| "total_runs"
59+
| "passed_count"
60+
| "failed_count"
61+
| "last_run_at";
5762
type SortOrder = "asc" | "desc";
5863

5964
// Helper function to format duration
@@ -117,14 +122,12 @@ export default function JobBuildsPanel({
117122
// Fetch recent builds for selected job
118123
const { data: recentBuildsData } = useClickHouseAPIImmutable(
119124
"vllm/recent_job_builds",
120-
selectedJob
121-
? {
122-
...timeParams,
123-
repo: VLLM_REPO_URL,
124-
pipelineName: PIPELINE_NAME,
125-
jobName: selectedJob,
126-
}
127-
: null,
125+
{
126+
...timeParams,
127+
repo: VLLM_REPO_URL,
128+
pipelineName: PIPELINE_NAME,
129+
jobName: selectedJob || "",
130+
},
128131
selectedJob !== null
129132
);
130133

torchci/pages/metrics/vllm.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import CommitsOnRedTrendPanel from "components/metrics/vllm/CommitsOnRedTrendPan
1717
import ContinuousBuildTracker from "components/metrics/vllm/ContinuousBuildTracker";
1818
import DockerBuildRuntimePanel from "components/metrics/vllm/DockerBuildRuntimePanel";
1919
import DurationDistributionPanel from "components/metrics/vllm/DurationDistributionPanel";
20+
import JobBuildsPanel from "components/metrics/vllm/JobBuildsPanel";
2021
import JobGroupFilter, {
2122
JobGroup,
2223
} from "components/metrics/vllm/JobGroupFilter";
23-
import JobBuildsPanel from "components/metrics/vllm/JobBuildsPanel";
2424
import JobReliabilityPanel from "components/metrics/vllm/JobReliabilityPanel";
2525
import JobRuntimePanel from "components/metrics/vllm/JobRuntimePanel";
2626
import MergesPanel from "components/metrics/vllm/MergesPanel";
@@ -604,7 +604,7 @@ export default function Page() {
604604
? undefined
605605
: dailyHealthPercentages.length <= 1
606606
? 0
607-
: dailyHealthPercentages.reduce((count, current, index) => {
607+
: dailyHealthPercentages.reduce((count: number, current, index) => {
608608
if (index === 0) return 0;
609609
const previous = dailyHealthPercentages[index - 1];
610610
return current !== previous ? count + 1 : count;
@@ -620,8 +620,10 @@ export default function Page() {
620620
: (() => {
621621
const volatilityPenalty = ciHealthVolatility * 50; // 0-50 penalty
622622
const transitionPenalty =
623-
Math.min(stateTransitions / (dailyHealthPercentages?.length || 1), 1) *
624-
50; // 0-50 penalty
623+
Math.min(
624+
stateTransitions / (dailyHealthPercentages?.length || 1),
625+
1
626+
) * 50; // 0-50 penalty
625627
return Math.max(0, 100 - volatilityPenalty - transitionPenalty) / 100;
626628
})();
627629

@@ -693,7 +695,7 @@ export default function Page() {
693695
? undefined
694696
: prevDailyHealthPercentages.length <= 1
695697
? 0
696-
: prevDailyHealthPercentages.reduce((count, current, index) => {
698+
: prevDailyHealthPercentages.reduce((count: number, current, index) => {
697699
if (index === 0) return 0;
698700
const previous = prevDailyHealthPercentages[index - 1];
699701
return current !== previous ? count + 1 : count;
@@ -1067,7 +1069,9 @@ export default function Page() {
10671069
{
10681070
title: "State Transitions",
10691071
value:
1070-
stateTransitions === undefined ? undefined : stateTransitions,
1072+
stateTransitions === undefined
1073+
? undefined
1074+
: stateTransitions,
10711075
valueRenderer: formatCount,
10721076
badThreshold: (v) =>
10731077
(v ?? 0) > (dailyHealthPercentages?.length || 1) * 0.3,

0 commit comments

Comments
 (0)