void memory_print_stats(void) { double total_time; total_time = NS2SEC(sb_timer_value(&sb_globals.exec_timer)); log_text(LOG_NOTICE, "Operations performed: %d (%8.2f ops/sec)\n", total_ops, total_ops / total_time); if (memory_oper != SB_MEM_OP_NONE) log_text(LOG_NOTICE, "%4.2f MB transferred (%4.2f MB/sec)\n", (double)total_bytes / (1024 * 1024), (double)total_bytes / (1024 * 1024) / total_time); }
void memory_print_stats(sb_stat_t type) { double seconds; const double megabyte = 1024.0 * 1024.0; switch (type) { case SB_STAT_INTERMEDIATE: SB_THREAD_MUTEX_LOCK(); seconds = NS2SEC(sb_timer_split(&sb_globals.exec_timer)); log_timestamp(LOG_NOTICE, &sb_globals.exec_timer, "%4.2f MB/sec,", (double)(total_bytes - last_bytes) / megabyte / seconds); last_bytes = total_bytes; SB_THREAD_MUTEX_UNLOCK(); break; case SB_STAT_CUMULATIVE: seconds = NS2SEC(sb_timer_split(&sb_globals.cumulative_timer1)); log_text(LOG_NOTICE, "Operations performed: %d (%8.2f ops/sec)\n", total_ops, total_ops / seconds); if (memory_oper != SB_MEM_OP_NONE) log_text(LOG_NOTICE, "%4.2f MB transferred (%4.2f MB/sec)\n", total_bytes / megabyte, total_bytes / megabyte / seconds); total_ops = 0; total_bytes = 0; /* So that intermediate stats are calculated from the current moment rather than from the previous intermediate report */ if (sb_timer_initialized(&sb_globals.exec_timer)) sb_timer_split(&sb_globals.exec_timer); break; } }
void file_print_stats(void) { double total_time; char s1[16], s2[16], s3[16], s4[16]; total_time = NS2SEC(sb_timer_value(&sb_globals.exec_timer)); log_text(LOG_NOTICE, "Operations performed: %d Read, %d Write, %d Other = %d Total", read_ops, write_ops, other_ops, read_ops + write_ops + other_ops); log_text(LOG_NOTICE, "Read %sb Written %sb Total transferred %sb " "(%sb/sec)", sb_print_value_size(s1, sizeof(s1), bytes_read), sb_print_value_size(s2, sizeof(s2), bytes_written), sb_print_value_size(s3, sizeof(s3), bytes_read + bytes_written), sb_print_value_size(s4, sizeof(s4), (bytes_read + bytes_written) / total_time)); log_text(LOG_NOTICE, "%8.2f Requests/sec executed", (read_ops + write_ops) / total_time); }