Skip to content

Commit

Permalink
Address CR comments by Matt K
Browse files Browse the repository at this point in the history
  • Loading branch information
mehta-ankit committed Dec 3, 2019
1 parent 7e7f3bc commit 84bb2d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def parse_options(args=None, default_config_files=['~/.locust.conf','locust.conf
'--csv-full-history',
action='store_true',
default=False,
dest='statshistory',
dest='stats_history_enabled',
help="Store each stats entry in CSV format to _stats_history.csv file",
)

Expand Down Expand Up @@ -504,7 +504,7 @@ def timelimit_stop():
stats_printer_greenlet = gevent.spawn(stats_printer)

if options.csvfilebase:
gevent.spawn(stats_writer, options.csvfilebase, options.statshistory)
gevent.spawn(stats_writer, options.csvfilebase, options.stats_history_enabled)


def shutdown(code=0):
Expand All @@ -522,7 +522,7 @@ def shutdown(code=0):
print_stats(runners.locust_runner.stats, current=False)
print_percentile_stats(runners.locust_runner.stats)
if options.csvfilebase:
write_stat_csvs(options.csvfilebase, options.statshistory)
write_stat_csvs(options.csvfilebase, options.stats_history_enabled)
print_error_report()
sys.exit(code)

Expand Down
6 changes: 3 additions & 3 deletions locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,11 @@ def stats_history_csv(stats_history_enabled=False):
1.0
]

include_stats_entries_per_iteration = []
stats_entries_per_iteration = []
if stats_history_enabled:
include_stats_entries_per_iteration = sort_stats(runners.locust_runner.request_stats)
stats_entries_per_iteration = sort_stats(runners.locust_runner.request_stats)

for s in chain(include_stats_entries_per_iteration, [runners.locust_runner.stats.total]):
for s in chain(stats_entries_per_iteration, [runners.locust_runner.stats.total]):
if s.num_requests:
percentile_str = ','.join([
str(int(s.get_response_time_percentile(x) or 0)) for x in PERCENTILES_TO_REPORT])
Expand Down

0 comments on commit 84bb2d3

Please sign in to comment.