mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 23:59:34 -05:00
Tweak runqueue reporting
This commit is contained in:
parent
173330187e
commit
f01bb8d9ab
1 changed files with 11 additions and 7 deletions
|
|
@ -229,7 +229,7 @@ monitor_subsys_thread_update(
|
||||||
static struct berval runqueue_bv = BER_BVC( "cn=runqueue" );
|
static struct berval runqueue_bv = BER_BVC( "cn=runqueue" );
|
||||||
struct berval rdn, bv;
|
struct berval rdn, bv;
|
||||||
ber_len_t len;
|
ber_len_t len;
|
||||||
int which = 0;
|
int which = 0, i;
|
||||||
struct re_s *re;
|
struct re_s *re;
|
||||||
|
|
||||||
assert( mi != NULL );
|
assert( mi != NULL );
|
||||||
|
|
@ -242,12 +242,13 @@ monitor_subsys_thread_update(
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
a = attr_find( e->e_attrs, mi->mi_ad_monitoredInfo );
|
||||||
|
if ( a == NULL ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
switch( which ) {
|
switch( which ) {
|
||||||
case 1:
|
case 1:
|
||||||
a = attr_find( e->e_attrs, mi->mi_ad_monitoredInfo );
|
|
||||||
if ( a == NULL ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
snprintf( buf, sizeof( buf ), "%d",
|
snprintf( buf, sizeof( buf ), "%d",
|
||||||
ldap_pvt_thread_pool_backload( &connection_pool ) );
|
ldap_pvt_thread_pool_backload( &connection_pool ) );
|
||||||
len = strlen( buf );
|
len = strlen( buf );
|
||||||
|
|
@ -258,13 +259,16 @@ monitor_subsys_thread_update(
|
||||||
AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
|
AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
attr_delete( &e->e_attrs, mi->mi_ad_monitoredInfo );
|
for (i=0; !BER_BVISNULL( a->a_vals+i ); i++) {
|
||||||
|
ch_free( a->a_vals[i].bv_val );
|
||||||
|
BER_BVZERO( a->a_vals+i );
|
||||||
|
}
|
||||||
bv.bv_val = buf;
|
bv.bv_val = buf;
|
||||||
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
|
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
|
||||||
LDAP_STAILQ_FOREACH( re, &slapd_rq.run_list, rnext ) {
|
LDAP_STAILQ_FOREACH( re, &slapd_rq.run_list, rnext ) {
|
||||||
bv.bv_len = snprintf( buf, sizeof( buf ), "%s(%s)",
|
bv.bv_len = snprintf( buf, sizeof( buf ), "%s(%s)",
|
||||||
re->tname, re->tspec );
|
re->tname, re->tspec );
|
||||||
attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo, &bv, NULL );
|
value_add_one( &a->a_vals, &bv );
|
||||||
}
|
}
|
||||||
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue