'Locust - get stats in python

How does one get the Locust stats inside python? I'm trying to get the current value of req/s but locust.env.Environment.stats is an empty object, and locust.stats.print_stats() needs a callable object, and I don't know what to pass to it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source