From 6edb1d4eec73e3b682baa155de92283641819310 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 18 Sep 2020 21:59:23 -0700 Subject: [PATCH] ircd::db: Skip infolog under condition with mostly zero values. --- ircd/db.cc | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/ircd/db.cc b/ircd/db.cc index f25061a3d..1ee14d5cb 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -3029,21 +3029,22 @@ noexcept char pbuf[8][48]; size_t i(0); - log::info - { - log, "%s key[%zu -> %zu (%zu)] %s -> %s | falloc:%s write:%s rsync:%s fsync:%s total:%s", - prefix, - info.stats.num_input_records, - info.stats.num_output_records, - info.stats.num_records_replaced, - pretty(pbuf[i++], iec(info.stats.total_input_bytes)), - bytes_same? "same": pretty(pbuf[i++], iec(info.stats.total_output_bytes)), - pretty(pbuf[i++], nanoseconds(info.stats.file_prepare_write_nanos), true), - pretty(pbuf[i++], nanoseconds(info.stats.file_write_nanos), true), - pretty(pbuf[i++], nanoseconds(info.stats.file_range_sync_nanos), true), - pretty(pbuf[i++], nanoseconds(info.stats.file_fsync_nanos), true), - pretty(pbuf[i++], microseconds(info.stats.elapsed_micros), true), - }; + if(!bytes_same) + log::info + { + log, "%s key[%zu -> %zu (%zu)] %s -> %s | falloc:%s write:%s rsync:%s fsync:%s total:%s", + prefix, + info.stats.num_input_records, + info.stats.num_output_records, + info.stats.num_records_replaced, + pretty(pbuf[i++], iec(info.stats.total_input_bytes)), + bytes_same? "same": pretty(pbuf[i++], iec(info.stats.total_output_bytes)), + pretty(pbuf[i++], nanoseconds(info.stats.file_prepare_write_nanos), true), + pretty(pbuf[i++], nanoseconds(info.stats.file_write_nanos), true), + pretty(pbuf[i++], nanoseconds(info.stats.file_range_sync_nanos), true), + pretty(pbuf[i++], nanoseconds(info.stats.file_fsync_nanos), true), + pretty(pbuf[i++], microseconds(info.stats.elapsed_micros), true), + }; assert(i <= 8); if(info.stats.num_corrupt_keys > 0)