@@ -185,10 +185,10 @@ void run_stats::update_get_op(struct timeval* ts, unsigned int bytes_rx, unsigne
185
185
m_cur_stats.m_get_cmd .update_op (bytes_rx, bytes_tx, latency, hits, misses);
186
186
m_cur_stats.m_total_cmd .update_op (bytes_rx, bytes_tx, latency, hits, misses);
187
187
m_totals.update_op (bytes_rx, bytes_tx, latency);
188
- hdr_record_value (m_get_latency_histogram,latency);
189
- hdr_record_value (inst_m_get_latency_histogram,latency);
190
- hdr_record_value (m_totals_latency_histogram,latency);
191
- hdr_record_value (inst_m_totals_latency_histogram,latency);
188
+ hdr_record_value_capped (m_get_latency_histogram,latency);
189
+ hdr_record_value_capped (inst_m_get_latency_histogram,latency);
190
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
191
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
192
192
}
193
193
194
194
void run_stats::update_set_op (struct timeval * ts, unsigned int bytes_rx, unsigned int bytes_tx, unsigned int latency)
@@ -198,10 +198,10 @@ void run_stats::update_set_op(struct timeval* ts, unsigned int bytes_rx, unsigne
198
198
m_cur_stats.m_set_cmd .update_op (bytes_rx, bytes_tx, latency);
199
199
m_cur_stats.m_total_cmd .update_op (bytes_rx, bytes_tx, latency);
200
200
m_totals.update_op (bytes_rx, bytes_tx, latency);
201
- hdr_record_value (m_set_latency_histogram,latency);
202
- hdr_record_value (inst_m_set_latency_histogram,latency);
203
- hdr_record_value (m_totals_latency_histogram,latency);
204
- hdr_record_value (inst_m_totals_latency_histogram,latency);
201
+ hdr_record_value_capped (m_set_latency_histogram,latency);
202
+ hdr_record_value_capped (inst_m_set_latency_histogram,latency);
203
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
204
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
205
205
}
206
206
207
207
void run_stats::update_moved_get_op (struct timeval * ts, unsigned int bytes_rx, unsigned int bytes_tx, unsigned int latency)
@@ -211,10 +211,10 @@ void run_stats::update_moved_get_op(struct timeval* ts, unsigned int bytes_rx, u
211
211
m_cur_stats.m_get_cmd .update_moved_op (bytes_rx, bytes_tx, latency);
212
212
m_cur_stats.m_total_cmd .update_op (bytes_rx, bytes_tx, latency);
213
213
m_totals.update_op (bytes_rx, bytes_tx, latency);
214
- hdr_record_value (m_get_latency_histogram,latency);
215
- hdr_record_value (inst_m_get_latency_histogram,latency);
216
- hdr_record_value (m_totals_latency_histogram,latency);
217
- hdr_record_value (inst_m_totals_latency_histogram,latency);
214
+ hdr_record_value_capped (m_get_latency_histogram,latency);
215
+ hdr_record_value_capped (inst_m_get_latency_histogram,latency);
216
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
217
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
218
218
}
219
219
220
220
void run_stats::update_moved_set_op (struct timeval * ts, unsigned int bytes_rx, unsigned int bytes_tx, unsigned int latency)
@@ -224,10 +224,10 @@ void run_stats::update_moved_set_op(struct timeval* ts, unsigned int bytes_rx, u
224
224
m_cur_stats.m_set_cmd .update_moved_op (bytes_rx, bytes_tx, latency);
225
225
m_cur_stats.m_total_cmd .update_moved_op (bytes_rx, bytes_tx, latency);
226
226
m_totals.update_op (bytes_rx, bytes_tx, latency);
227
- hdr_record_value (m_set_latency_histogram,latency);
228
- hdr_record_value (inst_m_set_latency_histogram,latency);
229
- hdr_record_value (m_totals_latency_histogram,latency);
230
- hdr_record_value (inst_m_totals_latency_histogram,latency);
227
+ hdr_record_value_capped (m_set_latency_histogram,latency);
228
+ hdr_record_value_capped (inst_m_set_latency_histogram,latency);
229
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
230
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
231
231
}
232
232
233
233
void run_stats::update_moved_arbitrary_op (struct timeval *ts, unsigned int bytes_rx, unsigned int bytes_tx,
@@ -239,9 +239,9 @@ void run_stats::update_moved_arbitrary_op(struct timeval *ts, unsigned int bytes
239
239
m_totals.update_op (bytes_rx, bytes_tx, latency);
240
240
241
241
struct hdr_histogram * hist = m_ar_commands_latency_histograms.at (request_index);
242
- hdr_record_value (hist,latency);
243
- hdr_record_value (m_totals_latency_histogram,latency);
244
- hdr_record_value (inst_m_totals_latency_histogram,latency);
242
+ hdr_record_value_capped (hist,latency);
243
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
244
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
245
245
}
246
246
247
247
void run_stats::update_ask_get_op (struct timeval * ts, unsigned int bytes_rx, unsigned int bytes_tx, unsigned int latency)
@@ -251,10 +251,10 @@ void run_stats::update_ask_get_op(struct timeval* ts, unsigned int bytes_rx, uns
251
251
m_cur_stats.m_get_cmd .update_ask_op (bytes_rx, bytes_tx, latency);
252
252
m_cur_stats.m_total_cmd .update_ask_op (bytes_rx, bytes_tx, latency);
253
253
m_totals.update_op (bytes_rx, bytes_tx, latency);
254
- hdr_record_value (m_get_latency_histogram,latency);
255
- hdr_record_value (inst_m_get_latency_histogram,latency);
256
- hdr_record_value (m_totals_latency_histogram,latency);
257
- hdr_record_value (inst_m_totals_latency_histogram,latency);
254
+ hdr_record_value_capped (m_get_latency_histogram,latency);
255
+ hdr_record_value_capped (inst_m_get_latency_histogram,latency);
256
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
257
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
258
258
}
259
259
260
260
void run_stats::update_ask_set_op (struct timeval * ts, unsigned int bytes_rx, unsigned int bytes_tx, unsigned int latency)
@@ -264,10 +264,10 @@ void run_stats::update_ask_set_op(struct timeval* ts, unsigned int bytes_rx, uns
264
264
m_cur_stats.m_set_cmd .update_ask_op (bytes_rx, bytes_tx, latency);
265
265
m_cur_stats.m_total_cmd .update_ask_op (bytes_rx, bytes_tx, latency);
266
266
m_totals.update_op (bytes_rx, bytes_tx, latency);
267
- hdr_record_value (m_set_latency_histogram,latency);
268
- hdr_record_value (inst_m_set_latency_histogram,latency);
269
- hdr_record_value (m_totals_latency_histogram,latency);
270
- hdr_record_value (inst_m_totals_latency_histogram,latency);
267
+ hdr_record_value_capped (m_set_latency_histogram,latency);
268
+ hdr_record_value_capped (inst_m_set_latency_histogram,latency);
269
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
270
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
271
271
}
272
272
273
273
void run_stats::update_ask_arbitrary_op (struct timeval *ts, unsigned int bytes_rx, unsigned int bytes_tx,
@@ -279,9 +279,9 @@ void run_stats::update_ask_arbitrary_op(struct timeval *ts, unsigned int bytes_r
279
279
m_totals.update_op (bytes_rx, bytes_tx, latency);
280
280
281
281
struct hdr_histogram * hist = m_ar_commands_latency_histograms.at (request_index);
282
- hdr_record_value (hist,latency);
283
- hdr_record_value (m_totals_latency_histogram,latency);
284
- hdr_record_value (inst_m_totals_latency_histogram,latency);
282
+ hdr_record_value_capped (hist,latency);
283
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
284
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
285
285
}
286
286
287
287
void run_stats::update_wait_op (struct timeval *ts, unsigned int latency)
@@ -291,10 +291,10 @@ void run_stats::update_wait_op(struct timeval *ts, unsigned int latency)
291
291
m_cur_stats.m_wait_cmd .update_op (0 ,0 , latency);
292
292
m_cur_stats.m_total_cmd .update_op (0 ,0 , latency);
293
293
m_totals.update_op (0 ,0 , latency);
294
- hdr_record_value (m_wait_latency_histogram,latency);
295
- hdr_record_value (inst_m_wait_latency_histogram,latency);
296
- hdr_record_value (m_totals_latency_histogram,latency);
297
- hdr_record_value (inst_m_totals_latency_histogram,latency);
294
+ hdr_record_value_capped (m_wait_latency_histogram,latency);
295
+ hdr_record_value_capped (inst_m_wait_latency_histogram,latency);
296
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
297
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
298
298
}
299
299
300
300
void run_stats::update_arbitrary_op (struct timeval *ts, unsigned int bytes_rx, unsigned int bytes_tx,
@@ -307,10 +307,10 @@ void run_stats::update_arbitrary_op(struct timeval *ts, unsigned int bytes_rx, u
307
307
308
308
struct hdr_histogram * hist = m_ar_commands_latency_histograms.at (request_index);
309
309
struct hdr_histogram * inst_hist = inst_m_ar_commands_latency_histograms.at (request_index);
310
- hdr_record_value (hist,latency);
311
- hdr_record_value (inst_hist,latency);
312
- hdr_record_value (m_totals_latency_histogram,latency);
313
- hdr_record_value (inst_m_totals_latency_histogram,latency);
310
+ hdr_record_value_capped (hist,latency);
311
+ hdr_record_value_capped (inst_hist,latency);
312
+ hdr_record_value_capped (m_totals_latency_histogram,latency);
313
+ hdr_record_value_capped (inst_m_totals_latency_histogram,latency);
314
314
}
315
315
316
316
unsigned int run_stats::get_duration (void )
@@ -879,16 +879,17 @@ void run_stats::summarize(totals& result) const
879
879
result.m_ask_sec = (double ) (totals.m_set_cmd .m_ask + totals.m_get_cmd .m_ask ) / test_duration_usec * 1000000 ;
880
880
}
881
881
882
- void result_print_to_json (json_handler * jsonhandler, const char * type, double ops ,
882
+ void result_print_to_json (json_handler * jsonhandler, const char * type, double ops_sec ,
883
883
double hits, double miss, double moved, double ask, double kbs, double kbs_rx, double kbs_tx,
884
+ double latency, long m_total_latency, long ops,
884
885
std::vector<float > quantile_list, struct hdr_histogram * latency_histogram,
885
886
std::vector<unsigned int > timestamps,
886
887
std::vector<one_sec_cmd_stats> timeserie_stats )
887
888
{
888
889
if (jsonhandler != NULL ){ // Added for double verification in case someone accidently send NULL.
889
890
jsonhandler->open_nesting (type);
890
- jsonhandler->write_obj (" Count" ," %lld" , hdr_total_count (latency_histogram) );
891
- jsonhandler->write_obj (" Ops/sec" ," %.2f" , ops );
891
+ jsonhandler->write_obj (" Count" ," %lld" , ops );
892
+ jsonhandler->write_obj (" Ops/sec" ," %.2f" , ops_sec );
892
893
jsonhandler->write_obj (" Hits/sec" ," %.2f" , hits);
893
894
jsonhandler->write_obj (" Misses/sec" ," %.2f" , miss);
894
895
@@ -899,12 +900,13 @@ void result_print_to_json(json_handler * jsonhandler, const char * type, double
899
900
jsonhandler->write_obj (" ASK/sec" ," %.2f" , ask);
900
901
901
902
const bool has_samples = hdr_total_count (latency_histogram)>0 ;
902
- const double avg_latency = has_samples ? hdr_mean (latency_histogram)/ ( double ) LATENCY_HDR_RESULTS_MULTIPLIER : 0.0 ;
903
- const double min_latency = has_samples ? hdr_min (latency_histogram)/ (double ) LATENCY_HDR_RESULTS_MULTIPLIER : 0.0 ;
904
- const double max_latency = has_samples ? hdr_max (latency_histogram)/ (double ) LATENCY_HDR_RESULTS_MULTIPLIER : 0.0 ;
903
+ const double avg_latency = latency ;
904
+ const double min_latency = has_samples ? ( hdr_min (latency_histogram) * 1.0 )/ (double ) LATENCY_HDR_RESULTS_MULTIPLIER : 0.0 ;
905
+ const double max_latency = has_samples ? ( hdr_max (latency_histogram) * 1.0 )/ (double ) LATENCY_HDR_RESULTS_MULTIPLIER : 0.0 ;
905
906
// to be retrocompatible
906
907
jsonhandler->write_obj (" Latency" ," %.3f" , avg_latency);
907
908
jsonhandler->write_obj (" Average Latency" ," %.3f" , avg_latency);
909
+ jsonhandler->write_obj (" Accumulated Latency" ," %lld" , m_total_latency / LATENCY_HDR_RESULTS_MULTIPLIER);
908
910
jsonhandler->write_obj (" Min Latency" ," %.3f" , min_latency);
909
911
jsonhandler->write_obj (" Max Latency" ," %.3f" , max_latency);
910
912
// preserve KB/sec for backwards compatibility
@@ -925,6 +927,7 @@ void result_print_to_json(json_handler * jsonhandler, const char * type, double
925
927
jsonhandler->write_obj (" Count" ," %lld" , cmd_stats.m_ops );
926
928
if (sec_has_samples){
927
929
jsonhandler->write_obj (" Average Latency" ," %.3f" , cmd_stats.m_avg_latency );
930
+ jsonhandler->write_obj (" Accumulated Latency" ," %lld" , cmd_stats.m_total_latency / LATENCY_HDR_RESULTS_MULTIPLIER);
928
931
jsonhandler->write_obj (" Min Latency" ," %.3f" , cmd_stats.m_min_latency );
929
932
jsonhandler->write_obj (" Max Latency" ," %.3f" , cmd_stats.m_max_latency );
930
933
for (std::size_t i = 0 ; i < quantile_list.size (); i++){
@@ -1240,6 +1243,9 @@ void run_stats::print_json(json_handler *jsonhandler, arbitrary_command_list& co
1240
1243
m_totals.m_ar_commands [i].m_bytes_sec ,
1241
1244
m_totals.m_ar_commands [i].m_bytes_sec_rx ,
1242
1245
m_totals.m_ar_commands [i].m_bytes_sec_tx ,
1246
+ m_totals.m_ar_commands [i].m_latency ,
1247
+ m_totals.m_ar_commands [i].m_total_latency ,
1248
+ m_totals.m_ar_commands [i].m_ops ,
1243
1249
quantiles_list,
1244
1250
arbitrary_command_latency_histogram,
1245
1251
timestamps,
@@ -1258,6 +1264,9 @@ void run_stats::print_json(json_handler *jsonhandler, arbitrary_command_list& co
1258
1264
m_totals.m_set_cmd .m_bytes_sec ,
1259
1265
m_totals.m_set_cmd .m_bytes_sec_rx ,
1260
1266
m_totals.m_set_cmd .m_bytes_sec_tx ,
1267
+ m_totals.m_set_cmd .m_latency ,
1268
+ m_totals.m_set_cmd .m_total_latency ,
1269
+ m_totals.m_set_cmd .m_ops ,
1261
1270
quantiles_list,
1262
1271
m_set_latency_histogram,
1263
1272
timestamps,
@@ -1271,6 +1280,9 @@ void run_stats::print_json(json_handler *jsonhandler, arbitrary_command_list& co
1271
1280
m_totals.m_get_cmd .m_bytes_sec ,
1272
1281
m_totals.m_get_cmd .m_bytes_sec_rx ,
1273
1282
m_totals.m_get_cmd .m_bytes_sec_tx ,
1283
+ m_totals.m_get_cmd .m_latency ,
1284
+ m_totals.m_get_cmd .m_total_latency ,
1285
+ m_totals.m_get_cmd .m_ops ,
1274
1286
quantiles_list,
1275
1287
m_get_latency_histogram,
1276
1288
timestamps,
@@ -1284,6 +1296,9 @@ void run_stats::print_json(json_handler *jsonhandler, arbitrary_command_list& co
1284
1296
0.0 ,
1285
1297
0.0 ,
1286
1298
0.0 ,
1299
+ 0.0 ,
1300
+ 0.0 ,
1301
+ m_totals.m_wait_cmd .m_ops ,
1287
1302
quantiles_list,
1288
1303
m_wait_latency_histogram,
1289
1304
timestamps,
@@ -1299,6 +1314,9 @@ void run_stats::print_json(json_handler *jsonhandler, arbitrary_command_list& co
1299
1314
m_totals.m_bytes_sec ,
1300
1315
m_totals.m_bytes_sec_rx ,
1301
1316
m_totals.m_bytes_sec_tx ,
1317
+ m_totals.m_latency ,
1318
+ m_totals.m_total_latency ,
1319
+ m_totals.m_ops ,
1302
1320
quantiles_list,
1303
1321
m_totals.latency_histogram ,
1304
1322
timestamps,
0 commit comments