main
ply4 git calls25 ms43 KiB3 cachedprotocol v2
118 lines2.7 KiBRaw
1export type CsvRow = {
2 readonly step: string
3 readonly method: string
4 readonly path: string
5 readonly status: number
6 readonly ms: number
7 readonly pass: boolean
8 readonly cfRay: string
9 readonly requestId: string
10 readonly artifactsRay: string
11 readonly version: string
12 readonly build: string
13 readonly serverTiming: string
14 readonly detail: string
17const COLUMNS = [
18 'step',
19 'method',
20 'path',
21 'status',
22 'ms',
23 'pass',
24 'cf_ray',
25 'x_ply_request_id',
26 'x_artifacts_ray',
27 'x_ply_version',
28 'x_ply_build',
29 'server_timing',
30 'detail',
31] as const
33function cell(value: string): string {
34 if (/[",\n\r]/.test(value)) return `"${value.replace(/"/g, '""')}"`
35 return value
38export function csvLine(row: CsvRow): string {
39 const values = [
40 row.step,
41 row.method,
42 row.path,
43 String(row.status),
44 String(row.ms),
45 row.pass ? 'pass' : 'fail',
46 row.cfRay,
47 row.requestId,
48 row.artifactsRay,
49 row.version,
50 row.build,
51 row.serverTiming,
52 row.detail,
53 ]
54 return values.map(cell).join(',')
57export function csvDocument(rows: readonly CsvRow[]): string {
58 return [COLUMNS.join(','), ...rows.map(csvLine)].join('\n') + '\n'
61function parseCsv(text: string): string[][] {
62 const rows: string[][] = []
63 let row: string[] = []
64 let cell = ''
65 let quoted = false
66 for (let i = 0; i < text.length; i++) {
67 const ch = text[i] ?? ''
68 if (quoted) {
69 if (ch === '"') {
70 if (text[i + 1] === '"') {
71 cell += '"'
72 i += 1
73 } else quoted = false
74 } else cell += ch
75 continue
76 }
77 if (ch === '"') {
78 quoted = true
79 continue
80 }
81 if (ch === ',') {
82 row.push(cell)
83 cell = ''
84 continue
85 }
86 if (ch === '\n' || ch === '\r') {
87 if (ch === '\r' && text[i + 1] === '\n') i += 1
88 row.push(cell)
89 if (row.some(value => value !== '')) rows.push(row)
90 row = []
91 cell = ''
92 continue
93 }
94 cell += ch
95 }
96 if (cell !== '' || row.length > 0) {
97 row.push(cell)
98 if (row.some(value => value !== '')) rows.push(row)
99 }
100 return rows
103/** x-ply-request-id → cf-ray from a smoke CSV. Rows without either field are skipped. */
104export function raysByRequestId(text: string): ReadonlyMap<string, string> {
105 const rows = parseCsv(text)
106 const header = rows[0]
107 if (!header) return new Map()
108 const idAt = header.indexOf('x_ply_request_id')
109 const rayAt = header.indexOf('cf_ray')
110 if (idAt < 0 || rayAt < 0) return new Map()
111 const out = new Map<string, string>()
112 for (const row of rows.slice(1)) {
113 const id = row[idAt] ?? ''
114 const ray = row[rayAt] ?? ''
115 if (id !== '' && ray !== '') out.set(id, ray)
116 }
117 return out
Diagnostics4 git calls · 25 ms
CallStatusSizeTime025 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
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 1020042 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=42585
git.response.cache=HIT
git.response.duration_ms=2
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=262b639aa1b258fc1777c3a66ba8f811df3a3da2
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=42585
git.pkt.payload.max=42490
git.sideband.band1.bytes=42489
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=61
git.pack.bytes=42489
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=7dbf576d97429022615f79aa46b440d9da603496
git.pack.full=61
Open pack map
fetch2001.0 KiB · hit20 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=20
git.response.bytes=1043
git.response.cache=HIT
git.response.duration_ms=20
git.fetch.wants=a0ee93224c73c4726b224829ab0ca038da4e6fcc
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=1043
git.pkt.payload.max=1022
git.sideband.band1.bytes=1021
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
262b639aa1b258fc1777c3a66ba8f811df3a3da2
cf-ray
a5e22892ca1ea151
Request
4094e57f…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format