We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to save the test results to a file, but the result is saved with empty values, am I doing something wrong? I am using the following event:
def on_quitting(): requests_result = RequestStats().aggregated_stats() with open('load_tests.json', 'w') as f: f.write(str(requests_result.serialize())) events.quitting += on_quitting
And I'm execultando the locust as follows:
locust -f locust_script.py --no-web -c 10 -r 5 -n 50 -H http://localhost:5000 --only-summary
The console is being presented the following result:
Name # reqs # fails Avg Min Max | Median req/s -------------------------------------------------------------------------------------------------------------------------------------------- GET /dh/[int] 23 0(0.00%) 7 6 10 | 8 2.38 GET /dm/[int] 27 0(0.00%) 7 4 9 | 8 2.38 -------------------------------------------------------------------------------------------------------------------------------------------- Total 50 0(0.00%) 4.75 Percentage of the requests completed within given times Name # reqs 50% 66% 75% 80% 90% 95% 98% 99% 100% -------------------------------------------------------------------------------------------------------------------------------------------- GET /dh/[int] 23 8 8 8 8 8 9 10 10 10 GET /dm/[int] 27 8 8 8 8 8 8 9 9 9 --------------------------------------------------------------------------------------------------------------------------------------------
but in the file:
{'num_reqs_per_sec': {}, 'response_times': {}, 'start_time': 1421713788.737998, 'min_response_time': None, 'num_failures': 0, 'num_requests': 0, 'name': 'Total', 'total_response_time': 0, 'max_response_time': 0, 'total_content_length': 0, 'last_request_timestamp': 1421713788, 'method': None}
The text was updated successfully, but these errors were encountered:
Solution:
from locust.stats import global_stats def on_quitting(): requests_result = global_stats.aggregated_stats() with open('load_tests.json', 'w') as f: f.write(str(requests_result.serialize()))
Sorry, something went wrong.
I have this same issue now, but I think my issue is to do with the way I'm quitting my Locusts.
How did you quit the Locust that you ran from the console?
No branches or pull requests
I'm trying to save the test results to a file, but the result is saved with empty values, am I doing something wrong? I am using the following event:
And I'm execultando the locust as follows:
The console is being presented the following result:
but in the file:
The text was updated successfully, but these errors were encountered: