Skip to content

Commit

Permalink
Reduce CSV_STATS_FLUSH_INTERVAL_SEC to 5 seconds by default (more rea…
Browse files Browse the repository at this point in the history
…sonable in the time of SSD:s :) and remove it from the docs (because it will only rarely need to be adjusted, and increasing it is a very unusual need)
  • Loading branch information
cyberw committed May 27, 2024
1 parent 50cab7e commit 098238b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/retrieving-stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ By default only the Aggregate row is appended regularly to the history stats, bu
the ``--csv-full-history`` flag, a row for each stats entry (and the Aggregate) is appended every time
the stats are written (once every 2 seconds by default).

You can also customize how frequently this is written if you desire faster (or slower) writing:
You can also customize how frequently this is written:

.. code-block:: python
import locust.stats
locust.stats.CSV_STATS_INTERVAL_SEC = 5 # default is 1 second
locust.stats.CSV_STATS_FLUSH_INTERVAL_SEC = 60 # Determines how often the data is flushed to disk, default is 10 seconds
2 changes: 1 addition & 1 deletion locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def resize_handler(signum: int, frame: FrameType | None):

"""Default interval for how frequently CSV files are written if this option is configured."""
CSV_STATS_INTERVAL_SEC = 1
CSV_STATS_FLUSH_INTERVAL_SEC = 10
CSV_STATS_FLUSH_INTERVAL_SEC = 5

"""
Default window size/resolution - in seconds - when calculating the current
Expand Down

0 comments on commit 098238b

Please sign in to comment.