Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
review comments: default time period for 30s, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanniLi committed Oct 19, 2015
1 parent 06959b5 commit 611b862
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ function Benchmark(options) {
self.cmdOptions = options.cmdOptions;
self.requests = options.cmdOptions.requests || 0;
self.requestsLimit = self.requests !== 0;
self.time = options.cmdOptions.time || 0;
self.time = options.cmdOptions.time;
if (self.requests === 0 && self.time === undefined) {
self.time = 30 * 1000;
} else {
self.time = 0;
}

self.timeLimit = self.time !== 0;
self.delay = options.cmdOptions.delay || 100;
self.rate = options.cmdOptions.rate;
Expand Down
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ function parseArgs(argv) {
}

function TCurl(opts) {
if (!(this instanceof TCurl)) {
return new TCurl(opts);
}

var self = this;
self.subChannel = null;
self.client = null;
}

TCurl.prototype.parseJsonArgs = function parseJsonArgs(opts, delegate) {
Expand Down
3 changes: 2 additions & 1 deletion man/tcurl.1
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ tcurl \-p localhost:8080 serviceName \-\-health \-\-rate 1000 \-\-delay 100
.P
\fB\-\-time value\fP
Specify the time in milliseconds how long the benchmark should run\.
By default, there is no limit on the time length\.
When no request limit is set, the default value is 30 seconds\. Otherwise,
the default is unlimited\.
.SH EXIT CODES
.RS 0
.IP \(bu 2
Expand Down
3 changes: 2 additions & 1 deletion usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ a tchannel service. It supports thrift, JSON, and raw request format.

`--time value`
Specify the time in milliseconds how long the benchmark should run.
By default, there is no limit on the time length.
When no request limit is set, the default value is 30 seconds. Otherwise,
the default is unlimited.


## EXIT CODES
Expand Down

0 comments on commit 611b862

Please sign in to comment.