Skip to content

Commit a8aa2c4

Browse files
committed
chore(webapp): apply oxfmt formatting to queue-metrics files (fix code-quality check)
1 parent 33a887f commit a8aa2c4

6 files changed

Lines changed: 47 additions & 54 deletions

File tree

apps/webapp/app/components/primitives/charts/Chart.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ const ChartTooltipContent = React.forwardRef<
179179
// Prefer the series' configured colour over item.color: a threshold/gradient line's
180180
// recharts colour is a `url(#…)` gradient ref, which is invalid as a CSS background and
181181
// renders no swatch. The config colour is the intended solid series colour.
182-
const indicatorColor =
183-
color || itemConfig?.color || item.payload.fill || item.color;
182+
const indicatorColor = color || itemConfig?.color || item.payload.fill || item.color;
184183

185184
return (
186185
<div

apps/webapp/app/components/queues/QueueControls.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ export function QueueOverrideConcurrencyButton({
248248
</div>
249249
</TooltipTrigger>
250250
<TooltipContent side="bottom" className="max-w-[230px] text-xs">
251-
Give this queue its own concurrency limit instead of the environment default. Set it as
252-
a number or a percentage of the environment limit.
251+
Give this queue its own concurrency limit instead of the environment default. Set it
252+
as a number or a percentage of the environment limit.
253253
</TooltipContent>
254254
</Tooltip>
255255
</TooltipProvider>

apps/webapp/app/components/queues/QueueMetricCards.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,7 @@ export function QueueMetricChartCard({
278278
key={s.key}
279279
className="flex items-center gap-1 text-xs font-normal text-text-dimmed"
280280
>
281-
<span
282-
className="size-2.5 rounded-[2px]"
283-
style={{ backgroundColor: s.color }}
284-
/>
281+
<span className="size-2.5 rounded-[2px]" style={{ backgroundColor: s.color }} />
285282
{s.label}
286283
</span>
287284
))}
@@ -290,10 +287,7 @@ export function QueueMetricChartCard({
290287
key={e.label}
291288
className="flex items-center gap-1 text-xs font-normal text-text-dimmed"
292289
>
293-
<span
294-
className="size-2.5 rounded-[2px]"
295-
style={{ backgroundColor: e.color }}
296-
/>
290+
<span className="size-2.5 rounded-[2px]" style={{ backgroundColor: e.color }} />
297291
{e.label}
298292
</span>
299293
))}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -661,15 +661,9 @@ function QueuesWithMetricsView() {
661661
<TableHeader>
662662
<TableRow>
663663
<TableHeaderCell>Name</TableHeaderCell>
664-
<TableHeaderCell alignment="right">
665-
Queued
666-
</TableHeaderCell>
667-
<TableHeaderCell alignment="right">
668-
Running
669-
</TableHeaderCell>
670-
<TableHeaderCell alignment="right">
671-
Limit
672-
</TableHeaderCell>
664+
<TableHeaderCell alignment="right">Queued</TableHeaderCell>
665+
<TableHeaderCell alignment="right">Running</TableHeaderCell>
666+
<TableHeaderCell alignment="right">Limit</TableHeaderCell>
673667
<TableHeaderCell
674668
alignment="right"
675669
tooltipContentClassName="max-w-max"
@@ -685,17 +679,15 @@ function QueuesWithMetricsView() {
685679
code.
686680
</p>
687681
<p>
688-
<span className="text-text-bright">Override</span>: a limit you set here or
689-
via the API.
682+
<span className="text-text-bright">Override</span>: a limit you set here
683+
or via the API.
690684
</p>
691685
</div>
692686
}
693687
>
694688
Limited by
695689
</TableHeaderCell>
696-
<TableHeaderCell alignment="right">
697-
Health
698-
</TableHeaderCell>
690+
<TableHeaderCell alignment="right">Health</TableHeaderCell>
699691
<TableHeaderCell
700692
alignment="right"
701693
disableTooltipHoverableContent
@@ -844,10 +836,7 @@ function QueuesWithMetricsView() {
844836
to={queueDetailPath}
845837
alignment="right"
846838
actionClassName="pl-16"
847-
className={cn(
848-
"w-[1%]",
849-
queue.paused ? "opacity-50" : undefined
850-
)}
839+
className={cn("w-[1%]", queue.paused ? "opacity-50" : undefined)}
851840
// Keep the whole row navigable: the override explainer is a tooltip
852841
// button, so it renders beside the link (trailing) rather than nested
853842
// inside the <a>, and the label itself stays the link.
@@ -870,13 +859,11 @@ function QueuesWithMetricsView() {
870859
) : undefined
871860
}
872861
>
873-
{queue.concurrency?.overriddenAt ? (
874-
"Override"
875-
) : queue.concurrencyLimit ? (
876-
"User"
877-
) : (
878-
"Environment"
879-
)}
862+
{queue.concurrency?.overriddenAt
863+
? "Override"
864+
: queue.concurrencyLimit
865+
? "User"
866+
: "Environment"}
880867
</TableCell>
881868
<TableCell
882869
to={queueDetailPath}
@@ -1258,8 +1245,8 @@ const QUEUE_HEADER_TILES: QueueHeaderTile[] = [
12581245
label: "Env saturation",
12591246
description: (
12601247
<>
1261-
How much of the environment's concurrency these queues are using. Turns{" "}
1262-
<WarningSwatch /> above 100%, when they're into burst capacity.
1248+
How much of the environment's concurrency these queues are using. Turns <WarningSwatch />{" "}
1249+
above 100%, when they're into burst capacity.
12631250
</>
12641251
),
12651252
color: "var(--color-queues)",
@@ -1303,8 +1290,8 @@ const QUEUE_HEADER_TILES: QueueHeaderTile[] = [
13031290
label: "Scheduling delay p95",
13041291
description: (
13051292
<>
1306-
How long runs wait before they start (95% start faster than this). Turns{" "}
1307-
<WarningSwatch /> above 1 minute.
1293+
How long runs wait before they start (95% start faster than this). Turns <WarningSwatch />{" "}
1294+
above 1 minute.
13081295
</>
13091296
),
13101297
totalTooltip: "The worst p95 in the selected window.",
@@ -1476,7 +1463,10 @@ function QueueEnvMetricChart({
14761463
/>
14771464
) : (
14781465
<span
1479-
className={cn("text-xs font-normal tabular-nums text-text-dimmed", totalClassName)}
1466+
className={cn(
1467+
"text-xs font-normal tabular-nums text-text-dimmed",
1468+
totalClassName
1469+
)}
14801470
>
14811471
{peak}
14821472
</span>

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues_.$queueParam/route.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ export default function Page() {
276276
</div>
277277
<div className="flex items-center gap-1.5">
278278
{view === "keys" && hasKeys ? (
279-
<SearchInput placeholder="Search keys…" paramName="query" resetParams={["key", "page"]} />
279+
<SearchInput
280+
placeholder="Search keys…"
281+
paramName="query"
282+
resetParams={["key", "page"]}
283+
/>
280284
) : null}
281285
<TimeFilter
282286
defaultPeriod={QUEUE_METRICS_DEFAULT_PERIOD}
@@ -383,8 +387,8 @@ function OverviewCharts({
383387
info={
384388
<>
385389
How many runs are executing at once (<ColorSwatch color={COLORS.running} />) versus
386-
the queue's limit (<ColorSwatch color={COLORS.limit} />). Turns{" "}
387-
<ColorSwatch color="var(--color-warning)" /> color when it reaches the limit.
390+
the queue's limit (<ColorSwatch color={COLORS.limit} />
391+
). Turns <ColorSwatch color="var(--color-warning)" /> color when it reaches the limit.
388392
</>
389393
}
390394
showLegend
@@ -426,8 +430,8 @@ function OverviewCharts({
426430
title="Throughput"
427431
info={
428432
<>
429-
Runs arriving (<ColorSwatch color={COLORS.limit} /> Enqueued) versus starting
430-
(<ColorSwatch color={COLORS.running} /> Started). Turns{" "}
433+
Runs arriving (<ColorSwatch color={COLORS.limit} /> Enqueued) versus starting (
434+
<ColorSwatch color={COLORS.running} /> Started). Turns{" "}
431435
<ColorSwatch color="var(--color-warning)" /> color when Started falls behind.
432436
</>
433437
}
@@ -1166,7 +1170,10 @@ function ConcurrencyBlock({
11661170
</span>
11671171
{limit !== null && limit > 0 && (
11681172
<span
1169-
className={cn("text-xs tabular-nums", atLimit ? "text-warning" : "text-text-dimmed")}
1173+
className={cn(
1174+
"text-xs tabular-nums",
1175+
atLimit ? "text-warning" : "text-text-dimmed"
1176+
)}
11701177
>
11711178
{/* Separator so the limit and the percentage don't read as one number
11721179
(e.g. "/ 25" + "44%" mashing into "2544%"). */}

apps/webapp/app/routes/resources.queues.concurrency-keys.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import { type ActionFunctionArgs, json } from "@remix-run/server-runtime";
22
import { z } from "zod";
33
import { timeFilterFromTo } from "~/components/runs/v3/SharedFilters";
44
import { clickhouseFactory } from "~/services/clickhouse/clickhouseFactoryInstance.server";
5-
import {
6-
findEnvironmentById,
7-
hasAccessToEnvironment,
8-
} from "~/models/runtimeEnvironment.server";
5+
import { findEnvironmentById, hasAccessToEnvironment } from "~/models/runtimeEnvironment.server";
96
import { requireUserId } from "~/services/session.server";
107
import { canAccessQueueMetricsUi } from "~/v3/canAccessQueueMetricsUi.server";
118
import { engine } from "~/v3/runEngine.server";
@@ -72,7 +69,10 @@ export const action = async ({ request }: ActionFunctionArgs) => {
7269

7370
const submission = Body.safeParse(await request.json());
7471
if (!submission.success) {
75-
return json<ConcurrencyKeysResponse>({ success: false, error: "Invalid input" }, { status: 400 });
72+
return json<ConcurrencyKeysResponse>(
73+
{ success: false, error: "Invalid input" },
74+
{ status: 400 }
75+
);
7676
}
7777
const { organizationId, projectId, environmentId, queueName, period, from, to, search, page } =
7878
submission.data;
@@ -120,7 +120,10 @@ export const action = async ({ request }: ActionFunctionArgs) => {
120120
const endTime = formatClickhouseDateTime(new Date(ceilToMinute(range.to.getTime())));
121121

122122
try {
123-
const clickhouse = await clickhouseFactory.getClickhouseForOrganization(organizationId, "query");
123+
const clickhouse = await clickhouseFactory.getClickhouseForOrganization(
124+
organizationId,
125+
"query"
126+
);
124127

125128
const [rankingError, rankingRows] = await clickhouse.queueMetrics.concurrencyKeyRanking({
126129
organizationId,

0 commit comments

Comments
 (0)