@@ -79,6 +79,20 @@ double cur_max_rt[5];
79
79
80
80
double prev_total_rt [5 ];
81
81
82
+ #define RTIME_NEWORD 5
83
+ #define RTIME_PAYMENT 5
84
+ #define RTIME_ORDSTAT 5
85
+ #define RTIME_DELIVERY 80
86
+ #define RTIME_SLEV 20
87
+
88
+ int rt_limit [5 ] = {
89
+ RTIME_NEWORD ,
90
+ RTIME_PAYMENT ,
91
+ RTIME_ORDSTAT ,
92
+ RTIME_DELIVERY ,
93
+ RTIME_SLEV
94
+ };
95
+
82
96
sb_percentile_t local_percentile ;
83
97
84
98
int activate_transaction ;
@@ -153,7 +167,7 @@ int main( int argc, char *argv[] )
153
167
154
168
/* Parse args */
155
169
156
- while ( (c = getopt (argc , argv , "h:P:d:u:p:w:c:r:l:i:f:t:m:o:S:" )) != -1 ) {
170
+ while ( (c = getopt (argc , argv , "h:P:d:u:p:w:c:r:l:i:f:t:m:o:S:0:1:2:3:4: " )) != -1 ) {
157
171
switch (c ) {
158
172
case 'h' :
159
173
printf ("option h with value '%s'\n" , optarg );
@@ -215,6 +229,26 @@ int main( int argc, char *argv[] )
215
229
printf ("option S (socket) with value '%s'\n" , optarg );
216
230
strncpy (db_socket , optarg , DB_STRING_MAX );
217
231
break ;
232
+ case '0' :
233
+ printf ("option 0 (response time limit for transaction 0) '%s'\n" , optarg );
234
+ rt_limit [0 ] = atoi (optarg );
235
+ break ;
236
+ case '1' :
237
+ printf ("option 1 (response time limit for transaction 1) '%s'\n" , optarg );
238
+ rt_limit [1 ] = atoi (optarg );
239
+ break ;
240
+ case '2' :
241
+ printf ("option 2 (response time limit for transaction 2) '%s'\n" , optarg );
242
+ rt_limit [2 ] = atoi (optarg );
243
+ break ;
244
+ case '3' :
245
+ printf ("option 3 (response time limit for transaction 3) '%s'\n" , optarg );
246
+ rt_limit [3 ] = atoi (optarg );
247
+ break ;
248
+ case '4' :
249
+ printf ("option 4 (response time limit for transaction 4) '%s'\n" , optarg );
250
+ rt_limit [4 ] = atoi (optarg );
251
+ break ;
218
252
case '?' :
219
253
printf ("Usage: tpcc_start -h server_host -P port -d database_name -u mysql_user -p mysql_password -w warehouses -c connections -r warmup_time -l running_time -i report_interval -f report_file -t trx_file\n" );
220
254
exit (0 );
@@ -497,7 +531,9 @@ int main( int argc, char *argv[] )
497
531
498
532
printf ("\n<Raw Results>\n" );
499
533
for ( i = 0 ; i < 5 ; i ++ ){
500
- printf (" [%d] sc:%d lt:%d rt:%d fl:%d \n" , i , success [i ], late [i ], retry [i ], failure [i ]);
534
+ printf (" [%d] sc:%d lt:%d rt:%d fl:%d avg_rt: %.1f (%d)\n" ,
535
+ i , success [i ], late [i ], retry [i ], failure [i ],
536
+ total_rt [i ] / (success [i ] + late [i ]), rt_limit [i ]);
501
537
}
502
538
printf (" in %d sec.\n" , (measure_time / PRINT_INTERVAL ) * PRINT_INTERVAL );
503
539
0 commit comments