DbEnv::memp_stat API Ref

#include <db_cxx.h>

int DbEnv::memp_stat(DB_MPOOL_STAT **gsp, DB_MPOOL_FSTAT *(*fsp)[], u_int32_t flags);

int DbEnv::memp_stat_print(u_int32_t flags);


Description: DbEnv::memp_stat

The DbEnv::memp_stat method returns the memory pool (that is, the buffer cache) subsystem statistics.

The DbEnv::memp_stat method creates statistical structures of type DB_MPOOL_STAT and DB_MPOOL_FSTAT, and copy pointers to them into user-specified memory locations. The cache statistics are stored in the DB_MPOOL_STAT structure and the per-file cache statistics are stored the DB_MPOOL_FSTAT structure.

Statistical structures are stored in allocated memory. If application-specific allocation routines have been declared (see DbEnv::set_alloc for more information), they are used to allocate the memory; otherwise, the standard C library malloc(3) is used. The caller is responsible for deallocating the memory. To deallocate the memory, free the memory reference; references inside the returned memory need not be individually freed.

If gsp is non-NULL, the global statistics for the cache mp are copied into the memory location to which it refers. The following DB_MPOOL_STAT fields will be filled in:


size_t st_gbytes; size_t st_bytes; u_int32_t st_ncache; u_int32_t st_max_ncache; roff_t st_regsize; size_t st_mmapsize; int st_maxopenfd; int st_maxwrite; db_timeout_t st_maxwrite_sleep; u_int32_t st_map; u_int32_t st_cache_hit; u_int32_t st_cache_miss; u_int32_t st_page_create; u_int32_t st_page_in; u_int32_t st_page_out; u_int32_t st_ro_evict; u_int32_t st_rw_evict; u_int32_t st_page_trickle; u_int32_t st_pages; u_int32_t st_page_clean; u_int32_t st_page_dirty; u_int32_t st_hash_buckets; u_int32_t st_hash_searches; u_int32_t st_hash_longest; u_int32_t st_hash_examined; u_int32_t st_hash_nowait; u_int32_t st_hash_wait; u_int32_t st_hash_max_nowait; u_int32_t st_hash_max_wait; u_int32_t st_region_wait; u_int32_t st_region_nowait; u_int32_t st_mvcc_frozen; u_int32_t st_mvcc_thawed; u_int32_t st_mvcc_freed; u_int32_t st_alloc; u_int32_t st_alloc_buckets; u_int32_t st_alloc_max_buckets; u_int32_t st_alloc_pages; u_int32_t st_alloc_max_pages; u_int32_t st_io_wait;

If fsp is non-NULL, a pointer to a NULL-terminated variable length array of statistics for individual files, in the cache mp, is copied into the memory location to which it refers. If no individual files currently exist in the cache, fsp will be set to NULL.

The per-file statistics are stored in structures of type DB_MPOOL_FSTAT. The following DB_MPOOL_FSTAT fields will be filled in for each file in the cache; that is, each element of the array:


char * file_name; size_t st_pagesize; u_int32_t st_cache_hit; u_int32_t st_cache_miss; u_int32_t st_map; u_int32_t st_page_create; u_int32_t st_page_in; u_int32_t st_page_out;

The DbEnv::memp_stat method may not be called before the DbEnv::open method is called.

The DbEnv::memp_stat method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
flags fsp gsp

Errors

The DbEnv::memp_stat method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


EINVAL

Description: DbEnv::memp_stat_print

The DbEnv::memp_stat_print method displays the memory pool subsystem statistical information, as described for the DbEnv::memp_stat method. The information is printed to a specified output channel (see the DbEnv::set_msgfile method for more information), or passed to an application callback function (see the DbEnv::set_msgcall method for more information).

The DbEnv::memp_stat_print method may not be called before the DbEnv::open method is called.

The DbEnv::memp_stat_print method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
flags


Class DbEnv, DbMpoolFile
See Also Memory Pools and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.