1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 17:22:21 +08:00

allow bitswap stat to output wasted bytes

bitswap stat can now track bytes that are wasted by receiving duplicate
blocks.

ps, gitcop smells

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-09-25 14:02:20 -07:00
parent 5b9811371c
commit 0c7421643d
3 changed files with 8 additions and 3 deletions

View File

@ -156,6 +156,7 @@ var bitswapStatCmd = &cmds.Command{
fmt.Fprintf(buf, "\tprovides buffer: %d / %d\n", out.ProvideBufLen, bitswap.HasBlockBufferSize)
fmt.Fprintf(buf, "\tblocks received: %d\n", out.BlocksReceived)
fmt.Fprintf(buf, "\tdup blocks received: %d\n", out.DupBlksReceived)
fmt.Fprintf(buf, "\tdup data received: %d\n", out.DupDataReceived)
fmt.Fprintf(buf, "\twantlist [%d keys]\n", len(out.Wantlist))
for _, k := range out.Wantlist {
fmt.Fprintf(buf, "\t\t%s\n", k.B58String())