]> git.sur5r.net Git - openldap/commitdiff
ITS#7182 Introduce the variables for operation monitoring.
authorOndrej Kuznik <ondrej.kuznik@acision.com>
Wed, 8 Feb 2012 13:14:11 +0000 (14:14 +0100)
committerHoward Chu <hyc@openldap.org>
Tue, 27 Mar 2012 11:28:26 +0000 (04:28 -0700)
Only completed operations are considered for now, this can be changed
if needed.

servers/slapd/back-ldap/back-ldap.h
servers/slapd/back-ldap/init.c

index 6bf87020c2b39320f4cb751bd51d166e2374e839..0ae3d48a94058c1c8ef1f1ee95e6ce26f9324267 100644 (file)
@@ -409,6 +409,9 @@ typedef struct ldapinfo_t {
        time_t                  li_conn_ttl;
        time_t                  li_idle_timeout;
        time_t                  li_timeout[ SLAP_OP_LAST ];
+
+       ldap_pvt_thread_mutex_t li_counter_mutex;
+       ldap_pvt_mp_t           li_ops_completed[SLAP_OP_LAST];
 } ldapinfo_t;
 
 #define        LDAP_ERR_OK(err) ((err) == LDAP_SUCCESS || (err) == LDAP_COMPARE_FALSE || (err) == LDAP_COMPARE_TRUE)
index 1a79ac8f79bce06693597a14119827c8478dbc86..6c4e7e86a222d5d00d882cd0333317f522cd4c7a 100644 (file)
@@ -180,6 +180,11 @@ ldap_back_db_init( Backend *be, ConfigReply *cr )
        }
        li->li_conn_priv_max = LDAP_BACK_CONN_PRIV_DEFAULT;
 
+       ldap_pvt_thread_mutex_init( &li->li_counter_mutex );
+       for ( i = 0; i < SLAP_OP_LAST; i++ ) {
+               ldap_pvt_mp_init( li->li_ops_completed[ i ] );
+       }
+
        be->be_private = li;
        SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_NOLASTMOD;
 
@@ -336,6 +341,11 @@ ldap_back_db_destroy( Backend *be, ConfigReply *cr )
                ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
                ldap_pvt_thread_mutex_destroy( &li->li_conninfo.lai_mutex );
                ldap_pvt_thread_mutex_destroy( &li->li_uri_mutex );
+
+               for ( i = 0; i < SLAP_OP_LAST; i++ ) {
+                       ldap_pvt_mp_clear( li->li_ops_completed[ i ] );
+               }
+               ldap_pvt_thread_mutex_destroy( &li->li_counter_mutex );
        }
 
        ch_free( be->be_private );