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).
Unified · Split
| @@ -210,6 +210,20 @@ const cloudflareHandler: ExportedHandler<Env> = { · 209 unmodified lines | ||
| 210 | 210 | await scheduler.wait(1); |
| 211 | 211 | const timerProbeMs = Date.now() - timerStartedAt; |
| 212 | 212 | |
| 213 | + // The cache and timer probes are LOCAL. Neither leaves the isolate, and | |
| 214 | + // both come back in single-digit ms while the same requests take 4-6s. | |
| 215 | + // This one is a real outbound network subrequest to a small, fast, | |
| 216 | + // unrelated endpoint — the only class of I/O not yet measured, and the | |
| 217 | + // one the docs proxy (0.098s direct, 3-6s through the Worker) implicates. | |
| 218 | + const fetchStartedAt = Date.now(); | |
| 219 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- temporary diagnostic: a probe failure must not affect the request | |
| 220 | + try { | |
| 221 | + await fetch("https://cloudflare.com/cdn-cgi/trace", { method: "GET" }); | |
| 222 | + } catch { | |
| 223 | + // ignored — the timing is the signal, not the result | |
| 224 | + } | |
| 225 | + const fetchProbeMs = Date.now() - fetchStartedAt; | |
| 226 | + | |
| 213 | 227 | console.log( |
| 214 | 228 | JSON.stringify({ |
| 215 | 229 | probe: "clock-sync", |
| @@ -217,6 +231,7 @@ const cloudflareHandler: ExportedHandler<Env> = { · 1 unmodified line | ||
| 217 | 231 | preWorkMs, |
| 218 | 232 | cacheProbeMs, |
| 219 | 233 | timerProbeMs, |
| 234 | + fetchProbeMs, | |
| 220 | 235 | }), |
| 221 | 236 | ); |
| 222 | 237 | |