@@ -117,21 +117,6 @@ run_stats::run_stats(benchmark_config *config) :
117117{
118118 memset (&m_start_time, 0 , sizeof (m_start_time));
119119 memset (&m_end_time, 0 , sizeof (m_end_time));
120- hdr_init (
121- LATENCY_HDR_MIN_VALUE, // Minimum value
122- LATENCY_HDR_MAX_VALUE, // Maximum value
123- LATENCY_HDR_SIGDIGTS, // Number of significant figures
124- &m_get_latency_histogram); // Pointer to initialise
125- hdr_init (
126- LATENCY_HDR_MIN_VALUE, // Minimum value
127- LATENCY_HDR_MAX_VALUE, // Maximum value
128- LATENCY_HDR_SIGDIGTS, // Number of significant figures
129- &m_set_latency_histogram); // Pointer to initialise
130- hdr_init (
131- LATENCY_HDR_MIN_VALUE, // Minimum value
132- LATENCY_HDR_MAX_VALUE, // Maximum value
133- LATENCY_HDR_SIGDIGTS, // Number of significant figures
134- &m_wait_latency_histogram); // Pointer to initialise
135120
136121 if (config->arbitrary_commands ->is_defined ()) {
137122 setup_arbitrary_commands (config->arbitrary_commands ->size ());
@@ -142,13 +127,6 @@ void run_stats::setup_arbitrary_commands(size_t n_arbitrary_commands) {
142127 m_totals.setup_arbitrary_commands (n_arbitrary_commands);
143128 m_cur_stats.setup_arbitrary_commands (n_arbitrary_commands);
144129 m_ar_commands_latency_histograms.resize (n_arbitrary_commands);
145- for (unsigned int i=0 ; i<n_arbitrary_commands; i++) {
146- hdr_init (
147- LATENCY_HDR_MIN_VALUE, // Minimum value
148- LATENCY_HDR_MAX_VALUE, // Maximum value
149- LATENCY_HDR_SIGDIGTS, // Number of significant figures
150- &m_ar_commands_latency_histograms[i]); // Pointer to initialise
151- }
152130}
153131
154132void run_stats::set_start_time (struct timeval * start_time)
@@ -1023,15 +1001,10 @@ void run_stats::print_avg_latency_column(output_table &table) {
10231001 table_el el;
10241002 table_column column (15 );
10251003
1026- struct hdr_histogram * m_totals_latency_histogram;
1027- hdr_init (
1028- LATENCY_HDR_MIN_VALUE, // Minimum value
1029- LATENCY_HDR_MAX_VALUE, // Maximum value
1030- LATENCY_HDR_SIGDIGTS, // Number of significant figures
1031- &m_totals_latency_histogram); // Pointer to initialise
1032- hdr_add (m_totals_latency_histogram,m_set_latency_histogram);
1033- hdr_add (m_totals_latency_histogram,m_get_latency_histogram);
1034- hdr_add (m_totals_latency_histogram,m_wait_latency_histogram);
1004+ safe_hdr_histogram m_totals_latency_histogram;
1005+ hdr_add (m_totals_latency_histogram,m_set_latency_histogram);
1006+ hdr_add (m_totals_latency_histogram,m_get_latency_histogram);
1007+ hdr_add (m_totals_latency_histogram,m_wait_latency_histogram);
10351008
10361009 column.elements .push_back (*el.init_str (" %15s " , " Avg. Latency" ));
10371010 column.elements .push_back (*el.init_str (" %s" , " ----------------" ));
@@ -1070,12 +1043,7 @@ void run_stats::print_quantile_latency_column(output_table &table, double quanti
10701043 table_el el;
10711044 table_column column (15 );
10721045
1073- struct hdr_histogram * m_totals_latency_histogram;
1074- hdr_init (
1075- LATENCY_HDR_MIN_VALUE, // Minimum value
1076- LATENCY_HDR_MAX_VALUE, // Maximum value
1077- LATENCY_HDR_SIGDIGTS, // Number of significant figures
1078- &m_totals_latency_histogram); // Pointer to initialise
1046+ safe_hdr_histogram m_totals_latency_histogram;
10791047 hdr_add (m_totals_latency_histogram,m_set_latency_histogram);
10801048 hdr_add (m_totals_latency_histogram,m_get_latency_histogram);
10811049 hdr_add (m_totals_latency_histogram,m_wait_latency_histogram);
0 commit comments