From: Ondřej Kuzník Date: Fri, 23 Sep 2022 11:47:37 +0000 (+0100) Subject: ITS#9886 Report time taken to process each syncrepl message X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=148204839f585b3064eca2ddbcc8688de9342cfc;p=thirdparty%2Fopenldap.git ITS#9886 Report time taken to process each syncrepl message --- 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;