Repository navigation
v0.0.17 — pull --json says what the transfer cost
v0.0.17 — pull --json says what the transfer cost
"bytes" in pull --json was the sum of the file sizes. That is the size of
what landed on disk, not what the transfer cost — and for the case this tool
exists for (an interrupted transfer that resumes), the two numbers differ by
exactly the interesting amount.
zapsend pull --to gpu-box --dir ./results --json | jq '{bytes, transferred}'{ "bytes": 300000000, "transferred": 280000000 }That is a 300 MB file whose first 20 MB were already on disk: it cost 280 MB of
traffic. A fresh pull of the same file reports transferred equal to bytes.
The counter is incremented per body chunk as it is read, so it includes work that
was later thrown away — a corrupt partial that had to be discarded, a retry after
a dropped connection, a resumed download that started over because the peer sent
the whole file. It is the honest number to bill, throttle or log against.
"bytes" is unchanged, so nothing that already parses pull --json breaks.
Verified
The Windows build in this release, on WinPE 10.0.26100.1742 under QEMU
(-cpu max), pulling 314,572,817 B from a Linux peer:
{"bytes":314572817, ..., "transferred":314572817}Resumed download on Linux, 300 MB file with a 20 MB partial already present:
bytes = 300000000
transferred = 280000000
sha256 = matches the source
Host suites: 15 unit, 31 compat, 28 json, 25 pull-resume (four new checks
cover this field), 29 hosts, 19 pull, 17 resume.
One process fix behind the numbers
The local test harness defaulted to a prebuilt binary in a scratch directory, and
that binary was three versions old — so a suite could pass while the change under
test was not in the binary at all. Each harness script now refuses to run when
the binary's --version does not match Cargo.toml.