locust 2.37.2.dev3__py3-none-any.whl → 2.37.2.dev7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- locust/_version.py +2 -2
- locust/web.py +20 -10
- locust/webui/dist/assets/{index-OsbNSvrF.js → index-D2b9JQ_o.js} +62 -62
- locust/webui/dist/auth.html +1 -1
- locust/webui/dist/index.html +1 -1
- {locust-2.37.2.dev3.dist-info → locust-2.37.2.dev7.dist-info}/METADATA +1 -1
- {locust-2.37.2.dev3.dist-info → locust-2.37.2.dev7.dist-info}/RECORD +10 -10
- {locust-2.37.2.dev3.dist-info → locust-2.37.2.dev7.dist-info}/WHEEL +0 -0
- {locust-2.37.2.dev3.dist-info → locust-2.37.2.dev7.dist-info}/entry_points.txt +0 -0
- {locust-2.37.2.dev3.dist-info → locust-2.37.2.dev7.dist-info}/licenses/LICENSE +0 -0
locust/_version.py
CHANGED
@@ -17,5 +17,5 @@ __version__: str
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
18
18
|
version_tuple: VERSION_TUPLE
|
19
19
|
|
20
|
-
__version__ = version = '2.37.2.
|
21
|
-
__version_tuple__ = version_tuple = (2, 37, 2, '
|
20
|
+
__version__ = version = '2.37.2.dev7'
|
21
|
+
__version_tuple__ = version_tuple = (2, 37, 2, 'dev7')
|
locust/web.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import csv
|
4
|
+
import itertools
|
4
5
|
import json
|
5
6
|
import logging
|
6
7
|
import mimetypes
|
@@ -8,7 +9,6 @@ import os.path
|
|
8
9
|
from functools import wraps
|
9
10
|
from html import escape
|
10
11
|
from io import StringIO
|
11
|
-
from itertools import chain
|
12
12
|
from json import dumps
|
13
13
|
from typing import TYPE_CHECKING, Any, TypedDict
|
14
14
|
|
@@ -456,18 +456,17 @@ class WebUI:
|
|
456
456
|
|
457
457
|
return jsonify(report)
|
458
458
|
|
459
|
-
for s in chain(stats.sort_stats(environment.runner.stats.entries), [environment.runner.stats.total]):
|
460
|
-
_stats.append(s.to_dict())
|
461
|
-
|
462
|
-
errors = [e.serialize() for e in environment.runner.errors.values()]
|
463
|
-
|
464
459
|
# Truncate the total number of stats and errors displayed since a large number of rows will cause the app
|
465
460
|
# to render extremely slowly. Aggregate stats should be preserved.
|
466
|
-
|
467
|
-
|
468
|
-
|
461
|
+
_stats.extend(
|
462
|
+
stat.to_dict() for stat in itertools.islice(stats.sort_stats(environment.runner.stats.entries), 500)
|
463
|
+
)
|
464
|
+
_stats.append(environment.runner.stats.total.to_dict())
|
465
|
+
|
466
|
+
errors = [e.serialize() for e in itertools.islice(environment.runner.errors.values(), 500)]
|
467
|
+
|
468
|
+
report = {"stats": _stats, "errors": errors}
|
469
469
|
|
470
|
-
report = {"stats": truncated_stats, "errors": errors[:500]}
|
471
470
|
total_stats = _stats[-1]
|
472
471
|
|
473
472
|
if _stats:
|
@@ -495,6 +494,7 @@ class WebUI:
|
|
495
494
|
)
|
496
495
|
|
497
496
|
report["workers"] = workers
|
497
|
+
report["worker_count"] = environment.runner.worker_count
|
498
498
|
|
499
499
|
report["state"] = environment.runner.state
|
500
500
|
report["user_count"] = environment.runner.user_count
|
@@ -564,6 +564,7 @@ class WebUI:
|
|
564
564
|
)
|
565
565
|
|
566
566
|
@app_blueprint.route("/user", methods=["POST"])
|
567
|
+
@self.auth_required_if_enabled
|
567
568
|
def update_user():
|
568
569
|
assert request.method == "POST"
|
569
570
|
|
@@ -572,6 +573,15 @@ class WebUI:
|
|
572
573
|
|
573
574
|
return {}, 201
|
574
575
|
|
576
|
+
@app_blueprint.route("/worker-count")
|
577
|
+
@self.auth_required_if_enabled
|
578
|
+
def get_worker_count():
|
579
|
+
return {
|
580
|
+
"worker_count": self.environment.runner.worker_count
|
581
|
+
if isinstance(self.environment.runner, MasterRunner)
|
582
|
+
else 0
|
583
|
+
}
|
584
|
+
|
575
585
|
app.register_blueprint(app_blueprint)
|
576
586
|
|
577
587
|
@property
|