[tpcc-mysql] timing code appears to be incorrect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
percona-tools |
New
|
Undecided
|
Unassigned |
Bug Description
driver.c uses this code for measuring transaction time.
clk1 = clock_gettime(
// do transaction
clk2 = clock_gettime(
rt = (double)
This is calculating the CPU time used by the thread rather than the elapsed time of the transaction. It is also measuring the time in milliseconds rather than seconds and comparing it to these constants which are stated in seconds.
#define RTIME_NEWORD 5
#define RTIME_PAYMENT 5
#define RTIME_ORDSTAT 5
#define RTIME_DELIVERY 80
#define RTIME_SLEV 20
There are two errors here.
1. The time measured should be the response time i.e. the elapsed real-world time, not the CPU time
2. The thresholds should be implemented in seconds not milliseconds
Also, according to the TPC-C specification (http://
5.2.5.3 At least 90% of all transactions of each type must have a Transaction RT (see Clause 5.3.4) of less than
5 seconds each for New-Order, Payment, Order-Status, and Delivery, and 20 seconds for Stock-Level.