Skip to content

Commit d00a00b

Browse files
committed
Display agent timings
1 parent 0ff2be9 commit d00a00b

File tree

10 files changed

+213
-166
lines changed

10 files changed

+213
-166
lines changed

site/src/api/queries/workspaceBuilds.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ export const infiniteWorkspaceBuilds = (
5757
};
5858
};
5959

60-
export const workspaceBuildTimings = (workspaceBuildId: string) => {
60+
// We use readyAgentsCount to invalidate the query when an agent connects
61+
export const workspaceBuildTimings = (workspaceBuildId: string, readyAgentsCount: number) => {
6162
return {
62-
queryKey: ["workspaceBuilds", workspaceBuildId, "timings"],
63+
queryKey: ["workspaceBuilds", workspaceBuildId, "timings", { readyAgentsCount }],
6364
queryFn: () => API.workspaceBuildTimings(workspaceBuildId),
6465
};
6566
};

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/modules/workspaces/WorkspaceTiming/ResourcesChart.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import {
2626
makeTicks,
2727
mergeTimeRanges,
2828
} from "./Chart/utils";
29-
import type { StageCategory } from "./StagesChart";
29+
import { type Theme, useTheme } from "@emotion/react";
30+
import type { Stage } from "./StagesChart";
3031

3132
type ResourceTiming = {
3233
name: string;
@@ -36,14 +37,12 @@ type ResourceTiming = {
3637
};
3738

3839
export type ResourcesChartProps = {
39-
category: StageCategory;
40-
stage: string;
40+
stage: Stage;
4141
timings: ResourceTiming[];
4242
onBack: () => void;
4343
};
4444

4545
export const ResourcesChart: FC<ResourcesChartProps> = ({
46-
category,
4746
stage,
4847
timings,
4948
onBack,
@@ -67,11 +66,11 @@ export const ResourcesChart: FC<ResourcesChartProps> = ({
6766
<ChartBreadcrumbs
6867
breadcrumbs={[
6968
{
70-
label: category.name,
69+
label: stage.section,
7170
onClick: onBack,
7271
},
7372
{
74-
label: stage,
73+
label: stage.name,
7574
},
7675
]}
7776
/>
@@ -85,7 +84,7 @@ export const ResourcesChart: FC<ResourcesChartProps> = ({
8584
<ChartContent>
8685
<YAxis>
8786
<YAxisSection>
88-
<YAxisHeader>{stage} stage</YAxisHeader>
87+
<YAxisHeader>{stage.name} stage</YAxisHeader>
8988
<YAxisLabels>
9089
{visibleTimings.map((t) => (
9190
<YAxisLabel key={t.name} id={encodeURIComponent(t.name)}>

site/src/modules/workspaces/WorkspaceTiming/ScriptsChart.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
makeTicks,
2828
mergeTimeRanges,
2929
} from "./Chart/utils";
30-
import type { StageCategory } from "./StagesChart";
30+
import type { Stage } from "./StagesChart";
3131

3232
type ScriptTiming = {
3333
name: string;
@@ -37,14 +37,12 @@ type ScriptTiming = {
3737
};
3838

3939
export type ScriptsChartProps = {
40-
category: StageCategory;
41-
stage: string;
40+
stage: Stage;
4241
timings: ScriptTiming[];
4342
onBack: () => void;
4443
};
4544

4645
export const ScriptsChart: FC<ScriptsChartProps> = ({
47-
category,
4846
stage,
4947
timings,
5048
onBack,
@@ -66,11 +64,11 @@ export const ScriptsChart: FC<ScriptsChartProps> = ({
6664
<ChartBreadcrumbs
6765
breadcrumbs={[
6866
{
69-
label: category.name,
67+
label: stage.section,
7068
onClick: onBack,
7169
},
7270
{
73-
label: stage,
71+
label: stage.name,
7472
},
7573
]}
7674
/>
@@ -84,7 +82,7 @@ export const ScriptsChart: FC<ScriptsChartProps> = ({
8482
<ChartContent>
8583
<YAxis>
8684
<YAxisSection>
87-
<YAxisHeader>{stage} stage</YAxisHeader>
85+
<YAxisHeader>{stage.name} stage</YAxisHeader>
8886
<YAxisLabels>
8987
{visibleTimings.map((t) => (
9088
<YAxisLabel key={t.name} id={encodeURIComponent(t.name)}>

0 commit comments

Comments
 (0)