GitHubivarvong
ply
main
1// The async-iterable adapters over the pull decoders (#241, src/pullstream.ts): scanPack, pktFrames, inflateChunks.
2// - identical items to the pull API over every chunking (whole, one byte at a time, seeded random cuts), from a
3// ReadableStream and from an AsyncIterable
4// - a break, a throw in the loop body and reader.cancel() cancel the source (cancel(reason) / return() observed)
5// - a refusal errors the stream with the decoder's typed PlyError and cancels the source; malformed input of every
6// kind each decoder refuses; a source that errors errors the stream with its own error; a chunk that is not bytes
7// - backpressure: the source is read one chunk per need and never ahead; a consumer that stops stops the reads
8// Memory (the adapters hold the decoders' bound) is measured in test/stream-memory.test.js (scan-iter, inflate-iter).
9import { test } from 'vitest';
10import assert from 'node:assert/strict';
11import zlib from 'node:zlib';
12import { Rng, splitRandom } from './fuzz/prng.js';
13import { concat, te } from '../src/bytes.js';
14import { pkt, pktInit, pktStep, pktFinish, FLUSH, DELIM } from '../src/pktline.js';
15import { buildPack, makeDelta } from '../src/pack.js';
16import { inflateInit, inflateFeed, inflatePull, inflateEnd, cappedBound, declaredBound, zlibWrap, rawWrap } from '../src/inflatestream.js';
17import { parsePackInit, parsePackFeed, parsePackPull, parsePackEnd, WORK_BUDGET } from '../src/packstream.js';
18import { scanPack, pktFrames, inflateChunks } from '../src/pullstream.js';
19import { isPlyError } from '../src/errors.js';
20import { hashObject, TYPE } from '../src/objects.js';
21import { withLimits } from '../src/limits.js';
22import { unwrap } from './unwrap.js';
24// ---- sources
25// A ReadableStream over `chunks` that records every pull and its cancel; highWaterMark 0, so a pull is a read.
26function recorded(chunks) {
27 const log = { pulls: 0, cancelled: [], closed: false };
28 let i = 0;
29 const stream = new ReadableStream({
30 pull(c) { log.pulls += 1; if (i < chunks.length) c.enqueue(chunks[i++]); else { log.closed = true; c.close(); } },
31 cancel(why) { log.cancelled.push(why); },
32 }, { highWaterMark: 0 });
33 return { stream, log };
34}
35// An AsyncIterable over `chunks` that records next() and return().
36function iterable(chunks) {
37 const log = { nexts: 0, returned: 0 };
38 return {
39 log,
40 source: {
41 [Symbol.asyncIterator]() {
42 let i = 0;
43 return {
44 async next() { log.nexts += 1; return i < chunks.length ? { done: false, value: chunks[i++] } : { done: true, value: undefined }; },
45 async return() { log.returned += 1; return { done: true, value: undefined }; },
46 };
47 },
48 },
49 };
50}
51const chunkings = bytes => {
52 const out = [['whole', [bytes]], ['bytes', Array.from(bytes, b => Uint8Array.of(b))]];
53 for (const seed of [1, 2, 3, 20261110]) out.push([`random ${seed}`, splitRandom(new Rng(seed), bytes, { maxChunks: 64 })]);
54 return out;
55};
56async function collect(stream) { const out = []; for await (const x of stream) out.push(x); return out; }
57async function failure(stream) {
58 const seen = [];
59 try { for await (const x of stream) seen.push(x); } catch (e) { return { e, seen }; }
60 return assert.fail(`no error after ${seen.length} items`);
61}
62const ply = (e, code) => { assert.ok(isPlyError(e), `not a PlyError: ${e}`); assert.equal(e.code, code, e.message); };
63const copy = p => (p.kind === 'chunk' ? { ...p, bytes: Uint8Array.from(p.bytes) } : p);
65// ---- the reference drivers: the pull API, by hand
66function pullPack(chunks, opts) {
67 const st = unwrap(parsePackInit(opts));
68 const out = [];
69 const drain = p => { for (;;) { const r = p ?? parsePackPull(st); p = undefined; if (!r.ok) return r.error; if (r.value.kind === 'need') return null; if (r.value.kind === 'end') return 'end'; out.push(copy(r.value)); } };
70 for (const c of chunks) { parsePackFeed(st, c); const d = drain(); if (d !== null) return { out, end: d }; }
71 return { out, end: drain(parsePackEnd(st)) };
72}
73function pullPkt(chunks) {
74 let st = pktInit();
75 const out = [];
76 for (const c of chunks) { const r = pktStep(st, c); if (!r.ok) return { out, end: r.error }; st = r.value.state; out.push(...r.value.frames); }
77 const f = pktFinish(st);
78 return { out, end: f.ok ? 'end' : f.error };
79}
81// ---- a pack with every kind of piece: whole objects, an OFS and a REF delta, a large blob of several chunks
82const blob = n => Uint8Array.from({ length: n }, (_, i) => (i * 7 + (i >> 8)) & 255);
83async function samplePack() {
84 const base = te.encode('line\n'.repeat(400));
85 const next = te.encode('line\n'.repeat(399) + 'changed\n');
86 const big = blob(80_000);
87 return (await buildPack([
88 { type: TYPE.BLOB, data: base },
89 { type: TYPE.BLOB, data: makeDelta(base, next).delta, base: { tag: 'ofs', index: 0 } },
90 { type: TYPE.BLOB, data: big },
91 { type: TYPE.BLOB, data: makeDelta(base, te.encode('x')).delta, base: { tag: 'ref', oid: hashObject('blob', base) } },
92 { type: TYPE.COMMIT, data: te.encode('tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\nauthor a <a@x> 1 +0000\ncommitter a <a@x> 1 +0000\n\nm\n') },
93 ])).pack;
94}
96test('scanPack: the same pieces as the pull API over every chunking, from a ReadableStream and an AsyncIterable', async () => {
97 const pack = await samplePack();
98 for (const [name, chunks] of chunkings(pack)) {
99 const want = pullPack(chunks, { verify: true, limits: withLimits({}) });
100 assert.equal(want.end, 'end', name);
101 const kinds = new Set(want.out.map(p => p.kind));
102 assert.deepEqual([...kinds].sort(), ['chunk', 'header', 'object', 'object-end', 'trailer'], name);
103 const fromStream = (await collect(scanPack(recorded(chunks).stream))).map(copy);
104 const fromIter = (await collect(scanPack(iterable(chunks).source))).map(copy);
105 assert.deepEqual(fromStream, want.out, `${name}: stream`);
106 assert.deepEqual(fromIter, want.out, `${name}: iterable`);
107 assert.ok(!fromStream.some(p => p.kind === 'need' || p.kind === 'end'), 'need and end are never items');
108 }
109});
111test('scanPack: options reach the scan (WORK_BUDGET reads a blob past maxObjectSize; verify off skips the trailer check)', async () => {
112 const pack = await samplePack();
113 const tight = withLimits({ maxObjectSize: 1024 });
114 ply((await failure(scanPack(recorded([pack]).stream, { limits: tight }))).e, 'limit_exceeded');
115 const worked = await collect(scanPack(recorded([pack]).stream, { limits: tight, budget: WORK_BUDGET }));
116 assert.equal(worked.filter(p => p.kind === 'object-end').length, 5);
117 const bad = Uint8Array.from(pack); bad[bad.length - 1] ^= 1;
118 ply((await failure(scanPack(recorded([bad]).stream))).e, 'pack_corrupt');
119 assert.equal((await collect(scanPack(recorded([bad]).stream, { verify: false }))).at(-1).kind, 'trailer');
120});
122test('scanPack: every refusal is the pull API\'s, typed, after the pieces before it; the source is cancelled with it', async () => {
123 const pack = await samplePack();
124 const flip = (at) => { const b = Uint8Array.from(pack); b[at] ^= 0xff; return b; };
125 const cases = [
126 ['bad signature', flip(0), 'pack_corrupt'],
127 ['bad version', flip(7), 'pack_corrupt'],
128 ['truncated', pack.subarray(0, pack.length - 30), 'pack_corrupt'],
129 ['trailer', flip(pack.length - 1), 'pack_corrupt'],
130 ['corrupt member', flip(40), 'pack_corrupt'],
131 ['empty', new Uint8Array(0), 'pack_corrupt'],
132 ['too many objects', pack, 'limit_exceeded', withLimits({ maxPackObjects: 2 })],
133 ['inflated total', pack, 'limit_exceeded', withLimits({ maxInflatedTotal: 10_000 })],
134 ];
135 for (const [name, bytes, code, limits] of cases) {
136 for (const [cut, chunks] of chunkings(bytes).slice(0, 3)) {
137 const want = pullPack(chunks, { verify: true, limits: limits ?? withLimits({}) });
138 assert.notEqual(want.end, 'end', `${name} ${cut}: the pull API refuses`);
139 const { stream, log } = recorded(chunks);
140 const { e, seen } = await failure(scanPack(stream, limits ? { limits } : {}));
141 ply(e, code);
142 assert.equal(e.message, want.end.message, `${name} ${cut}`);
143 assert.deepEqual(seen.map(copy), want.out, `${name} ${cut}: the pieces before the refusal`);
144 if (!log.closed) assert.deepEqual(log.cancelled, [e], `${name} ${cut}: the source is cancelled with the refusal`);
145 }
146 }
147});
149test('scanPack: bad options error the stream on the first read and cancel the source', async () => {
150 const { stream, log } = recorded([new Uint8Array(1)]);
151 const { e } = await failure(scanPack(stream, { limits: { maxPackObjects: -1 } }));
152 ply(e, 'bad_request');
153 assert.deepEqual(log.cancelled, [e]);
154 assert.equal(log.pulls, 0, 'nothing was read');
155 const { e: e2 } = await failure(scanPack(recorded([]).stream, { budget: { tag: 'work', ratio: Number.NaN, capObjects: false } }));
156 ply(e2, 'bad_request');
157});
159test('a source that errors errors the stream with its own error (all three adapters, both source kinds)', async () => {
160 const boom = new Error('source died');
161 const pack = await samplePack();
162 const make = first => [
163 () => new ReadableStream({ start(c) { c.enqueue(first); }, pull(c) { c.error(boom); } }),
164 () => ({ [Symbol.asyncIterator]() { let n = 0; return { async next() { if (n++ === 0) return { done: false, value: first }; throw boom; } }; } }),
165 ];
166 for (const [adapter, first] of [[scanPack, pack.subarray(0, 40)], [pktFrames, unwrap(pkt('a\n'))], [inflateChunks, zlib.deflateSync(blob(100)).subarray(0, 10)]]) {
167 for (const src of make(first)) {
168 const { e } = await failure(adapter(src()));
169 assert.equal(e, boom, `${adapter.name}: the source's own error`);
170 }
171 }
172});
174test('a chunk that is not a Uint8Array is bad_request (string, array, ArrayBuffer), and the source is cancelled', async () => {
175 for (const adapter of [scanPack, pktFrames, inflateChunks]) {
176 for (const junk of ['PACK', [1, 2, 3], new ArrayBuffer(4), 7]) {
177 const { stream, log } = recorded([junk]);
178 const { e } = await failure(adapter(stream));
179 ply(e, 'bad_request');
180 assert.match(e.message, /not a Uint8Array/);
181 assert.deepEqual(log.cancelled, [e], `${adapter.name} ${typeof junk}`);
182 }
183 }
184});
186test('break, a throw in the loop body, and reader.cancel() cancel the source; iteration after that is over', async () => {
187 const pack = await samplePack();
188 const frames = concat([unwrap(pkt('a\n')), unwrap(pkt('b\n')), FLUSH]);
189 const member = zlib.deflateSync(blob(200_000));
190 for (const [adapter, bytes] of [[scanPack, pack], [pktFrames, frames], [inflateChunks, member]]) {
191 const chunks = splitRandom(new Rng(9), bytes, { maxChunks: 16, allowEmpty: false });
192 // break after the first item
193 { const { stream, log } = recorded(chunks); let n = 0; for await (const _ of adapter(stream)) { n++; break; } assert.equal(n, 1); assert.equal(log.cancelled.length, 1, `${adapter.name}: break`); assert.ok(log.pulls < chunks.length + 1, 'not read to the end'); }
194 // a throw in the body
195 { const { stream, log } = recorded(chunks); const oops = new Error('body'); await assert.rejects((async () => { for await (const _ of adapter(stream)) throw oops; })(), e => e === oops); assert.equal(log.cancelled.length, 1, `${adapter.name}: throw`); }
196 // AsyncIterable source: return() is called
197 { const { source, log } = iterable(chunks); for await (const _ of adapter(source)) break; assert.equal(log.returned, 1, `${adapter.name}: iterable return()`); }
198 // reader.cancel(reason) passes the reason through, and the stream reads done after it
199 { const { stream, log } = recorded(chunks); const s = adapter(stream); const r = s.getReader(); assert.equal((await r.read()).done, false); const why = new Error('stop'); await r.cancel(why); assert.deepEqual(log.cancelled, [why]); assert.equal((await r.read()).done, true); }
200 // cancel before any read: the source is cancelled without being read
201 { const { stream, log } = recorded(chunks); await adapter(stream).cancel('early'); assert.deepEqual(log.cancelled, ['early']); assert.equal(log.pulls, 0); }
202 }
203});
205test('a cancel while a read of the source is out: the read\'s chunk is not decoded and nothing is enqueued after', async () => {
206 let release;
207 const gate = new Promise(r => { release = r; });
208 let cancelled = 0;
209 const stream = new ReadableStream({ async pull(c) { await gate; c.enqueue(unwrap(pkt('late\n'))); }, cancel() { cancelled++; } }, { highWaterMark: 0 });
210 const r = pktFrames(stream).getReader();
211 const pending = r.read();
212 await new Promise(res => setTimeout(res, 10));
213 await r.cancel('stop');
214 release();
215 assert.equal((await pending).done, true);
216 assert.equal(cancelled, 1);
217});
219test('backpressure: one source read per need, none ahead; a consumer that stops reading stops the reads', async () => {
220 const pack = await samplePack();
221 const bytes1 = Array.from(pack, b => Uint8Array.of(b));
222 const { stream, log } = recorded(bytes1);
223 const r = scanPack(stream).getReader();
224 const header = await r.read();
225 assert.equal(header.value.kind, 'header');
226 // the scan decides the header on 32 bytes (a header and a trailer's worth, as parsePack): exactly that many reads
227 assert.equal(log.pulls, 32);
228 await new Promise(res => setTimeout(res, 30));
229 assert.equal(log.pulls, 32, 'no read while nobody reads');
230 const object = await r.read();
231 assert.equal(object.value.kind, 'object');
232 assert.ok(log.pulls <= 34, `the first object header: ${log.pulls} reads`);
233 // pkt-lines: a frame read a byte at a time is read to its last byte and no further
234 const two = concat([unwrap(pkt('x'.repeat(1000))), unwrap(pkt('y'))]);
235 const p = recorded(Array.from(two, b => Uint8Array.of(b)));
236 const pr = pktFrames(p.stream).getReader();
237 assert.equal((await pr.read()).value.payload.length, 1000);
238 assert.equal(p.log.pulls, 1004);
239 await pr.cancel();
240 // inflate: a 1 MiB member fed in 4 KiB chunks, the consumer takes one chunk: the reads stop at what one chunk needed
241 const member = zlib.deflateSync(blob(1 << 20), { level: 0 });
242 const m = recorded(Array.from({ length: Math.ceil(member.length / 4096) }, (_, i) => member.subarray(i * 4096, (i + 1) * 4096)));
243 const mr = inflateChunks(m.stream).getReader();
244 await mr.read();
245 assert.ok(m.log.pulls <= 6, `one 16 KiB chunk out: ${m.log.pulls} 4 KiB reads`);
246 await mr.cancel();
247});
249test('a byte at a time across a 65,516-byte pkt-line: no per-need hold (the reads run as fresh rounds)', async () => {
250 const big = unwrap(pkt(new Uint8Array(65_516).fill(97)));
251 const frames = await collect(pktFrames(recorded([...Array.from(big, b => Uint8Array.of(b)), FLUSH]).stream));
252 assert.deepEqual(frames.map(f => f.kind), ['data', 'flush']);
253 assert.equal(frames[0].payload.length, 65_516);
254});
256test('pktFrames: the same frames as pktStep over every chunking; data, flush, delim, response-end', async () => {
257 const wire = concat([unwrap(pkt('version 2\n')), DELIM, unwrap(pkt(new Uint8Array(3000).fill(1))), FLUSH, te.encode('0002'), unwrap(pkt('done'))]);
258 for (const [name, chunks] of chunkings(wire)) {
259 const want = pullPkt(chunks);
260 assert.equal(want.end, 'end');
261 assert.deepEqual(await collect(pktFrames(recorded(chunks).stream)), want.out, name);
262 assert.deepEqual(await collect(pktFrames(iterable(chunks).source)), want.out, name);
263 }
264});
266test('pktFrames: malformed input is pktStep\'s protocol refusal (bad hex, 0003, past LARGE_PACKET_MAX, cut inside a frame)', async () => {
267 const good = unwrap(pkt('ok\n'));
268 const cases = [
269 ['bad hex', concat([good, te.encode('00zz')])],
270 ['0003', concat([good, te.encode('0003')])],
271 ['too long', concat([good, te.encode('fff5'), new Uint8Array(65_520)])],
272 ['cut in a payload', concat([good, te.encode('000aab')])],
273 ['cut in a length', concat([good, te.encode('00')])],
274 ];
275 for (const [name, bytes] of cases) {
276 for (const [cut, chunks] of chunkings(bytes).slice(0, 3)) {
277 const want = pullPkt(chunks);
278 assert.notEqual(want.end, 'end', name);
279 const { stream, log } = recorded(chunks);
280 const { e, seen } = await failure(pktFrames(stream));
281 ply(e, 'protocol');
282 assert.equal(e.message, want.end.message, `${name} ${cut}`);
283 assert.deepEqual(seen, want.out, `${name} ${cut}`);
284 if (!log.closed) assert.deepEqual(log.cancelled, [e]);
285 }
286 }
287});
289test('inflateChunks: the output zlib inflates to, over every chunking; zlib and raw, capped and declared', async () => {
290 const data = concat([blob(70_000), te.encode('tail '.repeat(5000))]);
291 const variants = [
292 ['zlib capped', zlib.deflateSync(data), {}],
293 ['zlib stored', zlib.deflateSync(data, { level: 0 }), {}],
294 ['zlib declared', zlib.deflateSync(data, { level: 9 }), { bound: declaredBound(data.length) }],
295 ['raw', zlib.deflateRawSync(data), { wrap: rawWrap(), bound: cappedBound() }],
296 ['empty', zlib.deflateSync(new Uint8Array(0)), {}],
297 ];
298 for (const [name, member, opts] of variants) {
299 const want = name === 'empty' ? new Uint8Array(0) : data;
300 for (const [cut, chunks] of chunkings(member)) {
301 if (cut === 'bytes' && member.length > 20_000) continue;
302 const out = await collect(inflateChunks(recorded(chunks).stream, opts));
303 assert.deepEqual(Buffer.from(concat(out)), Buffer.from(want), `${name} ${cut}`);
304 assert.ok(out.every(c => c.length <= 16_384), 'chunks of at most INFLATE_CHUNK');
305 assert.deepEqual(Buffer.from(concat(await collect(inflateChunks(iterable(chunks).source, opts)))), Buffer.from(want), `${name} ${cut}: iterable`);
306 }
307 }
308 // a member fed one byte at a time, the slow path
309 const small = zlib.deflateSync(te.encode('hello, '.repeat(300)));
310 assert.equal(new TextDecoder().decode(concat(await collect(inflateChunks(recorded(Array.from(small, b => Uint8Array.of(b))).stream)))), 'hello, '.repeat(300));
311});
313test('inflateChunks: corrupt, truncated, trailing, oversized and mis-declared members are typed refusals', async () => {
314 const data = blob(50_000);
315 const member = zlib.deflateSync(data);
316 const flip = at => { const b = Uint8Array.from(member); b[at] ^= 0xff; return b; };
317 const cases = [
318 ['bad header', flip(0), 'pack_corrupt', {}],
319 ['bad adler', flip(member.length - 1), 'pack_corrupt', {}],
320 ['truncated', member.subarray(0, member.length - 5), 'pack_corrupt', {}],
321 ['empty', new Uint8Array(0), 'pack_corrupt', {}],
322 ['trailing byte, same chunk', concat([member, Uint8Array.of(0)]), 'pack_corrupt', {}],
323 ['trailing member', concat([member, member]), 'pack_corrupt', {}],
324 ['past maxOutput', member, 'limit_exceeded', { bound: cappedBound(10_000) }],
325 ['declared shorter', member, 'pack_corrupt', { bound: declaredBound(1000) }],
326 ['declared longer', member, 'pack_corrupt', { bound: declaredBound(60_000) }],
327 ];
328 for (const [name, bytes, code, opts] of cases) {
329 for (const [cut, chunks] of chunkings(bytes).slice(0, 3)) {
330 if (cut === 'bytes' && bytes.length > 2000) continue;
331 const { stream, log } = recorded(chunks);
332 const { e } = await failure(inflateChunks(stream, opts));
333 ply(e, code);
334 if (!log.closed) assert.deepEqual(log.cancelled, [e], `${name} ${cut}`);
335 }
336 }
337 // a trailing byte in a later chunk than the member's end
338 const { e } = await failure(inflateChunks(recorded([member, Uint8Array.of(1)]).stream));
339 ply(e, 'pack_corrupt');
340 assert.match(e.message, /1 bytes after the end/);
341 // empty chunks after the end are not bytes after it
342 assert.equal(concat(await collect(inflateChunks(recorded([member, new Uint8Array(0), new Uint8Array(0)]).stream))).length, data.length);
343 // bad options: the stream errors on the first read
344 ply((await failure(inflateChunks(recorded([member]).stream, { bound: cappedBound(-1) }))).e, 'bad_request');
345});
347test('inflateChunks agrees with the pull API on the same member (same chunks, byte for byte)', async () => {
348 const member = zlib.deflateSync(blob(100_000));
349 const st = unwrap(inflateInit({ bound: cappedBound(), wrap: zlibWrap(true) }));
350 const want = [];
351 inflateFeed(st, member);
352 for (let p = unwrap(inflatePull(st)); p.kind !== 'end'; p = unwrap(p.kind === 'need' ? inflateEnd(st) : inflatePull(st))) if (p.kind === 'chunk') want.push(p.bytes);
353 assert.deepEqual(await collect(inflateChunks(recorded([member]).stream)), want);
354});
356// The package root is imported here, inside the test, not at the top of the file: a static import would load every module
357// src/index.ts re-exports before any test runs, making each of their module-level mutants static, run against all 412
358// mutation tests (errors-doc.ts alone: 79 mutants, a 26-80 min shard, #313). Inside the test they are covered by it.
359test('the adapters are exported from the package root', async () => {
360 const index = await import('../src/index.js');
361 assert.equal(index.scanPack, scanPack);
362 assert.equal(index.pktFrames, pktFrames);
363 assert.equal(index.inflateChunks, inflateChunks);
364});
Diagnostics6 git calls · 96 ms
CallStatusSizeTime096 ms
discover200191 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 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 · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=11990 git.response.cache=HIT git.response.duration_ms=2 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 · 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=4347 git.response.cache=HIT git.response.duration_ms=2 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=10Open 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=2 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=5323b9266eea5ded637285d1c5320699f12be76eOpen pack map
fetchtree:02005.6 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=88 git.response.bytes=5724 git.response.cache=HIT git.response.duration_ms=2 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=be7e0453974a5fe832f9065a33bb7e3434c10e9bOpen pack map
fetch2006.1 KiB88 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=6247 git.response.cache=MISS git.response.duration_ms=88 git.fetch.wants=71a4f49e6c7869efb4c5648b8ef6754d9351e55d 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=6247 git.pkt.payload.max=6220 git.sideband.band1.bytes=6220 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
- a5e0f829faa7332c
- Request
- 6c746d83…
- 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