ITS#9914 Add OS pagesize to the back-mdb monitor information

Page size is now provided with the olmMDBPageSize attribute.
This commit is contained in:
Nadezhda Ivanova 2024-10-18 14:48:35 +03:00 committed by Quanah Gibson-Mount
parent 3f6cec3b46
commit 223a755783

View File

@ -50,6 +50,8 @@ static AttributeDescription *ad_olmMDBReadersMax,
static AttributeDescription *ad_olmMDBEntries;
static AttributeDescription *ad_olmMDBPageSize;
/*
* NOTE: there's some confusion in monitor OID arc;
* by now, let's consider:
@ -143,6 +145,14 @@ static struct {
"NO-USER-MODIFICATION "
"USAGE dSAOperation )",
&ad_olmMDBEntries },
{ "( olmMDBAttributes:7 "
"NAME ( 'olmMDBPageSize' ) "
"DESC 'DB page size' "
"SUP monitorCounter "
"NO-USER-MODIFICATION "
"USAGE dSAOperation )",
&ad_olmMDBPageSize },
{ NULL }
};
@ -162,6 +172,7 @@ static struct {
#endif /* MDB_MONITOR_IDX */
"$ olmMDBPagesMax $ olmMDBPagesUsed $ olmMDBPagesFree "
"$ olmMDBReadersMax $ olmMDBReadersUsed $ olmMDBEntries "
"$ olmMDBPageSize "
") )",
&oc_olmMDBDatabase },
@ -216,6 +227,12 @@ mdb_monitor_update(
bv.bv_len = snprintf( buf, sizeof( buf ), "%u", mei.me_numreaders );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
a = attr_find( e->e_attrs, ad_olmMDBPageSize );
assert( a != NULL );
bv.bv_val = buf;
bv.bv_len = snprintf( buf, sizeof( buf ), "%u", mst.ms_psize );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &txn );
if ( !rc ) {
MDB_cursor *cursor;
@ -436,7 +453,7 @@ mdb_monitor_db_open( BackendDB *be )
}
/* alloc as many as required (plus 1 for objectClass) */
a = attrs_alloc( 1 + 7 );
a = attrs_alloc( 1 + 8 );
if ( a == NULL ) {
rc = 1;
goto cleanup;
@ -472,6 +489,10 @@ mdb_monitor_db_open( BackendDB *be )
next->a_desc = ad_olmMDBEntries;
attr_valadd( next, &bv, NULL, 1 );
next = next->a_next;
next->a_desc = ad_olmMDBPageSize;
attr_valadd( next, &bv, NULL, 1 );
next = next->a_next;
}
{