Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output more details #188

Merged
merged 4 commits into from Nov 25, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

display remote pieces progress per wire

this one is costly, could use some caching.
  • Loading branch information
astro committed Nov 22, 2014
commit 12cbf810d6f3a751b1164be9503715d047ab9561
@@ -384,12 +384,24 @@ function onReady () {
linesremaining -= 1

wires.every(function (wire) {
var progress = '?'
if (torrent.parsedTorrent) {
var bits = 0
var piececount = Math.ceil(torrent.parsedTorrent.length / torrent.parsedTorrent.pieceLength)
for(var i = 0; i < piececount; i++) {
if (wire.peerPieces.get(i)) {
bits++
}
}
progress = bits === piececount ? 'S' : Math.floor(100 * bits / piececount) + '%'
}
var tags = []
if (wire.peerChoking) tags.push('choked')
var reqStats = wire.requests.map(function(req) {
return req.piece;
})
clivas.line(
'{3:' + progress + '} ' +
'{25+magenta:' + wire.remoteAddress + '} {10:'+bytes(wire.downloaded)+'} ' +
'{10+cyan:' + bytes(wire.downloadSpeed()) + '/s} ' +
'{10+red:' + bytes(wire.uploadSpeed()) + '/s} ' +
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.