Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3hv73alvgf is past its budget: trevato/forge: "GET /apps/open names its phases and answers within its budget" failed on 3 pulls in the last hour — the… #7515

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/7490-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. torque/7490-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 7a8d636.

Review

Sign in to review this change.
4 files changed +15 −8
src/web/pages/apps.ts +2
@@ -48,6 +48,7 @@ import {
4848 import type { User } from "../../core/users.ts";
4949 import { safeBack, type Ctx } from "../../http/context.ts";
5050 import {
51 nameFrame,
5152 notePhase,
5253 takeSessionTime,
5354 timePhase,
@@ -716,6 +717,7 @@ export function previewCard(ctx: Ctx, repo: Repo, pull: Pull): Html {
716717 * theirs, nothing else is.
717718 */
718719 export function appsOpen(ctx: Ctx): Response {
720 nameFrame(ctx.request);
719721 notePhase(ctx.request, "session", takeSessionTime(ctx.request));
720722 return timePhase(ctx.request, "render", () => appsOpenResponse(ctx));
721723 }
src/web/pages/cloud.ts +2 −1
@@ -24,7 +24,7 @@ import {
2424 type CloudAccount,
2525 type CloudRead,
2626 } from "../../core/cloud_account.ts";
27 import { notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts";
27 import { nameFrame, notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts";
2828 import type { Ctx } from "../../http/context.ts";
2929 import { notFoundPage, settingsLayout, signInFirst } from "../chrome.ts";
3030 import { field, readForm } from "../form.ts";
@@ -218,6 +218,7 @@ export async function cloudAudit(ctx: Ctx): Promise<Response> {
218218
219219 // GET /settings/cloud/audit
220220 export function cloudAuditPage(ctx: Ctx): Response {
221 nameFrame(ctx.request);
221222 notePhase(ctx.request, "session", takeSessionTime(ctx.request));
222223 const denied = requireAdmin(ctx);
223224 if (denied) return timePhase(ctx.request, "render", () => denied);
src/web/pages/org.ts +2 −1
@@ -33,7 +33,7 @@ import { LIST_LIMIT_MAX } from "../../core/issues.ts";
3333 import { listReposByOwner, type Repo } from "../../core/repos.ts";
3434 import { getUserByName, hiddenFrom, type User } from "../../core/users.ts";
3535 import type { Ctx } from "../../http/context.ts";
36 import { notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts";
36 import { nameFrame, notePhase, takeSessionTime, timePhase, timePhaseAsync } from "../../core/route_timing.ts";
3737 import { notFoundPage, pageHead, signInFirst } from "../chrome.ts";
3838 import { field, readForm, type Form } from "../form.ts";
3939 import { html, when, type Html } from "../html.ts";
@@ -457,6 +457,7 @@ function orgForm(ctx: Ctx, value: string, error?: string): Response {
457457
458458 // GET /organizations/new
459459 export function newOrgPage(ctx: Ctx): Response {
460 nameFrame(ctx.request);
460461 notePhase(ctx.request, "session", takeSessionTime(ctx.request));
461462 return timePhase(ctx.request, "render", () =>
462463 ctx.auth.user ? orgForm(ctx, "") : signInFirst(ctx),
test/cloud-org-apps-timing.test.ts +9 −6
@@ -46,10 +46,12 @@ afterAll(() => {
4646 });
4747
4848 // /apps/open with no host is the answer a stranger gets: session, then render.
49 // `route` and `compress` are the server's own work around the handler: named,
50 // the accounting no longer hangs on how long a loaded machine takes outside it.
4951 const PAGES: [string, string[]][] = [
50 ["/settings/cloud/audit", ["session", "audit", "render"]],
51 ["/organizations/new", ["session", "render"]],
52 ["/apps/open", ["session", "render"]],
52 ["/settings/cloud/audit", ["route", "session", "audit", "render", "compress"]],
53 ["/organizations/new", ["route", "session", "render", "compress"]],
54 ["/apps/open", ["route", "session", "render", "compress"]],
5355 ];
5456
5557 for (const [path, names] of PAGES)
@@ -77,13 +79,14 @@ for (const [path, names] of PAGES)
7779
7880 // Signed out, the redirect to sign-in is still a named phase.
7981 for (const path of ["/settings/cloud/audit", "/organizations/new"])
80 test(`signed-out GET ${path} names session and render`, async () => {
82 test(`signed-out GET ${path} names route, session, render and compress`, async () => {
8183 const res = await fetch(`${servers.url}${path}`, { redirect: "manual" });
8284 await res.text();
8385 expect(res.status).toBe(303);
8486 const parts = (res.headers.get("server-timing") ?? "").split(", ");
8587 const dur = (n: string) => Number(parts.find((p) => p.startsWith(`${n};`))!.split("dur=")[1]);
86 for (const name of ["session", "render"])
88 const names = ["route", "session", "render", "compress"];
89 for (const name of names)
8790 expect(parts.find((p) => p.startsWith(`${name};`))).toMatch(/^[a-z]+;dur=\d+\.\d$/);
88 expect(Math.abs(dur("app") - dur("session") - dur("render"))).toBeLessThan(1.5);
91 expect(Math.abs(dur("app") - names.reduce((sum, n) => sum + dur(n), 0))).toBeLessThan(1.5);
8992 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs