cmd/torrent: Dump download statistics
This commit is contained in:
parent
33883c04e4
commit
00a7300421
|
@ -369,6 +369,15 @@ func downloadErr(flags downloadFlags) error {
|
|||
<-stop.C()
|
||||
}
|
||||
}
|
||||
spew.Dump(expvar.Get("torrent").(*expvar.Map).Get("chunks received"))
|
||||
spew.Dump(client.ConnStats())
|
||||
clStats := client.ConnStats()
|
||||
sentOverhead := clStats.BytesWritten.Int64() - clStats.BytesWrittenData.Int64()
|
||||
log.Printf(
|
||||
"client read %v, %v was useful data. sent %v non-data bytes",
|
||||
humanize.Bytes(uint64(clStats.BytesRead.Int64())),
|
||||
100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()),
|
||||
humanize.Bytes(uint64(sentOverhead)))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue