locust-cloud 1.5.6__py3-none-any.whl → 1.5.8__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_cloud/__init__.py CHANGED
@@ -21,6 +21,7 @@ PG_PASSWORD = os.environ.get("PG_PASSWORD")
21
21
  PG_DATABASE = os.environ.get("PG_DATABASE")
22
22
  PG_PORT = os.environ.get("PG_PORT", 5432)
23
23
  GRAPH_VIEWER = os.environ.get("GRAPH_VIEWER")
24
+ MAX_USER_COUNT = os.environ.get("MAX_USER_COUNT")
24
25
  logger = logging.getLogger(__name__)
25
26
 
26
27
 
@@ -78,9 +79,6 @@ def on_locust_init(environment: locust.env.Environment, **_args):
78
79
  if not (PG_HOST and PG_USER and PG_PASSWORD and PG_DATABASE and PG_PORT):
79
80
  return
80
81
 
81
- if GRAPH_VIEWER:
82
- environment.web_ui.template_args["isGraphViewer"] = True
83
-
84
82
  try:
85
83
  pool = create_connection_pool(
86
84
  pg_user=PG_USER,
@@ -99,5 +97,10 @@ def on_locust_init(environment: locust.env.Environment, **_args):
99
97
  Exporter(environment, pool)
100
98
 
101
99
  if environment.web_ui:
100
+ environment.web_ui.template_args["maxUserCount"] = MAX_USER_COUNT
101
+
102
+ if GRAPH_VIEWER:
103
+ environment.web_ui.template_args["isGraphViewer"] = True
104
+
102
105
  register_auth(environment)
103
106
  register_query(environment, pool)
@@ -140,11 +140,11 @@ ORDER BY 1
140
140
  perc99_response_times = """
141
141
  SELECT time_bucket(%(resolution)s * interval '1 second', bucket) AS time,
142
142
  name,
143
- perc99
143
+ MAX(perc99) as perc99
144
144
  FROM requests_summary
145
145
  WHERE bucket BETWEEN %(start)s AND %(end)s
146
146
  AND run_id = %(testrun)s
147
- GROUP BY 1, name, perc99
147
+ GROUP BY 1, name
148
148
  ORDER BY 1
149
149
  """
150
150
 
@@ -152,11 +152,12 @@ ORDER BY 1
152
152
  response_length = """
153
153
  SELECT
154
154
  time_bucket(%(resolution)s * interval '1 second', bucket) as time,
155
- response_length as "responseLength",
155
+ AVG(response_length) as "responseLength",
156
156
  name
157
157
  FROM requests_summary
158
158
  WHERE bucket BETWEEN %(start)s AND %(end)s
159
159
  AND run_id = %(testrun)s
160
+ GROUP BY 1, name
160
161
  ORDER BY 1
161
162
  """
162
163