Skip to content

Commit

Permalink
CLI handle timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
delano committed Jul 7, 2011
1 parent c6ae508 commit 90464f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/stella
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Stella::CLI::Definition
option :c, :concurrency, Integer, "Maximum number of virtual clients"
#option :a, :arrival, Float, "Arrival rate (new clients per second)"
option :r, :repetitions, Integer, "Number of times to repeat the testplan (per vclient)"
option :timeout, Integer, "Timeout requests after the given number of seconds"
option :W, :nowait, "Ignore wait times"
option :w, :wait, Float, "Wait time (in seconds) between requests"
command :checkup => Stella::CLI
Expand Down
16 changes: 10 additions & 6 deletions lib/stella/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def checkup
run_opts = {
:repetitions => @option.repetitions || 1,
:concurrency => @option.concurrency || 1,
:timeout => @option.timeout || 30,
:wait => @option.wait || 1
}
# NOTE ABOUT CLI OUTPUT:
Expand Down Expand Up @@ -89,14 +90,17 @@ def checkup
if @global.verbose > 0 || @report.errors?
test_uri = @report.log.first ? @report.log.first.uri : '[unknown]'
Stella.li 'Checkup for %s' % [test_uri]
Stella.li
Stella.li ' %s' % [@report.headers.request_headers.split(/\n/).join("\n ")]
Stella.li
Stella.li ' %s' % [@report.headers.response_headers.split(/\n/).join("\n ")]
Stella.li ''
if !@report.timeouts?
Stella.li
Stella.li ' %s' % [@report.headers.request_headers.split(/\n/).join("\n ")]
Stella.li
Stella.li ' %s' % [@report.headers.response_headers.split(/\n/).join("\n ")]
Stella.li ''
end
end
metrics = @report.metrics
args = [@report.statuses.values.first,
args = [
@report.timeouts? ? 'timeout' : @report.statuses.values.first,
metrics.response_time.mean*1000,
metrics.socket_connect.mean*1000,
metrics.first_byte.mean*1000,
Expand Down

0 comments on commit 90464f4

Please sign in to comment.