GitHubivarvong

ply

main
ply7 git calls131 ms24 KiB5 cachedprotocol v2
115 lines3.2 KiBRaw
1// Adding a member to a closed union fails typecheck at the handler. A used @ts-expect-error that is not an
2// error fails `tsc`, so each incomplete switch below has to stay an error. The complete ones are the pattern:
3// every member, no default, assertNever as the next statement.
4import { assertNever } from '../../src/result.js';
5import type { PackCacheStatus } from '../../src/cachestatus.js';
6import type { PackKind } from '../../src/format.js';
7import type { FetchFeature, KnownObjectFormat, RequiredV2Cap } from '../../src/closed.js';
8import type { NamedHttpStatus } from '../../src/http.js';
10const cacheLabel = (s: PackCacheStatus): string => {
11 switch (s) {
12 case 'HIT': return 'hit';
13 case 'MISS': return 'miss';
14 case 'BUST': return 'bust';
15 case '': return 'none';
16 }
17 return assertNever(s);
18};
19void cacheLabel;
21const cacheMissing = (s: PackCacheStatus): string => {
22 switch (s) {
23 case 'HIT': return 'hit';
24 case 'MISS': return 'miss';
25 case 'BUST': return 'bust';
26 }
27 // @ts-expect-error '' is still possible, so s is not never
28 return assertNever(s);
29};
30void cacheMissing;
32const typeLabel = (t: PackKind): string => {
33 switch (t) {
34 case 'commit': case 'tree': case 'blob': case 'tag': case 'ofs_delta': case 'ref_delta': return t;
35 }
36 return assertNever(t);
37};
38void typeLabel;
40const typeMissing = (t: PackKind): string => {
41 switch (t) {
42 case 'commit': case 'tree': case 'blob': case 'tag': case 'ofs_delta': return t;
43 }
44 // @ts-expect-error 'ref_delta' is still possible, so t is not never
45 return assertNever(t);
46};
47void typeMissing;
49const featureLabel = (f: FetchFeature): string => {
50 switch (f) {
51 case 'filter': case 'shallow': case 'wait-for-done': case 'ref-in-want': case 'sideband-all': return f;
52 }
53 return assertNever(f);
54};
55void featureLabel;
57const featureMissing = (f: FetchFeature): string => {
58 switch (f) {
59 case 'filter': return f;
60 }
61 // @ts-expect-error the other fetch features are still possible, so f is not never
62 return assertNever(f);
63};
64void featureMissing;
66const formatLabel = (f: KnownObjectFormat): string => {
67 switch (f) {
68 case 'sha1': case 'sha256': return f;
69 }
70 return assertNever(f);
71};
72void formatLabel;
74const formatMissing = (f: KnownObjectFormat): string => {
75 switch (f) {
76 case 'sha1': return f;
77 }
78 // @ts-expect-error 'sha256' is still possible, so f is not never
79 return assertNever(f);
80};
81void formatMissing;
83const capLabel = (c: RequiredV2Cap): string => {
84 switch (c) {
85 case 'ls-refs': case 'fetch': return c;
86 }
87 return assertNever(c);
88};
89void capLabel;
91const capMissing = (c: RequiredV2Cap): string => {
92 switch (c) {
93 case 'ls-refs': return c;
94 }
95 // @ts-expect-error 'fetch' is still possible, so c is not never
96 return assertNever(c);
97};
98void capMissing;
100const statusLabel = (s: NamedHttpStatus): string => {
101 switch (s) {
102 case 401: case 403: case 404: case 429: return String(s);
103 }
104 return assertNever(s);
105};
106void statusLabel;
108const statusMissing = (s: NamedHttpStatus): string => {
109 switch (s) {
110 case 401: case 403: case 404: return String(s);
111 }
112 // @ts-expect-error 429 is still possible, so s is not never
113 return assertNever(s);
114};
115void statusMissing;
Diagnostics7 git calls · 131 ms
CallStatusSizeTime0131 ms
discover200191 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=191
git.server.agent=git/github-9922ec520325-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=191
git.pkt.payload.max=36
ls-refs20012 KiB · 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=11990
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=152
git.pkt.data=151
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=11990
git.pkt.payload.max=122
git.ls_refs.count=151
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 102004.2 KiB · hit3 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=4347
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=19912563f540228593df0c489082e5e2508e21e4
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=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4347
git.pkt.payload.max=4247
git.sideband.band1.bytes=4247
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=4247
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=a6caf8e129bea82c9bae4cbc7c130c9205add400
git.pack.full=10
Open pack map
fetchtree:0200919 B · hit2 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=919
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=800d30ba8923860bfc460ca884b7f9ba22083588
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=919
git.pkt.payload.max=892
git.sideband.band1.bytes=892
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=892
git.pack.trailer=5323b9266eea5ded637285d1c5320699f12be76e
Open pack map
fetchtree:02005.6 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=5724
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=58fabb6768b3f737ee9cd8bac647bdc27405fb4d
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=5724
git.pkt.payload.max=5697
git.sideband.band1.bytes=5697
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=5697
git.pack.trailer=be7e0453974a5fe832f9065a33bb7e3434c10e9b
Open pack map
fetchtree:0200746 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=117
git.response.bytes=746
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=1a4f84aea08d080a229290d401e77da8415108a0
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=746
git.pkt.payload.max=719
git.sideband.band1.bytes=719
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=719
git.pack.trailer=fd3904a205b94cd1bbf03c591c9acea7ca5dd5a7
Open pack map
fetch200876 B117 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=876
git.response.cache=MISS
git.response.duration_ms=117
git.fetch.wants=a2b60cca5058af3c57a508cf0a1799e8e76152f3
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=876
git.pkt.payload.max=849
git.sideband.band1.bytes=849
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://github.com/ivarvong/ply
Ref
refs/heads/main
Commit
19912563f540228593df0c489082e5e2508e21e4
cf-ray
a5e33840ce6124ce
Request
ace29dbe…
Protocol
v2 · sha1
Agent
git/github-9922ec520325-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format