From 148204839f585b3064eca2ddbcc8688de9342cfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Fri, 23 Sep 2022 12:47:37 +0100 Subject: [PATCH] ITS#9886 Report time taken to process each syncrepl message --- servers/slapd/syncrepl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index c28de10f64..af731b3b22 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1598,6 +1598,17 @@ logerr: if ( modlist ) { slap_mods_free( modlist, 1 ); } + if ( LogTest( LDAP_DEBUG_SYNC ) ) { + struct timeval now; + gettimeofday( &now, NULL ); + now.tv_sec -= si->si_lastcontact.tv_sec; + now.tv_usec -= si->si_lastcontact.tv_usec; + if ( now.tv_usec < 0 ) { + --now.tv_sec; now.tv_usec += 1000000; + } + Debug( LDAP_DEBUG_SYNC, "do_syncrep2: %s etime=%d.%06d\n", + si->si_ridtxt, (int)now.tv_sec, (int)now.tv_usec ); + } if ( rc ) goto done; break; -- 2.47.3