diff --git a/matrix/sync.cc b/matrix/sync.cc index 1502ffba2..507ea2352 100644 --- a/matrix/sync.cc +++ b/matrix/sync.cc @@ -360,7 +360,40 @@ try if(!enable) return false; - return _linear(data); + #ifdef RB_DEBUG + sync::stats stats + { + data.stats && (stats::info || stats_debug)? + *data.stats: + sync::stats{} + }; + + if(data.stats && (stats::info || stats_debug)) + stats.timer = {}; + #endif + + const bool ret + { + _linear(data) + }; + + #ifdef RB_DEBUG + if(data.stats && (stats::info || stats_debug)) + { + //data.out.flush(); + char tmbuf[32]; + log::debug + { + log, "linear %s commit:%b '%s' %s", + loghead(data), + ret, + name(), + ircd::pretty(tmbuf, stats.timer.at(), true) + }; + } + #endif + + return ret; } catch(const ctx::interrupted &) {