Connection *conn = arg->co_conn;
#ifdef LDAP_COUNTERS
- ldap_pvt_thread_mutex_lock( &ops_mutex );
- ops_initiated++;
- ldap_pvt_thread_mutex_unlock( &ops_mutex );
+ ldap_pvt_thread_mutex_lock( &num_ops_mutex );
+ num_ops_initiated++;
+ ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
#endif
switch ( tag ) {
}
#ifdef LDAP_COUNTERS
- ldap_pvt_thread_mutex_lock( &ops_mutex );
- ops_completed++;
- ldap_pvt_thread_mutex_unlock( &ops_mutex );
+ ldap_pvt_thread_mutex_lock( &num_ops_mutex );
+ num_ops_completed++;
+ ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
#endif
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
#ifdef LDAP_COUNTERS
- conn->c_ops_completed++;
+ conn->c_n_ops_completed++;
#endif
slap_op_remove( &conn->c_ops, arg->co_op );
#endif
int num_conns;
-long ops_initiated;
-long ops_completed;
-ldap_pvt_thread_mutex_t ops_mutex;
+long num_ops_initiated;
+long num_ops_completed;
+ldap_pvt_thread_mutex_t num_ops_mutex;
long num_entries_sent;
long num_bytes_sent;
ldap_pvt_thread_mutex_init( ¤ttime_mutex );
ldap_pvt_thread_mutex_init( &entry2str_mutex );
ldap_pvt_thread_mutex_init( &replog_mutex );
- ldap_pvt_thread_mutex_init( &ops_mutex );
+ ldap_pvt_thread_mutex_init( &num_ops_mutex );
ldap_pvt_thread_mutex_init( &num_sent_mutex );
ldap_pvt_thread_mutex_init( &gmtime_mutex );
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
sprintf( buf, "%d : %s : %d : %d : %s : %s%s%s%s", i,
- buf2, c[i].c_ops_received, c[i].c_ops_completed,
+ buf2, c[i].c_n_ops_received, c[i].c_n_ops_completed,
c[i].c_cdn ? c[i].c_cdn : "NULLDN",
- c[i].c_gettingber ? "r" : "",
+ c[i].c_currentber ? "r" : "",
c[i].c_writewaiter ? "w" : "",
- c[i].c_ops_executing ? "x" : "",
- c[i].c_ops_pending ? "p" : ""
+ c[i].c_ops != NULL ? "x" : "",
+ c[i].c_pending_ops != NULL ? "p" : ""
);
val.bv_val = buf;
attr_merge( e, "readwaiters", vals );
#ifdef LDAP_COUNTERS
- sprintf( buf, "%ld", ops_initiated );
+ ldap_pvt_thread_mutex_lock(&num_ops_mutex);
+ sprintf( buf, "%ld", num_ops_initiated );
+ ldap_pvt_thread_mutex_unlock(&num_ops_mutex);
val.bv_val = buf;
val.bv_len = strlen( buf );
attr_merge( e, "opsinitiated", vals );
- sprintf( buf, "%ld", ops_completed );
+ ldap_pvt_thread_mutex_lock(&num_ops_mutex);
+ sprintf( buf, "%ld", num_ops_completed );
+ ldap_pvt_thread_mutex_unlock(&num_ops_mutex);
val.bv_val = buf;
val.bv_len = strlen( buf );
attr_merge( e, "opscompleted", vals );
+ ldap_pvt_thread_mutex_lock(&num_sent_mutex);
sprintf( buf, "%ld", num_entries_sent );
+ ldap_pvt_thread_mutex_unlock(&num_sent_mutex);
val.bv_val = buf;
val.bv_len = strlen( buf );
attr_merge( e, "entriessent", vals );
+ ldap_pvt_thread_mutex_lock(&num_sent_mutex);
sprintf( buf, "%ld", num_bytes_sent );
+ ldap_pvt_thread_mutex_unlock(&num_sent_mutex);
val.bv_val = buf;
val.bv_len = strlen( buf );
attr_merge( e, "bytessent", vals );
extern int lber_debug;
extern int ldap_syslog;
-#ifdef LDAP_COUNTERS
extern ldap_pvt_thread_mutex_t num_sent_mutex;
extern long num_bytes_sent;
-
extern long num_entries_sent;
-extern ldap_pvt_thread_mutex_t ops_mutex;
-extern long ops_completed;
-extern long ops_initiated;
-#endif
+extern ldap_pvt_thread_mutex_t num_ops_mutex;
+extern long num_ops_completed;
+extern long num_ops_initiated;
extern char *slapd_pid_file;
extern char *slapd_args_file;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex );
-#ifdef LDAP_COUNTERS
ldap_pvt_thread_mutex_lock( &num_sent_mutex );
num_bytes_sent += bytes;
ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
-#endif
Statslog( LDAP_DEBUG_STATS,
"conn=%d op=%d RESULT err=%d tag=%lu nentries=%d\n", conn->c_connid,
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex );
-#ifdef LDAP_COUNTERS
ldap_pvt_thread_mutex_lock( &num_sent_mutex );
num_bytes_sent += bytes;
num_entries_sent++;
ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
-#endif
Statslog( LDAP_DEBUG_STATS2, "conn=%d op=%d ENTRY dn=\"%s\"\n",
conn->c_connid, op->o_opid, e->e_dn, 0, 0 );
int c_writewaiter; /* true if writer is waiting */
long c_n_ops_received; /* num of ops received (next op_id) */
-#ifdef LDAP_COUNTERS
long c_n_ops_executing; /* num of ops currently executing */
long c_n_ops_pending; /* num of ops pending execution */
long c_n_ops_completed; /* num of ops completed */
-#endif
} Connection;
#if defined(LDAP_SYSLOG) && defined(LDAP_DEBUG)