create --stats: populate bytes read/sent from store stats#9866
Conversation
bbeda25 to
855478d
Compare
|
I think the last pack should already get flushed before the archive pointer is created. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9866 +/- ##
==========================================
+ Coverage 85.09% 85.12% +0.03%
==========================================
Files 93 93
Lines 15450 15478 +28
Branches 2335 2343 +8
==========================================
+ Hits 13147 13176 +29
+ Misses 1604 1600 -4
- Partials 699 702 +3 ☔ View full report in Codecov by Harness. |
rx_bytes/tx_bytes only exist on the legacy RemoteRepository, so they always read 0 for borgstore repositories. Sample repository.store.stats after the cache is closed, rename the labels remote->repository, and add them to --json. fixes borgbackup#9405
855478d to
fbd50c5
Compare
agreed!, the last pack is already flushed in Archives.create() before the pointer is written, so my comment was wrong on that. The real reason to sample after cache close is that Cache.close() writes the chunks index to the repo, and if we want that traffic counted too. |
fbd50c5 to
b1cb09e
Compare
Replace the rx_bytes/tx_bytes summary with the complete store.stats dict (call counts, timings, throughput, cache hit ratio) in --stats and --json output.
b1cb09e to
54dede3
Compare
Description
On borgstore-backed repositories,
borg create --statsalways printed "Bytes read/sent from remote: 0".rx_bytesandtx_bytesonly exist on the legacyRemoteRepository. A modern repository doesn't have them, sogetattr(repository, "rx_bytes", 0)returned 0 every time.Rather than pulling two numbers out of
repository.store.stats, this now reports the full store stats dict: call counts and timings per operation, load/store volume and throughput, and cache hit/miss numbers. Each entry gets its own "Store : " line in--statsoutput, and the full dict is included understore_statsin--json.The stats are sampled after the cache is closed, since
Cache.close()writes the chunks index to the repo and that traffic should be counted too. The create epilog documents what the store stats mean.fixes #9405
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)