question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: StatsEntry.use_response_times_cache must be set to True

See original GitHub issue

I see this on every locust worker running 1.2:

$ locust --worker --locustfile=main.py
[2020-08-20 11:02:50,637] C02TD0F6GTDX/INFO/locust.main: Starting Locust 1.2
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
  File "/usr/local/lib/python3.8/site-packages/locust/stats.py", line 766, in stats_history
    'response_time_percentile_95': stats.total.get_current_response_time_percentile(0.95) or 0,
  File "/usr/local/lib/python3.8/site-packages/locust/stats.py", line 553, in get_current_response_time_percentile
    raise ValueError("StatsEntry.use_response_times_cache must be set to True if we should be able to calculate the _current_ response time percentile")
ValueError: StatsEntry.use_response_times_cache must be set to True if we should be able to calculate the _current_ response time percentile
2020-08-20T09:02:50Z <Greenlet at 0x10803f6a0: stats_history(<locust.runners.WorkerRunner object at 0x10806da60)> failed with ValueError

Tried with very basic locust file, same issue:

from locust import HttpUser, TaskSet, task, between

class LoadTestTask(TaskSet):
    def on_start(self):
        pass

    @task(3)
    def get_token(self):
        pass

class LoadTest(HttpUser):
    tasks = [LoadTestTask]
    wait_time = between(0.1, 1)

Any idea @cyberw or @vstepanov-lohika-tix?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
taojy123commented, Aug 21, 2020
1reaction
max-rocket-internetcommented, Aug 20, 2020

Should I make a new PR?

Yes 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found