Skip to content

More Modular Code & Simpler CLI Output#497

Merged
joehand merged 29 commits intomasterfrom
logger-module
Jul 8, 2016
Merged

More Modular Code & Simpler CLI Output#497
joehand merged 29 commits intomasterfrom
logger-module

Conversation

@joehand
Copy link
Copy Markdown
Collaborator

@joehand joehand commented Jul 5, 2016

CLI Goodness! https://www.youtube.com/watch?v=fxKjSyCoqO4

Fixed

  • Use yolowatch module for recursive live updates
  • Improved stats for edge cases
  • Print link with --quiet argument

Changed

Removed

  • List download option (will be re-added pending a hyperdrive update)

Added

@okdistribute
Copy link
Copy Markdown
Collaborator

Nice, thanks for the detailed changelog report. It's super important to document how things are changing, good work!

printSwarm()
})

dat.on('download-finished', function () {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a great interface


function printStats (data) {
var stats = dat.stats
var files = stats.filesTotal
Copy link
Copy Markdown
Collaborator

@okdistribute okdistribute Jul 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what items are on .stats and which are on .appendStats and which aren't on either?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Karissa they overlap and could definitely use some improvement/more thought. One issue I keep running into is showing files vs "items" (files + dirs), since hyperdrive uses the combined total for it's count (archive.metadata.blocks).

.appendStats is files, dirs, and bytes calculated on sharing start. .stats is always the current archive stats, which gets updated as files are appended (initially and live).

stats = {
    filesTotal: 0,
    bytesTotal: 0,
    bytesUp: 0,
    bytesDown: 0,
    rateUp: speedometer(),
    rateDown: speedometer()
}

appendStats = {
    files: 0,
    bytes: 0,
    dirs: 0
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ErieMeyer ERIE YOU CREEPER

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this! We could just document these values in the README (if we want, even though it's not a public API) and ship it! :)

@okdistribute
Copy link
Copy Markdown
Collaborator

lgtm

@joehand joehand merged commit 6b6e6b6 into master Jul 8, 2016
@joehand joehand deleted the logger-module branch July 8, 2016 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants