@@ -406,6 +406,15 @@ void run_stats::save_csv_one_sec(FILE *f,
406406 fprintf (f, " ,WAIT p%.1f Latency" , quantile);
407407 }
408408
409+ // Add TOTAL columns (matching JSON structure)
410+ fprintf (f, " ,TOTAL Requests,TOTAL Average Latency,TOTAL Total Bytes,TOTAL Total Bytes TX,TOTAL Total Bytes RX" );
411+
412+ // Add TOTAL percentile columns
413+ for (std::size_t i = 0 ; i < m_config->print_percentiles .quantile_list .size (); i++) {
414+ float quantile = m_config->print_percentiles .quantile_list [i];
415+ fprintf (f, " ,TOTAL p%.1f Latency" , quantile);
416+ }
417+
409418 fprintf (f, " ,Active Connections,Connection Errors\n " );
410419
411420 total_get_ops = 0 ;
@@ -453,6 +462,19 @@ void run_stats::save_csv_one_sec(FILE *f,
453462 fprintf (f, " ,%.3f" , i->m_wait_cmd .summarized_quantile_values [p]);
454463 }
455464
465+ // Write TOTAL data (SET + GET combined)
466+ fprintf (f, " ,%lu,%u.%06u,%lu,%lu,%lu" ,
467+ i->m_total_cmd .m_ops ,
468+ USEC_FORMAT (AVERAGE (i->m_total_cmd .m_total_latency , i->m_total_cmd .m_ops )),
469+ i->m_total_cmd .m_bytes_rx + i->m_total_cmd .m_bytes_tx ,
470+ i->m_total_cmd .m_bytes_tx ,
471+ i->m_total_cmd .m_bytes_rx );
472+
473+ // Write TOTAL percentiles
474+ for (std::size_t p = 0 ; p < i->m_total_cmd .summarized_quantile_values .size (); p++) {
475+ fprintf (f, " ,%.3f" , i->m_total_cmd .summarized_quantile_values [p]);
476+ }
477+
456478 // Write connection data
457479 fprintf (f, " ,%u,%u\n " , i->m_active_connections , i->m_connection_errors );
458480
@@ -838,14 +860,24 @@ bool run_stats::write_csv_header(FILE *f, benchmark_config *config)
838860 fprintf (f, " ,WAIT p%.1f Latency" , quantile);
839861 }
840862
863+ // Add TOTAL columns (matching JSON structure)
864+ fprintf (f, " ,TOTAL Requests,TOTAL Average Latency,TOTAL Total Bytes,TOTAL Total Bytes TX,TOTAL Total Bytes RX" );
865+
866+ // Add TOTAL percentile columns
867+ for (std::size_t i = 0 ; i < config->print_percentiles .quantile_list .size (); i++) {
868+ float quantile = config->print_percentiles .quantile_list [i];
869+ fprintf (f, " ,TOTAL p%.1f Latency" , quantile);
870+ }
871+
841872 fprintf (f, " ,Active Connections,Connection Errors\n " );
842873 fflush (f);
843874 return true ;
844875}
845876
846877bool run_stats::write_csv_realtime_data (FILE *f, unsigned int second, unsigned int active_connections, unsigned int connection_errors,
847878 unsigned long int cur_ops, unsigned long int cur_bytes, double cur_latency, benchmark_config *config,
848- const std::vector<double >* set_percentiles, const std::vector<double >* get_percentiles)
879+ const std::vector<double >* set_percentiles, const std::vector<double >* get_percentiles,
880+ const std::vector<double >* total_percentiles)
849881{
850882 if (!f) return false ;
851883
@@ -908,6 +940,20 @@ bool run_stats::write_csv_realtime_data(FILE *f, unsigned int second, unsigned i
908940 fprintf (f, " ,0.000" );
909941 }
910942
943+ // Write TOTAL data (SET + GET combined)
944+ unsigned long int total_ops = cur_ops;
945+ unsigned long int total_bytes = cur_bytes;
946+ fprintf (f, " ,%lu,%.6f,%lu,%lu,0" , total_ops, cur_latency, total_bytes, total_bytes);
947+
948+ // Write TOTAL percentiles (use actual TOTAL percentiles if available)
949+ for (std::size_t i = 0 ; i < config->print_percentiles .quantile_list .size (); i++) {
950+ if (total_percentiles && i < total_percentiles->size ()) {
951+ fprintf (f, " ,%.3f" , (*total_percentiles)[i]);
952+ } else {
953+ fprintf (f, " ,%.3f" , cur_latency);
954+ }
955+ }
956+
911957 // Write connection data
912958 fprintf (f, " ,%u,%u\n " , active_connections, connection_errors);
913959
0 commit comments