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

Fixes #10: Render progress bar programmatically. #13

Merged
merged 3 commits into from
Jun 23, 2016

Conversation

GlenTiki
Copy link
Collaborator

@GlenTiki GlenTiki commented Jun 22, 2016

Users can pass renderProgressBar: true to render the
progress bar from an external tool. Additionally, they
can provide progressBarString: SOME_STRING to modify
the output format of the progress bar. This string must
meet the format specified in npm.im/progress

This will require a review.

Additionally... how should I test this?

Users can pass `renderProgressBar: true` to render the
progress bar from an external tool. Additionally, they
can provide `progressBarString: SOME_STRING` to modify
the output format of the progress bar. This string must
meet the format specified in  http://npm.im/progress
@mcollina
Copy link
Owner

Thinking twice about this, I think we should just move all the output logic from the main autocannon.js to its own module, rather than instantiating it twice. That include also the table.

Something like:

const autocannon = require('autocannon') 
const instance = autocannon({ url: 'http://localhost:3000' }, done)
// customize your autocannon instance here
autocannon.track(instance, process.stdout)

Does it make sense? That do you think?

@GlenTiki
Copy link
Collaborator Author

That sounds okay, I will update my PR to reflect this :)

@mcollina mcollina self-assigned this Jun 23, 2016
* `progressBarString`: A `string` defining the format of the progress display output. Must be valid input for the [progress bar module](http://npm.im/progress).

**Returns** an instance/event emitter for tracking progress, etc.

Copy link
Owner

Choose a reason for hiding this comment

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

We should probably list the events of this instance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would like to merge both of my open PR's and then do docs on the events emitted by the instance, as the 'response' event needs to be explained, and the client object which it passes to the cb: https://github.com/mcollina/autocannon/pull/14/files#diff-de78b50723ff596d7bd35665f36a6cbfR60

@mcollina
Copy link
Owner

This one is good to go then :).

@mcollina mcollina merged commit 9593f21 into mcollina:master Jun 23, 2016
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.

2 participants