Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More information in csv reports #1292

Closed
alien11689 opened this issue Mar 17, 2020 · 6 comments · Fixed by #1316
Closed

More information in csv reports #1292

alien11689 opened this issue Mar 17, 2020 · 6 comments · Fixed by #1316

Comments

@alien11689
Copy link

Problem

I am going to run tests with locust without web ui and it would be great to have much more detail information in locust csv report to create some charts on my own.

What I need

I would like to have in *_stats_history.csv file information about:

  • how many users are currently running (especially for step mode)
  • statistics grouped by type and name (currently they are always set to None,Aggregated)

Alternatives

As an alternative I have considered console output, but it is not very convienient for parsing.

@KenClemson
Copy link

Hi, I also would agree with alien11689's request.
It would certainly but great to have how many users running per time stamp or something like that so it can be shown on a graph.

@alien11689
Copy link
Author

I have run some tests on current master with option '--csv=result --csv-full-history' then I receive error StatsEntry.use_response_times_cache must be set to True if we should be able to calculate the _current_ response time percentile

When I change property from the error:

-    def __init__(self, stats, name, method, use_response_times_cache=False):
+    def __init__(self, stats, name, method, use_response_times_cache=True):

Specific entries for tasks are collected, but after a few seconds percentiles are set to 0:

"Type","Name","Timestamp","# requests","# failures","Requests/s","Requests Failed/s","Median response time","Average response time","Min response time","Max response time","Average Content Size","50%","66%","75%","80%","90%","95%","98%","99%","99.9%","99.99%","99.999","100%"
"None","Aggregated","1585134213",0,0,0.00,0.00,0,0,0,0.00,0.00,"N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A"
"GET cached client","Get 1","1585134215",776,0,0.00,0.00,20,28,11,144.00,3154.00,0,0,0,0,0,0,0,0,0,0,0,0
"GET new client","Get 1","1585134215",714,0,0.00,0.00,35,44,25,144.00,3154.00,0,0,0,0,0,0,0,0,0,0,0,0
"None","Aggregated","1585134215",1490,0,0.00,0.00,31,36,11,144.00,3154.00,31,36,41,48,66,75,130,130,140,140,140,140
"GET cached client","Get 1","1585134217",886,0,0.00,0.00,21,35,11,402.00,3154.00,21,33,41,47,69,130,140,150,400,400,400,400
"GET new client","Get 1","1585134217",814,0,0.00,0.00,37,51,25,402.00,3154.00,37,52,64,68,83,130,140,150,400,400,400,400
"None","Aggregated","1585134217",1700,0,0.00,0.00,33,42,11,402.00,3154.00,33,40,52,61,76,130,140,150,400,400,400,400
"GET cached client","Get 1","1585134219",3107,0,586.00,0.00,61,74,11,3546.00,3154.00,61,73,87,91,110,160,210,300,3500,3500,3500,3500
"GET new client","Get 1","1585134219",2978,0,563.33,0.00,110,120,25,3546.00,3154.00,110,130,160,170,200,210,230,480,3500,3500,3500,3500
"None","Aggregated","1585134219",6085,0,1149.33,0.00,70,96,11,3546.00,3154.00,70,97,130,130,180,200,220,380,3500,3500,3500,3500
"GET cached client","Get 1","1585134221",4930,0,632.20,0.00,90,99,11,3546.00,3154.00,90,110,110,120,150,200,360,440,3500,3500,3500,3500
"GET new client","Get 1","1585134221",4689,0,601.60,0.00,170,173,25,3546.00,3154.00,170,200,220,230,260,300,540,1200,1300,3500,3500,3500
"None","Aggregated","1585134221",9619,0,1233.80,0.00,110,135,11,3546.00,3154.00,110,140,180,200,230,270,410,600,1700,3500,3500,3500
"GET cached client","Get 1","1585134223",5338,0,654.83,0.00,95,108,11,3546.00,3154.00,95,110,120,130,160,260,410,510,3500,3500,3500,3500
"GET new client","Get 1","1585134223",5045,0,628.17,0.00,180,185,25,3546.00,3154.00,180,210,230,240,280,310,680,1200,1300,3500,3500,3500
"None","Aggregated","1585134223",10383,0,1283.00,0.00,110,146,11,3546.00,3154.00,110,150,190,210,250,300,500,750,1700,3500,3500,3500
"GET cached client","Get 1","1585134225",7505,0,682.11,0.00,120,144,11,3546.00,3154.00,120,150,150,150,250,440,590,790,1800,3500,3500,3500
"GET new client","Get 1","1585134225",7209,0,650.56,0.00,220,266,25,3546.00,3154.00,220,280,300,300,310,770,1300,1300,3300,3500,3500,3500
"None","Aggregated","1585134225",14714,0,1332.67,0.00,150,204,11,3546.00,3154.00,150,220,280,300,310,600,1300,1300,3300,3500,3500,3500
"GET cached client","Get 1","1585134227",9140,0,723.40,0.00,140,162,11,4007.00,3154.00,140,150,150,160,300,500,670,1000,3300,4000,4000,4000
"GET new client","Get 1","1585134227",8870,0,698.10,0.00,270,322,25,4149.00,3154.00,270,300,300,310,700,1300,1300,1800,3500,4100,4100,4100
"None","Aggregated","1585134227",18010,0,1421.50,0.00,150,241,11,4149.00,3154.00,220,300,300,310,540,830,1300,1800,3300,4000,4100,4100
"GET cached client","Get 1","1585134229",9631,0,722.40,0.00,140,168,11,4049.00,3154.00,140,150,150,160,300,510,750,1100,3300,4000,4000,4000
"GET new client","Get 1","1585134229",9381,0,700.30,0.00,280,334,25,4149.00,3154.00,280,300,310,310,760,1300,1300,1800,3500,4100,4100,4100
"None","Aggregated","1585134229",19012,0,1422.70,0.00,150,250,11,4149.00,3154.00,230,300,300,310,600,1200,1300,1800,3300,4000,4100,4100
"GET cached client","Get 1","1585134231",11765,0,724.50,0.00,150,180,11,7442.00,3154.00,150,150,160,160,310,520,770,1100,3500,6100,7400,7400
"GET new client","Get 1","1585134231",11564,0,714.90,0.00,300,394,25,7960.00,3154.00,300,300,310,310,790,1300,1800,3300,7400,7600,8000,8000
"None","Aggregated","1585134231",23329,0,1439.40,0.00,160,286,11,7960.00,3154.00,300,310,310,320,790,1300,1800,3300,7400,7600,8000,8000
"GET cached client","Get 1","1585134233",13370,0,710.80,0.00,150,186,11,8464.00,3154.00,0,0,0,0,0,0,0,0,0,0,0,0
"GET new client","Get 1","1585134233",13220,0,717.80,0.00,300,427,25,7960.00,3154.00,0,0,0,0,0,0,0,0,0,0,0,0
"None","Aggregated","1585134233",26590,0,1428.60,0.00,160,306,11,8464.00,3154.00,300,310,310,470,810,1300,2200,3300,7400,8000,8500,8500
"GET cached client","Get 1","1585134235",13883,0,709.60,0.00,150,187,11,8464.00,3154.00,0,0,0,0,0,0,0,0,0,0,0,0
"GET new client","Get 1","1585134235",13742,0,718.30,0.00,300,434,25,7960.00,3154.00,0,0,0,0,0,0,0,0,0,0,0,0
"None","Aggregated","1585134235",27625,0,1427.90,0.00,160,310,11,8464.00,3154.00,300,310,310,460,810,1300,2300,3300,7500,8000,8500,8500

@alien11689
Copy link
Author

I have found that the problem is with response_times_cache of class class StatsEntry. It keeps only one one entry instead of last N stats. I added prints in method get_current_response_time_percentile:

    if percent == 0.5:
            print("Acceptable timestamps %s" % (acceptable_timestamps))
            print("Response time cache %s" % (self.response_times_cache.keys()))

and in master logs I saw only at the beginning:

[2020-03-25 13:46:50,422] dpr-asus/INFO/stdout: Acceptable timestamps [1585140400, 1585140400, 1585140399, 1585140401, 1585140398, 1585140402, 1585140397, 1585140403, 1585140396, 1585140404, 1585140395, 1585140405, 1585140394, 1585140406, 1585140393, 1585140407, 1585140392, 1585140408]
[2020-03-25 13:46:50,423] dpr-asus/INFO/stdout: 
[2020-03-25 13:46:50,423] dpr-asus/INFO/stdout: Response time cache odict_keys([1585140407])

and at the end:

[2020-03-25 13:47:37,922] dpr-asus/INFO/stdout: Acceptable timestamps [1585140447, 1585140447, 1585140446, 1585140448, 1585140445, 1585140449, 1585140444, 1585140450, 1585140443, 1585140451, 1585140442, 1585140452, 1585140441, 1585140453, 1585140440, 1585140454, 1585140439, 1585140455]
[2020-03-25 13:47:37,922] dpr-asus/INFO/stdout: 
[2020-03-25 13:47:37,922] dpr-asus/INFO/stdout: Response time cache odict_keys([1585140407])

@alien11689
Copy link
Author

I have created PR: #1297

@alien11689
Copy link
Author

I added total_users count for detailed stats.

@heyman
Copy link
Member

heyman commented Apr 6, 2020

I would like to have in *_stats_history.csv file information about:

  • how many users are currently running (especially for step mode)

This feature makes sense.

I have run some tests on current master with option '--csv=result --csv-full-history' then I receive error StatsEntry.use_response_times_cache must be set to True if we should be able to calculate the current response time percentile

Ah, you've discovered a bug. I've opened up a new issue for this: #1315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants