Skip to content

Commit 3187345

Browse files
author
root
committed
show max response time
1 parent 48ebdb0 commit 3187345

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/main.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ int main( int argc, char *argv[] )
452452
free(thd_arg);
453453

454454
//hist_report();
455-
fclose(freport_file);
455+
if (freport_file != NULL)
456+
fclose(freport_file);
456457

457458
printf("\n<Raw Results>\n");
458459
for ( i=0; i<5; i++ ){
@@ -575,29 +576,30 @@ void alarm_handler(int signum)
575576
}
576577

577578
time_count += PRINT_INTERVAL;
578-
printf("%4d, %d(%d):%.3f|%3.f, %d(%d):%.3f|%3.f, %d(%d):%.3f, %d(%d):%.3f, %d(%d):%.3f\n",
579+
printf("%4d, %d(%d):%.3f|%.3f, %d(%d):%.3f|%.3f, %d(%d):%.3f|%.3f, %d(%d):%.3f|%.3f, %d(%d):%.3f|%.3f\n",
579580
time_count,
580581
( s[0] + l[0] - prev_s[0] - prev_l[0] ),
581582
( l[0] - prev_l[0] ),
582-
rt90[0],(double)(cur_max_rt[0])/(double)(1000.0),
583+
rt90[0],(double)cur_max_rt[0],
583584
( s[1] + l[1] - prev_s[1] - prev_l[1] ),
584585
( l[1] - prev_l[1] ),
585-
rt90[1],(double)cur_max_rt[1]/1000.0,
586+
rt90[1],(double)cur_max_rt[1],
586587
( s[2] + l[2] - prev_s[2] - prev_l[2] ),
587588
( l[2] - prev_l[2] ),
588-
rt90[2],
589+
rt90[2],(double)cur_max_rt[2],
589590
( s[3] + l[3] - prev_s[3] - prev_l[3] ),
590591
( l[3] - prev_l[3] ),
591-
rt90[3],
592+
rt90[3],(double)cur_max_rt[3],
592593
( s[4] + l[4] - prev_s[4] - prev_l[4] ),
593594
( l[4] - prev_l[4] ),
594-
rt90[4]
595+
rt90[4],(double)cur_max_rt[4]
595596
);
596597
fflush(stdout);
597598

598599
for( i=0; i<5; i++ ){
599600
prev_s[i] = s[i];
600601
prev_l[i] = l[i];
602+
cur_max_rt[i]=0.0;
601603
}
602604
}
603605

src/rthist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void hist_inc( int transaction, double rtclk )
3636
if(i >= (MAXREC * REC_PER_SEC)){
3737
i = (MAXREC * REC_PER_SEC) - 1;
3838
}
39+
if (rtclk > cur_max_rt[transaction]) cur_max_rt[transaction] = rtclk;
3940
++cur_hist[transaction][i];
4041
//printf("In: %.3f, trx: %d, Added %d\n", rtclk, transaction, i);
4142
}
@@ -51,7 +52,6 @@ double hist_ckp( int transaction )
5152
for( i=0; i<(MAXREC * REC_PER_SEC); i++){
5253
total += cur_hist[transaction][i]*i;
5354
if (cur_hist[transaction][i] > 0) {
54-
cur_max_rt[transaction]= i;
5555
}
5656
}
5757
for( i=0; i<(MAXREC * REC_PER_SEC); i++){

0 commit comments

Comments
 (0)