boomer icon indicating copy to clipboard operation
boomer copied to clipboard

Report memory usage and correct CPU percentage in heartbeat messages

Open skruger opened this issue 1 year ago • 3 comments

I am picking up the work related to #165 an will be splitting it out into smaller more digestible PRs as requested.

The CPU percent change is to bring the stats in line with CPU utilization numbers as reported by tools like top. Usually CPU percentage isn't normalized by CPU count, but it is allowed to exceed 100% if it is loading across multiple cores.

skruger avatar May 02 '24 17:05 skruger

The CPU percentage is intentionally normalized by CPU count, to match the behavior of locust. Do you think we need to change this?

myzhan avatar May 07 '24 02:05 myzhan

I can switch it back. If locust normalizes it by default I think that is a mistake that can lead to confusion, but that confusion may be less than the confusion that comes from diverging from normal locust behavior.

In either case I didn't make any changes to the commits I cherry picked in from the previous PR so I'm not specifically attached to the design change as long as we get things reporting good enough numbers. I'll normalize the percentage by CPU count tomorrow when I get in to work.

skruger avatar May 07 '24 04:05 skruger

Because locust can't make use of multiple cores with gevent, so the CPU percentage collected by locust won't go beyond 100% most of the time.

myzhan avatar May 07 '24 06:05 myzhan

I have reverted the CPU usage change.

skruger avatar May 09 '24 16:05 skruger