blockbench icon indicating copy to clipboard operation
blockbench copied to clipboard

How to calculate the final throughput latency

Open llvke opened this issue 6 years ago • 3 comments

I use ethereum benchmark and kvstore for experiments and get the result(. run-bench.sh 2 10 2 10).How to calculate the final throughput latency by using the result.

llvke avatar May 21 '19 03:05 llvke

  • for throughput, you must add up the txs in all polled block lines, then divided by 2*(number of lines starting with "In the last 2s")
  • for latency, simply look for the lines where tx count = X latency = Y and compute Y/X when X !=0

By the way , you can read more issues because your question may be asked by others before , including open and closed .

TravisBacon avatar May 21 '19 08:05 TravisBacon

  • for throughput, you must add up the txs in all polled block lines, then divided by 2*(number of lines starting with "In the last 2s")
  • for latency, simply look for the lines where tx count = X latency = Y and compute Y/X when X !=0

By the way , you can read more issues because your question may be asked by others before , including open and closed .

Thank you very much for your help。Can we communicate via email?This is my email [email protected]

llvke avatar May 21 '19 08:05 llvke

Hi @llvke , @TravisBacon ,

Our research group took at their codebase, and around this line, https://github.com/ooibc88/blockbench/blob/master/src/macro/kvstore/ycsbc.cc#L95, they do latency calculation in the monitor thread and print out in the log file.

For Hyperledger, here is the case, I am not sure whether the following applies to other Blockchain backends:

For every TX a client inserts (using YCSB-C framework). the client logs the current time after sending a json rpc request and getting a reply, see here https://github.com/ooibc88/blockbench/blob/master/src/macro/kvstore/db/hyperledger_db.cc#L38.

The monitor thread (StatusThread ) polls a block (send an rpc request & parse Txs from json to array) once every 2 seconds by default. The thread then logs the current time as the end time for calculating the latency.

Each Tx’s latency = the difference between the aforementioned two logged times. Finally, Blockbench reports the sum of latencies of all Tx’s in that block.

Best wishes, Roger.

haochenpan avatar Jun 03 '19 13:06 haochenpan