168
168
static int write_ops;
169
169
static int real_write_ops;
170
170
static int other_ops;
171
static int last_other_ops;
171
172
static unsigned int req_performed; /* number of requests done */
172
173
static unsigned long long bytes_read;
173
static unsigned long long bytes_written;
174
static unsigned long long last_bytes_read;
175
static unsigned long long bytes_written;
176
static unsigned long long last_bytes_written;
176
179
/* Array of file mappings */
787
790
/* Print test statistics */
790
void file_print_stats(void)
793
void file_print_stats(sb_stat_t type)
793
796
char s1[16], s2[16], s3[16], s4[16];
795
total_time = NS2SEC(sb_timer_value(&sb_globals.exec_timer));
798
"Operations performed: %d Read, %d Write, %d Other = %d Total",
799
read_ops, write_ops, other_ops, read_ops + write_ops + other_ops);
800
log_text(LOG_NOTICE, "Read %sb Written %sb Total transferred %sb "
802
sb_print_value_size(s1, sizeof(s1), bytes_read),
803
sb_print_value_size(s2, sizeof(s2), bytes_written),
804
sb_print_value_size(s3, sizeof(s3), bytes_read + bytes_written),
805
sb_print_value_size(s4, sizeof(s4),
806
(bytes_read + bytes_written) / total_time));
807
log_text(LOG_NOTICE, "%8.2f Requests/sec executed",
808
(read_ops + write_ops) / total_time);
799
case SB_STAT_INTERMEDIATE:
801
const double megabyte = 1024.0 * 1024.0;
803
SB_THREAD_MUTEX_LOCK();
805
seconds = NS2SEC(sb_timer_split(&sb_globals.exec_timer));
806
log_timestamp(LOG_NOTICE, &sb_globals.exec_timer,
807
"reads: %4.2f MB/s writes: %4.2f MB/s fsyncs: %4.2f/s",
808
(bytes_read - last_bytes_read) / megabyte / seconds,
809
(bytes_written - last_bytes_written) / megabyte / seconds,
810
(other_ops - last_other_ops) / seconds);
811
last_bytes_read = bytes_read;
812
last_bytes_written = bytes_written;
813
last_other_ops = other_ops;
815
SB_THREAD_MUTEX_UNLOCK();
820
case SB_STAT_CUMULATIVE:
821
seconds = NS2SEC(sb_timer_value(&sb_globals.exec_timer));
824
"Operations performed: %d reads, %d writes, %d Other = %d Total",
825
read_ops, write_ops, other_ops, read_ops + write_ops + other_ops);
826
log_text(LOG_NOTICE, "Read %sb Written %sb Total transferred %sb "
828
sb_print_value_size(s1, sizeof(s1), bytes_read),
829
sb_print_value_size(s2, sizeof(s2), bytes_written),
830
sb_print_value_size(s3, sizeof(s3), bytes_read + bytes_written),
831
sb_print_value_size(s4, sizeof(s4),
832
(bytes_read + bytes_written) / seconds));
833
log_text(LOG_NOTICE, "%8.2f Requests/sec executed",
834
(read_ops + write_ops) / seconds);