[tpcc-mysql] timing code appears to be incorrect

Bug #1075388 reported by Andy Grove
6
This bug affects 1 person
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(CLOCK_THREAD_CPUTIME_ID, &tbuf1 );

// do transaction

clk2 = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tbuf2 );

rt = (double)(tbuf2.tv_sec * 1000.0 + tbuf2.tv_nsec/1000000.0-tbuf1.tv_sec * 1000.0 - tbuf1.tv_nsec/1000000.0);

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://www.tpc.org/tpcc/spec/TPC-C_v5-10-1.pdf), the response time for delivery should be 5 seconds, not 80 seconds:

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.