How to use test_request_stats_full_history_csv method in locust

Best Python code snippet using locust

test_web.py

Source:test_web.py Github

copy

Full Screen

...379 def remove_files_if_exists(self):380 self.remove_file_if_exists(self.STATS_FILENAME)381 self.remove_file_if_exists(self.STATS_HISTORY_FILENAME)382 self.remove_file_if_exists(self.STATS_FAILURES_FILENAME)383 def test_request_stats_full_history_csv(self):384 self.stats.log_request("GET", "/test", 1.39764125, 2)385 self.stats.log_request("GET", "/test", 999.9764125, 1000)386 self.stats.log_request("GET", "/test2", 120, 5612)387 greenlet = gevent.spawn(self.stats_csv_writer.stats_writer)388 gevent.sleep(0.01)389 self.stats_csv_writer.stats_history_flush()390 gevent.kill(greenlet)391 response = requests.get("http://127.0.0.1:%i/stats/requests_full_history/csv" % self.web_port)392 self.assertEqual(200, response.status_code)393 self._check_csv_headers(response.headers, "requests_full_history")394 self.assertIn("Content-Length", response.headers)395 reader = csv.reader(StringIO(response.text))396 rows = [r for r in reader]397 self.assertEqual(4, len(rows))...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run locust automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful