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.

Wrong statistic of total request count

See original GitHub issue

Description of issue / feature request

Locust told me 249 requests had been made, but I got 327 records from service access log.

Expected behavior

I think locust should report that the completed requests is 327, but not 249.

Environment settings (for bug reports)

  • OS: Ubuntu 14.04.5 LTS
  • Python version: Python 2.7.6
  • Locust version: 0.8.1

Steps to reproduce (for bug reports)

Just run the following command in shell:

locust -H http://10.44.147.237:8024 -f locustfile.py --no-web -c 50 -r 10 -n 200

lucustfile.py

# -*- coding: utf-8 -*-

from __future__ import absolute_import

import locust


class PerformanceTaskSet(locust.TaskSet):

    @locust.task(weight=1)
    def apply_resources(self):
        self.client.put(
            '/accounts/xxxx/projects/integration-test/resource_apply/',
            json={'cpu': 8, 'memory': 16}
        )


class PerformanceLocust(locust.HttpLocust):

    task_set = PerformanceTaskSet

    min_wait = 100
    max_wait = 1000

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
gwshawshcommented, Sep 27, 2018

THE LOGS

[root@tobacco-sit opt]# locust -f ./sale_test.py --no-web  -c 800 -r 100 -t 30s
[2018-09-27 10:32:19,727] tobacco-sit/INFO/locust.main: Run time limit set to 30 seconds
[2018-09-27 10:32:19,727] tobacco-sit/INFO/locust.main: Starting Locust 0.9.0
[2018-09-27 10:32:19,728] tobacco-sit/INFO/locust.runners: Hatching and swarming 800 clients at the rate 100 clients/s...
 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                              0     0(0.00%)                                       0.00

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                            181     0(0.00%)      50      34      97  |      45    0.00
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                            181     0(0.00%)                                       0.00

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                            366     0(0.00%)      51      34     108  |      46   55.50
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                            366     0(0.00%)                                      55.50

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                            562     0(0.00%)      59      34     199  |      50   74.50
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                            562     0(0.00%)                                      74.50

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                            741     0(0.00%)     126      34     865  |      58   80.67
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                            741     0(0.00%)                                      80.67

[2018-09-27 10:32:28,441] tobacco-sit/INFO/locust.runners: All locusts hatched: WebsiteUser: 800
 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                            963     0(0.00%)     331      34    1258  |      76   84.75
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                            963     0(0.00%)                                      84.75

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           1220     0(0.00%)     443      34    1258  |     150   88.10
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           1220     0(0.00%)                                      88.10

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           1446     0(0.00%)     396      33    1258  |     130  101.10
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           1446     0(0.00%)                                     101.10

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           1648     0(0.00%)     362      33    1258  |     120  106.10
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           1648     0(0.00%)                                     106.10

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           1880     0(0.00%)     335      33    1258  |     130  108.90
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           1880     0(0.00%)                                     108.90

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           2092     0(0.00%)     318      33    1258  |     140  111.70
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           2092     0(0.00%)                                     111.70

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           2320     0(0.00%)     303      33    1258  |     140  112.70
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           2320     0(0.00%)                                     112.70

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           2541     0(0.00%)     300      33    1258  |     150  111.30
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           2541     0(0.00%)                                     111.30

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           2770     0(0.00%)     295      33    1258  |     170  109.90
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           2770     0(0.00%)                                     109.90

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           2851     0(0.00%)     300      33    1258  |     170  110.60
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           2851     0(0.00%)                                     110.60

[2018-09-27 10:32:49,619] tobacco-sit/INFO/locust.main: Time limit reached. Stopping Locust.
[2018-09-27 10:32:49,625] tobacco-sit/INFO/locust.main: Shutting down (exit code 0), bye.
[2018-09-27 10:32:49,625] tobacco-sit/INFO/locust.main: Cleaning up runner...
[2018-09-27 10:32:49,743] tobacco-sit/INFO/locust.main: Running teardowns...
 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                           2875     0(0.00%)     316      33    2950  |     170  103.50
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                           2875     0(0.00%)                                     103.50

Percentage of the requests completed within given times
 Name                                                           # reqs    50%    66%    75%    80%    90%    95%    98%    99%   100%
--------------------------------------------------------------------------------------------------------------------------------------------
 POST commitsalorder-1                                            2875    170    250    330    460    980   1100   1200   1200   3000
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                                            2875    170    250    330    460    980   1100   1200   1200   3000

Locust showed 2875 , but I got 3229 actually.

2reactions
aldenpeterson-wfcommented, Jul 18, 2018

Without setting not to reset stats, Locust will make requests while scaling up the users and then reset stats.

In 0.8.1 that is --no-reset-stats but will change in 0.9.0 https://github.com/locustio/locust/pull/674

Read more comments on GitHub >

github_iconTop Results From Across the Web

CloudWatch metrics for your Application Load Balancer
CloudWatch enables you to retrieve statistics about those data points as an ordered set of time-series data, known as metrics.
Read more >
What does 'Total Requests' in Server statistics actually show?
I try to make some summary statistics on services usage. ... ArcGIS Server Statistics as 'Total Requests' (or 'RequestCount' in admin API).
Read more >
How to Monitor NGINX | Datadog
Total is a cumulative count of client requests. Note that a single client connection can involve multiple requests, so this number may be ......
Read more >
2020 Census Undercounts in Six States, Overcounts in Eight
If an estimated net coverage error is negative, it means the census counts may have been too low and the census missed some...
Read more >
Crawl Stats report - Search Console Help
All URLs shown and counted are the actual URLs requested by Google; data is not assigned to canonical URLs as is done in...
Read more >

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