@@ -117,21 +117,6 @@ run_stats::run_stats(benchmark_config *config) :
117
117
{
118
118
memset (&m_start_time, 0 , sizeof (m_start_time));
119
119
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
135
120
136
121
if (config->arbitrary_commands ->is_defined ()) {
137
122
setup_arbitrary_commands (config->arbitrary_commands ->size ());
@@ -142,13 +127,6 @@ void run_stats::setup_arbitrary_commands(size_t n_arbitrary_commands) {
142
127
m_totals.setup_arbitrary_commands (n_arbitrary_commands);
143
128
m_cur_stats.setup_arbitrary_commands (n_arbitrary_commands);
144
129
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
- }
152
130
}
153
131
154
132
void run_stats::set_start_time (struct timeval * start_time)
@@ -1023,15 +1001,10 @@ void run_stats::print_avg_latency_column(output_table &table) {
1023
1001
table_el el;
1024
1002
table_column column (15 );
1025
1003
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);
1035
1008
1036
1009
column.elements .push_back (*el.init_str (" %15s " , " Avg. Latency" ));
1037
1010
column.elements .push_back (*el.init_str (" %s" , " ----------------" ));
@@ -1070,12 +1043,7 @@ void run_stats::print_quantile_latency_column(output_table &table, double quanti
1070
1043
table_el el;
1071
1044
table_column column (15 );
1072
1045
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;
1079
1047
hdr_add (m_totals_latency_histogram,m_set_latency_histogram);
1080
1048
hdr_add (m_totals_latency_histogram,m_get_latency_histogram);
1081
1049
hdr_add (m_totals_latency_histogram,m_wait_latency_histogram);
0 commit comments