Skip to content

Commit

Permalink
Merge pull request #195 from FliesLikeABrick/feature/reduce-ssh-bandw…
Browse files Browse the repository at this point in the history
…idth-issue-194

Reduce BWMG Instance SSH data
  • Loading branch information
cosmin committed Nov 16, 2017
2 parents b59de1b + 584e51c commit 798ed6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion beeswithmachineguns/bees.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,12 @@ def _attack(params):
options += ' -A %s' % params['basic_auth']

params['options'] = options
benchmark_command = 'ab -v 3 -r -n %(num_requests)s -c %(concurrent_requests)s %(options)s "%(url)s"' % params
# substrings to use for fgrep to perform remote output filtering
# resolves issue #194, too much data sent over SSH control channel to BWMG
# any future statistics parsing that requires more output from ab
# may need this line altered to include other patterns
params['output_filter_patterns'] = '\n'.join(['Time per request:', 'Requests per second: ', 'Failed requests: ', 'Connect: ', 'Receive: ', 'Length: ', 'Exceptions: ', 'Complete requests: ', 'HTTP/1.1'])
benchmark_command = 'ab -v 3 -r -n %(num_requests)s -c %(concurrent_requests)s %(options)s "%(url)s" 2>/dev/null | fgrep -F "%(output_filter_patterns)s"' % params
print(benchmark_command)
stdin, stdout, stderr = client.exec_command(benchmark_command)

Expand Down

0 comments on commit 798ed6a

Please sign in to comment.