guoyu07 / aspersa

Automatically exported from code.google.com/p/aspersa
0 stars 0 forks source link

BUG Concurrecy not calculated correctly #157

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. download small_status from attachment
2. download aspersa from attachment (extracted AWK script from the original USL 
script)
3. $ awk -f aspersa small_status

What is the expected output? What do you see instead?

Expected:
2.000000 1272.300000

Actual:
1.333333 1272.300000

What version of the product are you using? On what operating system?

I use the HEAD version obtained from: 
http://aspersa.googlecode.com/svn/trunk/usl

$ cat /etc/*-release
CentOS release 6.3 (Final)

Please provide any additional information below.

The throughput (qps) seems to be correctly calculated. However, the concurrency 
seems to be false. Let's see what's in the small_status file:

...
Threads_running 2
...
Threads_running 4
...

We substract the thread that executes SHOW GLOBAL STATUS from each value, this 
gives us 2-1=1 and 4-1=3 respectively. Their average is (1+3)/2=2 and not 1.3333

I set THEADS_MAX, NUM_SLAVES and INTERVAL to 0.

I think the problem is with this line:
concurrency = threads_sum / (samples - skipped + 1);

To get the correct resutls, it should be:
concurrency = threads_sum / (samples - skipped);

It can be reproduced with bigger status file and using the full UCL script (not 
only the AWK part).

Can you please verify this? Thank you!

Original issue reported on code.google.com by tczol...@gmail.com on 4 Mar 2013 at 6:15

Attachments: