Skip to content

Commit

Permalink
Locust cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Aug 2, 2024
1 parent d5765cd commit 729b1be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@
from .util.load_locustfile import load_locustfile
from .util.timespan import parse_timespan

# import external plugins if installed to allow for registering custom arguments etc
try:
# import locust_plugins if it is installed, to allow it to register custom arguments etc
import locust_plugins # pyright: ignore[reportMissingImports]
except ModuleNotFoundError:
pass
try:
import locust_cloud # pyright: ignore[reportMissingImports]
except ModuleNotFoundError:
pass

version = locust.__version__

Expand Down
4 changes: 4 additions & 0 deletions locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from .stats import StatsCSV, StatsCSVFileWriter, StatsErrorDict, sort_stats
from .user.inspectuser import get_ratio
from .util.cache import memoize
from .util.date import format_utc_timestamp
from .util.timespan import parse_timespan

if TYPE_CHECKING:
Expand Down Expand Up @@ -613,6 +614,8 @@ def update_template_args(self):
else None
)

start_time = format_utc_timestamp(stats.start_time)

self.template_args = {
"locustfile": self.environment.locustfile,
"state": self.environment.runner.state,
Expand All @@ -630,6 +633,7 @@ def update_template_args(self):
and not (self.userclass_picker_is_active or self.environment.shape_class.use_common_options)
),
"stats_history_enabled": options and options.stats_history_enabled,
"start_time": start_time,
"tasks": dumps({}),
"extra_options": extra_options,
"run_time": options and options.run_time,
Expand Down
1 change: 1 addition & 0 deletions locust/webui/src/redux/slice/swarm.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface ISwarmState {
runTime?: string | number;
showUserclassPicker: boolean;
spawnRate: number | null;
startTime: string;
state: string;
statsHistoryEnabled: boolean;
tasks: string;
Expand Down

0 comments on commit 729b1be

Please sign in to comment.