main
1// Thresholds that are not rollout policy. The ramp schedule, ingest wait, probe mix,
2// and which signals are hard live in cd.policy.json. Edit that file, or pass --policy.
4export const WORKER_DEFAULT = 'ply'
5export const BASE_URL_DEFAULT = 'https://ply.ivar.workers.dev'
6export const NAMESPACE_DEFAULT = 'ply-loadgen'
7export const BUMP_BRANCH_DEFAULT = 'bump-ply'
8export const REPO_PREFIX = 'ply-web-cd-'
9/** How long a candidate Node binary may take to print its version during preflight. */
10export const NODE_PROBE_MS = 5_000
12/** Write-token lifetime for the scratch repo. The smoke must finish inside this window. */
13export const TOKEN_TTL_SECONDS = 600
14export const REVOKE_ATTEMPTS = 5
15export const REVOKE_WAIT_MS = 1_000
17/**
18 * Route confirmation (route-confirm.ts): after a split write, requests must come back from the wanted version on fresh
19 * connections, every one of them, for PIN_SUSTAIN_MS. Used for the pinned canary (version override) and for the
20 * unpinned 100% split before the live smoke.
21 *
22 * source: run 2026-11-10T20-48-18-470Z (c8403e57 at 0% beside 480225db, written 15:49:10.6 EST). The old check (5
23 * sequential requests on one keep-alive connection, 1 s apart) passed; a pinned smoke row 9.9 s after the write
24 * (flags-rules, ray a587ec564e0da476-IAD) was answered by 480225db, between two rows answered by c8403e57. Cloudflare
25 * applies an override only where the edge already has the deployment ("up to a couple of seconds" per the docs); a
26 * request that lands on a machine without it is routed by the split, which is 100% old. Every earlier run's pinned rows
27 * (19 runs, 2026-11-08T15-39-56-033Z through 2026-11-10T14-56-52-021Z, ~1,000 rows from +8.3 s after the write) and
28 * every unpinned request after a 100% write (22,492 requests from +0.9 s, 10 runs) came from the wanted version.
29 * date: 2026-11-10. n: 1 straggler in ~1,000 pinned rows; 0 in 22,492 unpinned.
30 * prediction (2026-11-10): stragglers end within 15 s of a split write. With 10 fresh connections a second and 10 s
31 * sustained, confirmation ends 11-25 s after the write on >= 100 samples, and a run's smoke sees 0 wrong-version rows.
32 * Any that do occur are re-issued (SMOKE_REISSUE_*) and logged as routing events, never counted as a pass. Re-check the
33 * offsets each route-confirm observation records after 5 runs.
34 */
35export const PIN_BATCH = 10
36export const PIN_INTERVAL_MS = 1_000
37export const PIN_SUSTAIN_MS = 10_000
38/** Give up (a routing harness fault, traffic unchanged) when no sustained window has formed by then. PRIOR: 8x the predicted 15 s. */
39export const PIN_MAX_MS = 120_000
40/** One confirmation request. PRIOR: the probe timeout (cd.policy.json probe.timeoutMs). */
41export const PIN_REQUEST_MS = 2_000
43/**
44 * A smoke row answered by the wrong version, or lost (status 0) while the client stalled, is re-issued after a wait,
45 * at most this many times. Only a GET is re-issued; a write that reached the wrong version (or may have landed during a
46 * stall) restarts the lifecycle on a fresh scratch repo after a new route confirmation, at most SMOKE_RESTARTS times.
47 * PRIOR (2026-11-10): 3 x 2 s covers the one observed straggler window (9.9 s after the write, smoke 0.2 s behind it)
48 * once confirmation has passed; exhausting them is a routing or client harness fault, prod untouched.
49 */
50export const SMOKE_REISSUE_ATTEMPTS = 3
51export const SMOKE_REISSUE_WAIT_MS = 2_000
52export const SMOKE_RESTARTS = 2
54/**
55 * Client stall detection (client-health.ts). The monitor ticks every CLIENT_TICK_MS; a gap in the wall or monotonic
56 * clock above CLIENT_STALL_MS is a client stall.
57 * source: runs 2026-11-08T17-24-32-774Z through 2026-11-10T20-54-06-051Z (6 ramps, 627 s of probe dwell at 50 req/s):
58 * 0 gaps over 500 ms between logged probes on a healthy client. Two stalls observed: 69,830 ms (run
59 * 2026-11-01T19-40-35-485Z, both versions answered together at the end) and 53,733 ms (run 2026-11-10T20-54-06-051Z,
60 * 16:00:07.8 to 16:01:01.6 EST: no event written, 58 of ~2,000 probes issued, the last 5 timed out client-side; dmesg
61 * "crng reseeded due to virtual machine fork" and virtio_balloon "Out of puff" at the same time; server telemetry for the
62 * window all outcome ok, none over 3 s). The box logged 69 VM forks in the 38 h before 2026-11-10 16:13, about one per
63 * 33 min, so a ~6 min ramp meets one about 1 run in 6.
64 * date: 2026-11-10. n: 627 s healthy, 2 stalls.
65 * prediction (2026-11-10): 0 false stalls on a healthy run (CLIENT_STALL_MS is 2x the largest healthy gap bound and 10x
66 * the tick). PRIOR tick.
67 */
68export const CLIENT_TICK_MS = 100
69export const CLIENT_STALL_MS = 1_000
70/**
71 * How far a ramp step may run past its dwell to replace the time the client spent stalled and reach probe.minSamples
72 * real samples. Past it, the step ends as `harness_unhealthy`, and its traffic is settled through `probe.onHarnessFault` (ply-web#145).
73 * source: the two stalls above (53.7 s, 69.8 s) plus 1,000 samples at 50 req/s (20 s).
74 * prediction (2026-11-10): a single VM pause (<= 70 s observed) recovers inside 120 s; harness_unhealthy needs stalls
75 * totalling over ~100 s in one step, which no run so far has had.
76 */
77export const CLIENT_MAX_EXTENSION_MS = 120_000
79/** One Worker HTTP call. A tiny repo finishes well under this; the paid CPU ceiling is 5 minutes. */
80export const SMOKE_HTTP_MS = 120_000
82export const TELEMETRY_PAGE = 1_000
83export const TELEMETRY_CHUNK = 50
84export const TELEMETRY_MAX_PAGES = 50
85/** Ingest lag observed on 2026-10-31 was 10–30s. Wait this long before calling a missing id lost. */
86export const TELEMETRY_WAIT_MS = 60_000
87/** Re-query periods while smoke ids are missing. Ingest typically lands in 5–15 s, so poll tight then back off. */
88export const TELEMETRY_POLLS_MS = [3_000, 3_000, 3_000, 5_000, 5_000, 10_000] as const
89/** `to` is now plus this, matching scripts/canary-o11y.mjs, so the last events are inside the window. */
90export const QUERY_SLACK_MS = 60_000
92/**
93 * A span join that covers less than this share of the invocations the worker logged,
94 * compared with the smoke requests, is the harness. Half is well under the ingest-loss
95 * allowance, so a healthy loss still passes the gate.
96 */
97export const JOIN_MIN_SHARE = 0.5
99/** The share check starts at this many logged invocations, the floor of the loss allowance. */
100export const JOIN_MIN_LOGGED = 2
102/** A cf-ray is 16 hex digits, a hyphen, and a colo. A span `rayId` may omit the colo. */
103export const CF_RAY_HEX_LENGTH = 16
105/** Artifacts answers a revoked bearer with 403. */
106export const REVOKED_STATUS = 403
108/** How long the post-revoke Artifacts call may take. A dead token answers well inside this. */
109export const REVOKE_PROBE_MS = 15_000
111export const MESSAGE_MAX = 100
113/** `workers/tag` on a version upload. The API rejects a longer tag. */
114export const VERSION_TAG_MAX = 100
116/** A full git object id, the only sha a release will carry. */
117export const GIT_SHA_HEX = 40
119export type LatencyCeiling = {
120 readonly p50Ms: number
121 readonly p99Ms: number
122}
124/**
125 * Ceilings for the pinned smoke and the post-promote smoke. These are the first stored
126 * baseline (2026-10-31): a tiny Artifacts repo, cold isolates included. Tighten them after
127 * a few real runs. A sample over the ceiling fails telemetry only when the rollout
128 * policy's latency mode is `gate`. `informational` and `off` record the percentiles.
129 */
130export const SMOKE_LATENCY = {
131 cpuMs: { p50Ms: 250, p99Ms: 3_000 },
132 wallMs: { p50Ms: 4_000, p99Ms: 25_000 },
133 fetchMs: { p50Ms: 2_000, p99Ms: 15_000 },
134} as const satisfies Record<string, LatencyCeiling>
Diagnostics4 git calls · 38 ms
CallStatusSizeTime038 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020040 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=41349 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=526b305930b8ef382f2d7a1f9c0238730a585921 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=41349 git.pkt.payload.max=41254 git.sideband.band1.bytes=41253 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=61 git.pack.bytes=41253 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=ab60efef4b7243678c75de64a4386986ee885c1c git.pack.full=61Open pack map
fetch2003.4 KiB · hit32 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=31 git.response.bytes=3493 git.response.cache=HIT git.response.duration_ms=32 git.fetch.wants=37a2ecfecc7605bb9889a45b9cde884bd2f8f379 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=3493 git.pkt.payload.max=3472 git.sideband.band1.bytes=3471 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
- Ref
- refs/heads/main
- Commit
- 526b305930b8ef382f2d7a1f9c0238730a585921
- cf-ray
- a5e2daf60d34c125
- Request
- f695e8af…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format