]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9886 Report time taken to process each syncrepl message
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 23 Sep 2022 11:47:37 +0000 (12:47 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 26 Sep 2022 16:37:14 +0000 (16:37 +0000)
servers/slapd/syncrepl.c

index c28de10f6446f68f0e078e9bcdb3fee4e5a8ef34..af731b3b22d6271bb0626b4dbb3415b881f32756 100644 (file)
@@ -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;