locust 2.26.1.dev72__py3-none-any.whl → 2.27.1.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.
Files changed (41) hide show
  1. locust/_version.py +2 -2
  2. locust/argument_parser.py +1 -1
  3. locust/env.py +0 -2
  4. locust/html.py +37 -83
  5. locust/main.py +10 -14
  6. locust/stats.py +3 -10
  7. locust/test/test_fasthttp.py +6 -4
  8. locust/test/test_main.py +6 -15
  9. locust/test/test_web.py +53 -199
  10. locust/web.py +18 -56
  11. {locust-2.26.1.dev72.dist-info → locust-2.27.1.dev7.dist-info}/METADATA +1 -1
  12. {locust-2.26.1.dev72.dist-info → locust-2.27.1.dev7.dist-info}/RECORD +16 -41
  13. locust/static/chart.js +0 -133
  14. locust/static/css/application.css +0 -491
  15. locust/static/css/application.css.map +0 -1
  16. locust/static/css/tables.css +0 -74
  17. locust/static/css/tables.css.map +0 -1
  18. locust/static/echarts.common.min.js +0 -22
  19. locust/static/img/favicon.ico +0 -0
  20. locust/static/img/logo.png +0 -0
  21. locust/static/img/ui-screenshot-charts.png +0 -0
  22. locust/static/img/ui-screenshot-start-test.png +0 -0
  23. locust/static/img/ui-screenshot-stats.png +0 -0
  24. locust/static/img/ui-screenshot-workers.png +0 -0
  25. locust/static/jquery-1.11.3.min.js +0 -5
  26. locust/static/jquery.jqote2.min.js +0 -14
  27. locust/static/jquery.tools.min.js +0 -17
  28. locust/static/locust.js +0 -324
  29. locust/static/sass/_base.sass +0 -27
  30. locust/static/sass/_mixins.sass +0 -3
  31. locust/static/sass/application.sass +0 -320
  32. locust/static/sass/tables.sass +0 -61
  33. locust/static/tasks.js +0 -48
  34. locust/static/vintage.js +0 -35
  35. locust/templates/index.html +0 -370
  36. locust/templates/report.html +0 -265
  37. locust/templates/stats_data.html +0 -10
  38. {locust-2.26.1.dev72.dist-info → locust-2.27.1.dev7.dist-info}/LICENSE +0 -0
  39. {locust-2.26.1.dev72.dist-info → locust-2.27.1.dev7.dist-info}/WHEEL +0 -0
  40. {locust-2.26.1.dev72.dist-info → locust-2.27.1.dev7.dist-info}/entry_points.txt +0 -0
  41. {locust-2.26.1.dev72.dist-info → locust-2.27.1.dev7.dist-info}/top_level.txt +0 -0
locust/static/locust.js DELETED
@@ -1,324 +0,0 @@
1
- var newTestLink = $("#new-test");
2
- var editTestLink = $("#edit-test");
3
-
4
- $(window).ready(function() {
5
- if($("#user_count").length > 0) {
6
- $("#user_count").focus().select();
7
- }
8
- });
9
-
10
- function appearStopped() {
11
- $(".box_stop").hide();
12
- newTestLink.show();
13
- editTestLink.hide();
14
- $(".user_count").hide();
15
- }
16
-
17
- $("#box_stop a.stop-button").click(function(event) {
18
- event.preventDefault();
19
- $.get($(this).attr("href")).done(() => {
20
- markerFlags.stop = true;
21
- });
22
- $("body").attr("class", "stopped");
23
- appearStopped();
24
- });
25
-
26
- $("#box_stop a.reset-button").click(function(event) {
27
- event.preventDefault();
28
- $.get($(this).attr("href"));
29
- });
30
-
31
- newTestLink.click(function(event) {
32
- event.preventDefault();
33
- $("#start").show();
34
- $("#user_count").focus().select();
35
- });
36
-
37
- editTestLink.click(function(event) {
38
- event.preventDefault();
39
- $("#edit").show();
40
- $("#new_user_count").focus().select();
41
- });
42
-
43
- $(".close_link").click(function(event) {
44
- event.preventDefault();
45
- $(this).parent().parent().hide();
46
- });
47
-
48
- function formatBytes(bytes, decimals = 2) {
49
- if (bytes === 0) return '0 Bytes';
50
- if (bytes === 0) return 'N/A';
51
-
52
- const k = 1024;
53
- const dm = decimals < 0 ? 0 : decimals;
54
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
55
-
56
- const i = Math.floor(Math.log(bytes) / Math.log(k));
57
-
58
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
59
- }
60
-
61
- $("ul.tabs").tabs("div.panes > div").on("onClick", function (event) {
62
- // trigger resizing of charts
63
- resizeCharts();
64
- });
65
-
66
- var charts = []
67
- function resizeCharts() {
68
- for (let index = 0; index < charts.length; index++) {
69
- const chart = charts[index];
70
- chart.resize();
71
- }
72
- }
73
-
74
- var stats_tpl = $('#stats-template');
75
- var errors_tpl = $('#errors-template');
76
- var exceptions_tpl = $('#exceptions-template');
77
- var workers_tpl = $('#worker-template');
78
-
79
- function setHostName(hostname) {
80
- hostname = hostname || "";
81
- $('#host_url_link').attr("href",hostname);
82
- document.getElementById("host_url_link").innerHTML = hostname;
83
- }
84
-
85
- $('#swarm_form').submit(function(event) {
86
- event.preventDefault();
87
- $("body").attr("class", "spawning");
88
- $("#start").hide();
89
- $("#main").show();
90
- $(".box_running").show();
91
- newTestLink.hide();
92
- editTestLink.show();
93
- $(".user_count").show();
94
- $.post($(this).attr("action"), $(this).serialize(),
95
- function(response) {
96
- if (response.success) {
97
- setHostName(response.host);
98
-
99
- // only mark run starts if at least 1 run has been reported
100
- if (stats_history["time"].length > 0) {
101
- markerFlags.start = true;
102
- }
103
- }
104
- }
105
- );
106
- });
107
-
108
- $('#edit_form').submit(function(event) {
109
- event.preventDefault();
110
- $.post($(this).attr("action"), $(this).serialize(),
111
- function(response) {
112
- if (response.success) {
113
- $("body").attr("class", "spawning");
114
- $("#edit").fadeOut();
115
- setHostName(response.host);
116
- }
117
- }
118
- );
119
- });
120
-
121
- var sortBy = function(field, reverse, primer){
122
- reverse = (reverse) ? -1 : 1;
123
- return function(a,b){
124
- a = a[field];
125
- b = b[field];
126
- if (typeof(primer) != 'undefined'){
127
- a = primer(a);
128
- b = primer(b);
129
- }
130
- if (a<b) return reverse * -1;
131
- if (a>b) return reverse * 1;
132
- return 0;
133
- }
134
- }
135
-
136
- // Sorting by column
137
- var alternate = false; //used by jqote2.min.js
138
- var sortAttribute = "name";
139
- var workerSortAttribute = "id";
140
- var desc = false;
141
- var workerDesc = false;
142
- var report;
143
- var failuresSortAttribute = "name";
144
- var failuresDesc = false;
145
-
146
- function renderTable(report) {
147
- var totalRow = report.stats.pop();
148
- totalRow.is_aggregated = true;
149
- var sortedStats = (report.stats).sort(sortBy(sortAttribute, desc));
150
- sortedStats.push(totalRow);
151
- $('#stats tbody').empty();
152
- $('#errors tbody').empty();
153
-
154
- window.alternate = false;
155
- $('#stats tbody').jqoteapp(stats_tpl, sortedStats);
156
-
157
- window.alternate = false;
158
- $('#errors tbody').jqoteapp(errors_tpl, (report.errors).sort(sortBy(failuresSortAttribute, failuresDesc)));
159
-
160
- $("#total_rps").html(Math.round(report.total_rps*100)/100);
161
- $("#fail_ratio").html(Math.round(report.fail_ratio*100));
162
- $("#status_text").html(report.state);
163
- $("#userCount").html(report.user_count);
164
- }
165
-
166
- function renderWorkerTable(report) {
167
- if (report.workers) {
168
- var workers = (report.workers).sort(sortBy(workerSortAttribute, workerDesc));
169
- $("#workers tbody").empty();
170
- window.alternate = false;
171
- $("#workers tbody").jqoteapp(workers_tpl, workers);
172
- $("#workerCount").html(workers.length);
173
- }
174
- }
175
-
176
-
177
- $("#stats .stats_label").click(function(event) {
178
- event.preventDefault();
179
- sortAttribute = $(this).attr("data-sortkey");
180
- desc = !desc;
181
- renderTable(window.report);
182
- });
183
-
184
- $("#errors .stats_label").click(function(event) {
185
- event.preventDefault();
186
- failuresSortAttribute = $(this).attr("data-sortkey");
187
- failuresDesc = !failuresDesc;
188
- renderTable(window.report);
189
- });
190
-
191
- $("#workers .stats_label").click(function(event) {
192
- event.preventDefault();
193
- workerSortAttribute = $(this).attr("data-sortkey");
194
- workerDesc = !workerDesc;
195
- renderWorkerTable(window.report);
196
- });
197
-
198
- function createMarkLine() {
199
- return {
200
- symbol: "none",
201
- label: {
202
- formatter: params => `Run #${params.dataIndex + 1}`
203
- },
204
- lineStyle: {color: "#5b6f66"},
205
- data: stats_history["markers"],
206
- }
207
- }
208
-
209
- function update_stats_charts(){
210
- if(stats_history["time"].length > 0){
211
- rpsChart.chart.setOption({
212
- xAxis: {data: stats_history["time"]},
213
- series: [
214
- {data: stats_history["current_rps"], markLine: createMarkLine()},
215
- {data: stats_history["current_fail_per_sec"]},
216
- ]
217
- });
218
-
219
- responseTimeChart.chart.setOption({
220
- xAxis: {data: stats_history["time"]},
221
- series: [
222
- {data: stats_history["response_time_percentile_1"], markLine: createMarkLine()},
223
- {data: stats_history["response_time_percentile_2"]},
224
- ]
225
- });
226
-
227
- usersChart.chart.setOption({
228
- xAxis: {data: stats_history["time"]},
229
- series: [
230
- {data: stats_history["user_count"], markLine: createMarkLine()},
231
- ]
232
- });
233
- }
234
- }
235
-
236
- // init charts
237
- var rpsChart = new LocustLineChart($(".charts-container"), "Total Requests per Second", ["RPS", "Failures/s"], "reqs/s", ['#00ca5a', '#ff6d6d']);
238
- var responseTimeChart = new LocustLineChart($(".charts-container"), "Response Times (ms)", [(percentile1 * 100).toString() + "th percentile" , (percentile2 * 100).toString() + "th percentile"], "ms");
239
- var usersChart = new LocustLineChart($(".charts-container"), "Number of Users", ["Users"], "users");
240
- charts.push(rpsChart, responseTimeChart, usersChart);
241
- echarts.connect([rpsChart.chart,responseTimeChart.chart,usersChart.chart])
242
- update_stats_charts()
243
-
244
- const markerFlags = {
245
- start: false,
246
- stop: false,
247
- }
248
-
249
- function updateStats() {
250
- $.get('./stats/requests', function (report) {
251
- window.report = report;
252
- try{
253
- renderTable(report);
254
- renderWorkerTable(report);
255
-
256
- const time = new Date().toLocaleTimeString();
257
-
258
- if (report.state === "stopped") {
259
- if (markerFlags.stop) {
260
- markerFlags.stop = false;
261
-
262
- // placeholders to show a skip in the lines between test runs
263
- stats_history["time"].push(time);
264
- stats_history["user_count"].push({"value": null});
265
- stats_history["current_rps"].push({"value": null});
266
- stats_history["current_fail_per_sec"].push({"value": null});
267
- stats_history["response_time_percentile_1"].push({"value": null});
268
- stats_history["response_time_percentile_2"].push({"value": null});
269
- }
270
-
271
- // update stats chart to ensure the stop spacing appears as part
272
- // of the update loop, otherwise we will "jump" 2 plots on the next run
273
- update_stats_charts();
274
-
275
- appearStopped();
276
- return;
277
- }
278
-
279
- // add markers between test runs, based on a new run being started
280
- if (stats_history["time"].length > 0 && markerFlags.start) {
281
- markerFlags.start = false;
282
-
283
- // mark the first run when we start the second run
284
- if (stats_history["markers"].length === 0) {
285
- stats_history["markers"].push({xAxis: stats_history["time"][0]});
286
- }
287
-
288
- stats_history["markers"].push({xAxis: time});
289
- }
290
-
291
- // get total stats row
292
- var total = report.stats[report.stats.length-1];
293
-
294
- // ignore stats without requests
295
- if (total.num_requests < 1) {
296
- return;
297
- }
298
-
299
- // update charts
300
- stats_history["time"].push(time);
301
- stats_history["user_count"].push({"value": report.user_count});
302
- stats_history["current_rps"].push({"value": total.current_rps, "users": report.user_count});
303
- stats_history["current_fail_per_sec"].push({"value": total.current_fail_per_sec, "users": report.user_count});
304
- stats_history["response_time_percentile_1"].push({"value": report.current_response_time_percentile_1, "users": report.user_count});
305
- stats_history["response_time_percentile_2"].push({"value": report.current_response_time_percentile_2, "users": report.user_count});
306
- update_stats_charts();
307
-
308
- } catch(i){
309
- console.debug(i);
310
- }
311
- }).always(function() {
312
- setTimeout(updateStats, 2000);
313
- });
314
- }
315
- updateStats();
316
-
317
- function updateExceptions() {
318
- $.get('./exceptions', function (data) {
319
- $('#exceptions tbody').empty();
320
- $('#exceptions tbody').jqoteapp(exceptions_tpl, data.exceptions);
321
- setTimeout(updateExceptions, 5000);
322
- });
323
- }
324
- updateExceptions();
@@ -1,27 +0,0 @@
1
- html
2
- height: 100%
3
-
4
- body
5
- background: #173529
6
- padding: 0
7
- margin: 0
8
- font-family: Arial, Helvetica, sans-serif
9
- font-size: 14px
10
- color: #fff
11
- padding-bottom: 40px
12
- padding-top: 93px
13
- position: relative
14
- box-sizing: border-box
15
- min-height: 100%
16
- -webkit-font-smoothing: antialiased
17
-
18
- ul
19
- margin: 0
20
- padding: 0
21
- list-style: none
22
-
23
- a
24
- color: #2be6a4
25
- text-decoration: none
26
- &:hover
27
- color: #4ff9bd
@@ -1,3 +0,0 @@
1
- =max-width($max-width)
2
- @media (max-width: $max-width)
3
- @content
@@ -1,320 +0,0 @@
1
- @import "mixins"
2
- @import "base"
3
- @import "tables"
4
-
5
- .top
6
- background: linear-gradient(to bottom, #ffffff 0%,#e7e7e7 100%)
7
- width: 100%
8
- height: 93px
9
- color: #000
10
- position: fixed
11
- top: 0px
12
- left: 0px
13
- z-index: 2
14
- a
15
- color: #308dbf
16
- .top-content
17
- padding-top: 20px
18
-
19
- .logo
20
- float: left
21
- width: 200px
22
- height: 48px
23
- margin-top: 2px
24
-
25
- .boxes
26
- float: right
27
- .box_running
28
- display: none
29
- body.spawning &, body.running &
30
- display: block
31
- body.stopped &, body.stopping &
32
- display: block
33
- .box_stop
34
- body.stopped &, body.stopping &
35
- display: none
36
- .top_box
37
- float: left
38
- border-left: 1px solid #d9d9d9
39
- padding-left: 20px
40
- padding-right: 20px
41
- height: 53px
42
- &:first-child
43
- border: none
44
- .label
45
- color: #7a7a7a
46
- font-size: 11px
47
- font-weight: bold
48
- .value
49
- color: #000
50
- font-size: 16px
51
- font-weight: bold
52
- max-width: 165px
53
- word-wrap: break-word
54
- &.box_url .value
55
- font-size: 14px
56
- font-weight: normal
57
- &.box_rps .value, &.box_workers .value
58
- font-size: 32px
59
- &.box_fail .value
60
- font-size: 22px
61
- &.box_status
62
- .value
63
- text-transform: uppercase
64
- .new-test
65
- display: none
66
- body.stopped &, body.stopping &
67
- display: block
68
- .edit-test
69
- display: none
70
- body.running &, body.spawning &
71
- display: inline
72
- .stop-button
73
- display: block
74
- float: left
75
- background: #d81212
76
- border-radius: 5px
77
- color: #fff
78
- padding: 9px 18px
79
- text-align: center
80
- font-size: 11px
81
- font-weight: bold
82
- margin-right: 12px
83
- &:hover
84
- background: #c80202
85
- i
86
- display: block
87
- background: #fff
88
- width: 17px
89
- height: 17px
90
- margin-left: auto
91
- margin-right: auto
92
- margin-bottom: 7px
93
- box-shadow: 0 0 20px rgba(255,255,255, 0.5)
94
- .reset-button
95
- display: block
96
- float: left
97
- background: #5a4b4b
98
- border-radius: 5px
99
- color: #fff
100
- padding: 11px 16px
101
- line-height: 1.5em
102
- text-align: center
103
- font-size: 11px
104
- font-weight: bold
105
- &:hover
106
- background: #4e4141
107
-
108
- .container
109
- max-width: 1800px
110
- min-width: 1000px
111
- margin-left: auto
112
- margin-right: auto
113
- box-sizing: border-box
114
- padding-left: 10px
115
- padding-right: 10px
116
-
117
- .dialogs
118
- position: relative
119
-
120
- .dialog
121
- width: 398px
122
- position: absolute
123
- left: 50%
124
- top: 60px
125
- margin-left: -169px
126
- z-index: 1
127
-
128
- .padder
129
- padding: 30px
130
- padding-top: 0px
131
-
132
- h2
133
- color: #addf82
134
- font-size: 26px
135
- font-weight: bold
136
-
137
- label
138
- display: block
139
- margin-bottom: 10px
140
- margin-top: 20px
141
- font-size: 16px
142
-
143
- input
144
- &.val
145
- border: none
146
- background: #fff
147
- height: 52px
148
- width: 328px
149
- font-size: 24px
150
- padding-left: 10px
151
- &.val_disabled
152
- border: none
153
- background: #cccccc
154
- height: 52px
155
- width: 328px
156
- font-size: 24px
157
- padding-left: 10px
158
-
159
- button
160
- margin-top: 20px
161
- float: right
162
- font-size: 16px
163
- font-weight: bold
164
- background: #8adaba
165
- padding: 14px 30px
166
- border-style: none
167
- border-radius: 5px
168
- cursor: pointer
169
- &:hover
170
- background: #74b99d
171
-
172
- .start
173
- body.ready &
174
- display: block
175
- .close_link
176
- display: none
177
- body.stopped &, body.stopping &
178
- display: none
179
- border-radius: 5px
180
- -moz-border-radius: 5px
181
- -webkit-border-radisu: 5px
182
- border: 3px solid #eee
183
- background: #132b21
184
- box-shadow: 0 0 60px rgba(0,0,0,0.3)
185
- body.running &, body.spawning &
186
- display: none
187
- .edit
188
- body.ready &
189
- display: none
190
- body.stopped &, body.stopping &
191
- display: none
192
- body.running &, body.spawning &
193
- display: none
194
- border-radius: 5px
195
- -moz-border-radius: 5px
196
- -webkit-border-radisu: 5px
197
- border: 3px solid #eee
198
- background: #132b21
199
- box-shadow: 0 0 60px rgba(0,0,0,0.3)
200
-
201
- .main
202
- position: relative
203
- display: block
204
- body.ready &
205
- display: none
206
- nav.menu
207
- background: #132b21
208
-
209
- ul.tabs
210
- overflow: hidden
211
-
212
- > li
213
- display: block
214
- float: left
215
- font-size: 16px
216
-
217
- a
218
- padding: 14px 10px
219
- display: inline-block
220
- color: #b3c3bc
221
- position: relative
222
- font-weight: 600
223
- font-size: 14px
224
- &:hover
225
- background: #10211a
226
- &.current
227
- color: #fff
228
- &:after
229
- content: ""
230
- display: block
231
- position: absolute
232
- left: 0
233
- bottom: 0
234
- right: 0
235
- height: 3px
236
- background: #fff
237
-
238
- .panes
239
- margin-top: 30px
240
- > div
241
- overflow: hidden
242
-
243
- #errors td, #errors th
244
- text-align: left
245
- th.error_count
246
- width: 70px
247
-
248
- #exceptions
249
- th.exception_occurrences
250
- width: 110px
251
- text-align: center
252
- th.exception_traceback
253
- text-align: left
254
- td.occurrences
255
- text-align: center
256
- td.traceback
257
- font-size: 12px
258
- line-height: 18px
259
- font-family: monospace
260
- white-space: pre
261
-
262
- #charts
263
- width: 100%
264
- .chart
265
- height: 350px
266
- margin-bottom: 30px
267
- box-sizing: border-box
268
- border: 1px solid #11271e
269
- border-radius: 3px
270
-
271
- .note
272
- color: #b3c3bc
273
- margin-bottom: 30px
274
- border-radius: 3px
275
- background: #132b21
276
- padding: 10px
277
- display: inline-block
278
-
279
- .about
280
- width: 398px
281
- position: absolute
282
- left: 50%
283
- top: 5px
284
- margin-left: -169px
285
- border-radius: 5px
286
- -moz-border-radius: 5px
287
- -webkit-border-radius: 5px
288
- border: 3px solid #eee
289
- background: #132b21
290
- box-shadow: 0 0 60px rgba(0,0,0,0.3)
291
- z-index: 4
292
-
293
- a.close_link
294
- position: absolute
295
- right: 10px
296
- top: 10px
297
- .padder
298
- padding: 30px
299
- padding-top: 0px
300
-
301
- .tasks
302
- ul
303
- padding-left: 10px
304
-
305
- .footer
306
- position: fixed
307
- left: 0
308
- bottom: 0
309
- padding: 12px 0
310
- background: #132b21
311
- width: 100%
312
- text-align: right
313
- box-sizing: border-box
314
- height: 40px
315
- z-index: 3
316
-
317
- a
318
- margin-right: 10px
319
- color: #48a584
320
-