diff --git a/locust/static/style.css b/locust/static/style.css index e6d92fddc9..9667991d9f 100644 --- a/locust/static/style.css +++ b/locust/static/style.css @@ -234,7 +234,7 @@ a:hover { .running .start, .hatching .start {display: none;} .ready .edit {display: none;} -.ready .start {display: block;} +.ready .start {display: inline;} .running .status, .hatching .status {display: block;} .stopped .status {display: block;} diff --git a/locust/templates/index.html b/locust/templates/index.html index 2fe4211dbf..5a34312db7 100644 --- a/locust/templates/index.html +++ b/locust/templates/index.html @@ -45,9 +45,13 @@
%
- STOP + STOP Reset
Stats
+
+
TIMER
+
:
+
@@ -59,8 +63,7 @@

Start new Locust swarm

-
- +

@@ -83,7 +86,7 @@

Start new Locust swarm

Change the locust count

- +
@@ -101,7 +104,7 @@

Change the locust count

Ramping

- +

@@ -287,5 +290,40 @@

Version

+ diff --git a/locust/web.py b/locust/web.py index 1ba8d1a77a..9ad99c3371 100644 --- a/locust/web.py +++ b/locust/web.py @@ -43,7 +43,7 @@ def index(): host = runners.locust_runner.locust_classes[0].host else: host = None - + return render_template("index.html", state=runners.locust_runner.state, is_distributed=is_distributed, @@ -76,7 +76,7 @@ def stop(): def reset_stats(): runners.locust_runner.stats.reset_all() return "ok" - + @app.route("/stats/requests/csv") def request_stats_csv(): rows = [ @@ -87,13 +87,13 @@ def request_stats_csv(): '"# failures"', '"Median response time"', '"Average response time"', - '"Min response time"', + '"Min response time"', '"Max response time"', '"Average Content Size"', '"Requests/s"', ]) ] - + for s in chain(_sort_stats(runners.locust_runner.request_stats), [runners.locust_runner.stats.aggregated_stats("Total", full_request_history=True)]): rows.append('"%s","%s",%i,%i,%i,%i,%i,%i,%i,%.2f' % ( s.method, @@ -170,7 +170,7 @@ def request_stats(): if stats: report["total_rps"] = stats[len(stats)-1]["current_rps"] report["fail_ratio"] = runners.locust_runner.stats.aggregated_stats("Total").fail_ratio - + # since generating a total response times dict with all response times from all # urls is slow, we make a new total response time dict which will consist of one # entry per url with the median response time as key and the number of requests as @@ -178,14 +178,14 @@ def request_stats(): response_times = defaultdict(int) # used for calculating total median for i in xrange(len(stats)-1): response_times[stats[i]["median_response_time"]] += stats[i]["num_requests"] - + # calculate total median stats[len(stats)-1]["median_response_time"] = median_from_dict(stats[len(stats)-1]["num_requests"], response_times) - + is_distributed = isinstance(runners.locust_runner, MasterLocustRunner) if is_distributed: report["slave_count"] = runners.locust_runner.slave_count - + report["state"] = runners.locust_runner.state report["user_count"] = runners.locust_runner.user_count return json.dumps(report) @@ -195,9 +195,9 @@ def exceptions(): response = make_response(json.dumps({ 'exceptions': [ { - "count": row["count"], - "msg": row["msg"], - "traceback": row["traceback"], + "count": row["count"], + "msg": row["msg"], + "traceback": row["traceback"], "nodes" : ", ".join(row["nodes"]) } for row in six.itervalues(runners.locust_runner.exceptions) ] @@ -213,7 +213,7 @@ def exceptions_csv(): for exc in six.itervalues(runners.locust_runner.exceptions): nodes = ", ".join(exc["nodes"]) writer.writerow([exc["count"], exc["msg"], exc["traceback"], nodes]) - + data.seek(0) response = make_response(data.read()) file_name = "exceptions_{0}.csv".format(time())