Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Print the number of failed requests

  • Loading branch information...
commit 8880c0623ec6c4bcf4a7b68eb9ea81c07058ae75 1 parent 9af7cb4
@avargas avargas authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 beeswithmachineguns/bees.py
View
6 beeswithmachineguns/bees.py
@@ -208,12 +208,14 @@ def _attack(params):
return None
requests_per_second_search = re.search('Requests\ per\ second:\s+([0-9.]+)\ \[#\/sec\]\ \(mean\)', ab_results)
+ failed_requests = re.search('Failed\ requests:\s+([0-9.]+)', ab_results)
fifty_percent_search = re.search('\s+50\%\s+([0-9]+)', ab_results)
ninety_percent_search = re.search('\s+90\%\s+([0-9]+)', ab_results)
complete_requests_search = re.search('Complete\ requests:\s+([0-9]+)', ab_results)
response['ms_per_request'] = float(ms_per_request_search.group(1))
response['requests_per_second'] = float(requests_per_second_search.group(1))
+ response['failed_requests'] = float(failed_requests.group(1))
response['fifty_percent'] = float(fifty_percent_search.group(1))
response['ninety_percent'] = float(ninety_percent_search.group(1))
response['complete_requests'] = float(complete_requests_search.group(1))
@@ -253,6 +255,10 @@ def _print_results(results):
total_complete_requests = sum(complete_results)
print ' Complete requests:\t\t%i' % total_complete_requests
+ complete_results = [r['failed_requests'] for r in complete_bees]
+ total_failed_requests = sum(complete_results)
+ print ' Failed requests:\t\t%i' % total_failed_requests
+
complete_results = [r['requests_per_second'] for r in complete_bees]
mean_requests = sum(complete_results)
print ' Requests per second:\t%f [#/sec] (mean)' % mean_requests
Please sign in to comment.
Something went wrong with that request. Please try again.