From a00ad2459530dc93bce7c4846df72dcd31f3d4f7 Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Tue, 18 Aug 2026 15:04:19 -0700 Subject: [PATCH] Probe a real outbound fetch alongside the local probes Cache and timer probes come back in single-digit ms while the same requests take 4-6s wall, so local I/O is not the cost. Neither probe leaves the isolate. Time a real outbound subrequest, the class the docs proxy implicates (0.098s direct vs 3-6s through the Worker). --- apps/cloud/src/server.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/cloud/src/server.ts b/apps/cloud/src/server.ts index a64a0dc3f..7b4e38bc6 100644 --- a/apps/cloud/src/server.ts +++ b/apps/cloud/src/server.ts @@ -210,6 +210,20 @@ const cloudflareHandler: ExportedHandler = { await scheduler.wait(1); const timerProbeMs = Date.now() - timerStartedAt; + // The cache and timer probes are LOCAL. Neither leaves the isolate, and + // both come back in single-digit ms while the same requests take 4-6s. + // This one is a real outbound network subrequest to a small, fast, + // unrelated endpoint — the only class of I/O not yet measured, and the + // one the docs proxy (0.098s direct, 3-6s through the Worker) implicates. + const fetchStartedAt = Date.now(); + // oxlint-disable-next-line executor/no-try-catch-or-throw -- temporary diagnostic: a probe failure must not affect the request + try { + await fetch("https://cloudflare.com/cdn-cgi/trace", { method: "GET" }); + } catch { + // ignored — the timing is the signal, not the result + } + const fetchProbeMs = Date.now() - fetchStartedAt; + console.log( JSON.stringify({ probe: "clock-sync", @@ -217,6 +231,7 @@ const cloudflareHandler: ExportedHandler = { preWorkMs, cacheProbeMs, timerProbeMs, + fetchProbeMs, }), );