ITS#7182 Introduce the variables for operation monitoring.

Only completed operations are considered for now, this can be changed
if needed.
This commit is contained in:
Ondrej Kuznik 2012-02-08 14:14:11 +01:00 committed by Howard Chu
parent 7baac1d9b4
commit fb2d235615
2 changed files with 13 additions and 0 deletions

View 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)

View 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 );