Retrieves a handle to the dictionary of the internal perfmon database.
mco_dictionary_h mco_perfmon_get_dictionary(void);
void
This function returns a handle to the schema dictionary of the Performance Monitor’s internal database. The dictionary can be used with User-Defined Aggregates (UDA), metadata introspection, or other eXtremeDB features that require access to the database schema.
The returned handle is valid only after
mco_perfmon_init()has been called successfully.
mco_dictionary_h
{
MCO_RET rc;
const char *dbname = mco_perfmon_get_db_name();
mco_metadict_entry_t *entry;
if (dbname == NULL) {
/* No database attached */
return;
}
init_metadict();
rc = mco_metadict_register(metadict, dbname, mco_perfmon_get_dictionary(), 0);
if (rc == MCO_S_OK) {
rc = mco_metadict_entry_name(metadict, dbname, &entry);
if (rc == MCO_S_OK) {
/* Use 'entry' for metadata operations */
}
}
}