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

Add time remaining estimate and minor fixes #56

Merged
merged 10 commits into from May 18, 2014

merge changes

  • Loading branch information
transitive-bullshit committed May 15, 2014
commit b784a88d6ac370839c5cb46e2312848a7d861177
@@ -165,14 +165,14 @@ client.once('torrent', function (torrent) {
return numeral(num).format('0.0b')
}

var getRuntime = function () {
function getRuntime () {
return Math.floor((Date.now() - started) / 1000)
}

if (!quiet) {
process.stdout.write(new Buffer('G1tIG1sySg==', 'base64')); // clear for drawing

var draw = function() {
function draw () {
var unchoked = swarm.wires.filter(active)
var runtime = getRuntime()
var linesremaining = clivas.height
@@ -190,18 +190,18 @@ client.once('torrent', function (torrent) {
clivas.line('{80:}')
linesremaining -= 8

wires.every(function(wire) {
wires.every(function (wire) {
var tags = []
if (wire.peerChoking) tags.push('choked')
clivas.line('{25+magenta:'+wire.remoteAddress+'} {10:'+bytes(wire.downloaded)+'} {10+cyan:'+bytes(wire.downloadSpeed())+'/s} {15+grey:'+tags.join(', ')+'} ')
peerslisted++
return linesremaining-peerslisted > 4
return linesremaining - peerslisted > 4
})
linesremaining -= peerslisted

if (wires.length > peerslisted) {
clivas.line('{80:}')
clivas.line('... and '+(wires.length-peerslisted)+' more ')
clivas.line('... and '+(wires.length - peerslisted)+' more ')
}

clivas.line('{80:}')
You are viewing a condensed version of this merge commit. You can view the full changes here.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.