@@ -35,6 +35,8 @@ char db_user[DB_STRING_MAX];
35
35
char db_password [DB_STRING_MAX ];
36
36
char report_file [DB_STRING_MAX ]= "" ;
37
37
FILE * freport_file = NULL ;
38
+ char trx_file [DB_STRING_MAX ]= "" ;
39
+ FILE * ftrx_file = NULL ;
38
40
39
41
int num_ware ;
40
42
int num_conn ;
@@ -139,7 +141,7 @@ int main( int argc, char *argv[] )
139
141
140
142
/* Parse args */
141
143
142
- while ( (c = getopt (argc , argv , "h:P:d:u:p:w:c:r:l:i:f:" )) != -1 ) {
144
+ while ( (c = getopt (argc , argv , "h:P:d:u:p:w:c:r:l:i:f:t: " )) != -1 ) {
143
145
switch (c ) {
144
146
case 'h' :
145
147
printf ("option h with value '%s'\n" , optarg );
@@ -161,6 +163,10 @@ int main( int argc, char *argv[] )
161
163
printf ("option f with value '%s'\n" , optarg );
162
164
strncpy (report_file , optarg , DB_STRING_MAX );
163
165
break ;
166
+ case 't' :
167
+ printf ("option t with value '%s'\n" , optarg );
168
+ strncpy (trx_file , optarg , DB_STRING_MAX );
169
+ break ;
164
170
case 'w' :
165
171
printf ("option w with value '%s'\n" , optarg );
166
172
num_ware = atoi (optarg );
@@ -186,7 +192,7 @@ int main( int argc, char *argv[] )
186
192
port = atoi (optarg );
187
193
break ;
188
194
case '?' :
189
- 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\n" );
195
+ 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" );
190
196
exit (0 );
191
197
default :
192
198
printf ("?? getopt returned character code 0%o ??\n" , c );
@@ -280,6 +286,10 @@ int main( int argc, char *argv[] )
280
286
freport_file = fopen (report_file ,"w+" );
281
287
}
282
288
289
+ if ( strlen (trx_file ) > 0 ) {
290
+ ftrx_file = fopen (trx_file ,"w+" );
291
+ }
292
+
283
293
284
294
printf ("<Parameters>\n" );
285
295
if (is_local == 0 ) {
@@ -455,6 +465,9 @@ int main( int argc, char *argv[] )
455
465
if (freport_file != NULL )
456
466
fclose (freport_file );
457
467
468
+ if (ftrx_file != NULL )
469
+ fclose (ftrx_file );
470
+
458
471
printf ("\n<Raw Results>\n" );
459
472
for ( i = 0 ; i < 5 ; i ++ ){
460
473
printf (" [%d] sc:%d lt:%d rt:%d fl:%d \n" , i , success [i ], late [i ], retry [i ], failure [i ]);
0 commit comments