Classes | Macros | Typedefs | Enumerations | Functions
Statistics Group

The Statistics Group contains the API for capacity and performance indicators. More...

Classes

struct  mdbm_stats
 
struct  mdbm_db_info
 
struct  mdbm_chunk_info
 
struct  mdbm_bucket_stat
 
struct  mdbm_stat_info
 
struct  mdbm_window_stats
 

Macros

#define MDBM_CLOCK_STANDARD   0
 
#define MDBM_CLOCK_TSC   1
 
#define MDBM_STATS_BASIC   0x1
 Basic stats only. More...
 
#define MDBM_STATS_TIMED   0x2
 SLOW! Stats that call get-time functions. More...
 
#define MDBM_STAT_CB_INC   0x0
 Basic stat. More...
 
#define MDBM_STAT_CB_SET   0x1
 Basic stat. More...
 
#define MDBM_STAT_CB_ELAPSED   0x2
 Value is a time delta. More...
 
#define MDBM_STAT_CB_TIME   0x3
 Value is the stat time. More...
 
#define COMBINE_STAT_TAG(tag, flag)   (tag | (flag<<16))
 
#define MDBM_STAT_TAG_FETCH   1 /* Successful fetch stats-callback counter */
 The various stats metrics (tags): All time/latency related stats (defined below) require: mdbm_set_stats_func(db, flags|MDBM_STAT_CB_TIME, ...) More...
 
#define MDBM_STAT_TAG_STORE   2 /* Successful store stats-callback counter */
 
#define MDBM_STAT_TAG_DELETE   3 /* Successful delete stats-callback counter */
 
#define MDBM_STAT_TAG_LOCK   4 /* lock stats-callback counter (not implemented) */
 
#define MDBM_STAT_TAG_FETCH_UNCACHED   5 /* Cache-miss with cache+backingstore */
 
#define MDBM_STAT_TAG_GETPAGE   6 /* Generic access counter in windowed mode */
 
#define MDBM_STAT_TAG_GETPAGE_UNCACHED   7 /* Windowed-mode "miss" (load new page into window) */
 
#define MDBM_STAT_TAG_CACHE_EVICT   8 /* Cache evict stats-callback counter */
 
#define MDBM_STAT_TAG_CACHE_STORE   9 /* Successful cache store counter (BS only) */
 
#define MDBM_STAT_TAG_PAGE_STORE   10 /* Successful page-level store indicator */
 
#define MDBM_STAT_TAG_PAGE_DELETE   11 /* Successful page-level delete indicator */
 
#define MDBM_STAT_TAG_SYNC   12 /* Counter of mdbm_syncs and fsyncs */
 
#define MDBM_STAT_TAG_FETCH_NOT_FOUND   13 /* Fetch cannot find a key in MDBM */
 
#define MDBM_STAT_TAG_FETCH_ERROR   14 /* Error occurred during fetch */
 
#define MDBM_STAT_TAG_STORE_ERROR   15 /* Error occurred during store (e.g. MODIFY failed) */
 
#define MDBM_STAT_TAG_DELETE_FAILED   16 /* Delete failed: cannot find a key in MDBM */
 
#define MDBM_STAT_TAG_FETCH_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_FETCH, MDBM_STAT_CB_ELAPSED)
 Fetch latency (expensive to collect) More...
 
#define MDBM_STAT_TAG_STORE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_STORE, MDBM_STAT_CB_ELAPSED)
 Store latency (expensive to collect) More...
 
#define MDBM_STAT_TAG_DELETE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_DELETE, MDBM_STAT_CB_ELAPSED)
 Delete latency (expensive to collect) More...
 
#define MDBM_STAT_TAG_FETCH_TIME   COMBINE_STAT_TAG(MDBM_STAT_TAG_FETCH, MDBM_STAT_CB_TIME)
 timestamp of last fetch (not yet implemented) More...
 
#define MDBM_STAT_TAG_STORE_TIME   COMBINE_STAT_TAG(MDBM_STAT_TAG_STORE, MDBM_STAT_CB_TIME)
 timestamp of last store (not yet implemented) More...
 
#define MDBM_STAT_TAG_DELETE_TIME   COMBINE_STAT_TAG(MDBM_STAT_TAG_DELETE, MDBM_STAT_CB_TIME)
 timestamp of last delete (not yet implemented) More...
 
#define MDBM_STAT_TAG_FETCH_UNCACHED_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_FETCH_UNCACHED, MDBM_STAT_CB_ELAPSED)
 Cache miss latency for cache+Backingstore only (expensive to collect) More...
 
#define MDBM_STAT_TAG_GETPAGE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_GETPAGE, MDBM_STAT_CB_ELAPSED)
 access latency in windowed mode (expensive to collect) More...
 
#define MDBM_STAT_TAG_GETPAGE_UNCACHED_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_GETPAGE_UNCACHED, MDBM_STAT_CB_ELAPSED)
 windowed-mode miss latency (expensive to collect) More...
 
#define MDBM_STAT_TAG_CACHE_EVICT_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_CACHE_EVICT, MDBM_STAT_CB_ELAPSED)
 cache evict latency (expensive to collect) More...
 
#define MDBM_STAT_TAG_CACHE_STORE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_CACHE_STORE, MDBM_STAT_CB_ELAPSED)
 Cache store latency in Cache+backingstore mode only (expensive to collect) More...
 
#define MDBM_STAT_TAG_PAGE_STORE_VALUE   COMBINE_STAT_TAG(MDBM_STAT_TAG_PAGE_STORE, MDBM_STAT_CB_SET)
 Indicates a store occurred on a particular page. More...
 
#define MDBM_STAT_TAG_PAGE_DELETE_VALUE   COMBINE_STAT_TAG(MDBM_STAT_TAG_PAGE_DELETE, MDBM_STAT_CB_SET)
 Indicates a delete occurred on a particular page. More...
 
#define MDBM_STAT_TAG_SYNC_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_SYNC, MDBM_STAT_CB_ELAPSED)
 mdbm_sync/fsync latency (expensive to collect) More...
 
#define MDBM_STAT_DELETED   0x1
 Deprecated. More...
 
#define MDBM_STAT_KEYS   0x2
 Deprecated. More...
 
#define MDBM_STAT_VALUES   0x4
 Deprecated. More...
 
#define MDBM_STAT_PAGES_ONLY   0x8
 Deprecated. More...
 
#define MDBM_STAT_NOLOCK   0x80
 Do not lock for stat operation. More...
 
#define MDBM_STAT_BUCKETS   20
 Number of buckets for stat histograms. More...
 

Typedefs

typedef struct mdbm_stats mdbm_stats_t
 
typedef uint64_t mdbm_counter_t
 
typedef void(* mdbm_stat_cb )(MDBM *db, int tag, int flags, uint64_t value, void *user)
 The general stats callback function definition. More...
 
typedef struct mdbm_db_info mdbm_db_info_t
 
typedef struct mdbm_chunk_info mdbm_chunk_info_t
 
typedef int(* mdbm_chunk_iterate_func_t )(void *user, const mdbm_chunk_info_t *info)
 
typedef struct mdbm_bucket_stat mdbm_bucket_stat_t
 
typedef struct mdbm_stat_info mdbm_stat_info_t
 
typedef struct mdbm_window_stats mdbm_window_stats_t
 

Enumerations

enum  mdbm_stat_type { MDBM_STAT_TYPE_FETCH = 0, MDBM_STAT_TYPE_STORE = 1, MDBM_STAT_TYPE_DELETE = 2, MDBM_STAT_TYPE_MAX = MDBM_STAT_TYPE_DELETE }
 
enum  { MDBM_PTYPE_FREE = 0, MDBM_PTYPE_DATA = 1, MDBM_PTYPE_DIR = 2, MDBM_PTYPE_LOB = 3 }
 

Functions

int mdbm_get_stat_counter (MDBM *db, mdbm_stat_type type, mdbm_counter_t *value)
 Gets the number of operations performed for a stat type. More...
 
int mdbm_get_stat_time (MDBM *db, mdbm_stat_type type, time_t *value)
 Gets the last time when an type operation was performed. More...
 
void mdbm_reset_stat_operations (MDBM *db)
 Resets the stat counter and last-time performed for fetch, store, and remove operations. More...
 
int mdbm_enable_stat_operations (MDBM *db, int flags)
 Enables and disables gathering of stat counters and/or last-time performed for fetch, store, and remove operations. More...
 
int mdbm_set_stat_time_func (MDBM *db, int flags)
 Tells the MDBM library whether to use TSC (CPU TimeStamp Counters) for timing the performance of fetch, store and delete operations. More...
 
const char * mdbm_get_stat_name (int tag)
 Gets the name of a stat. More...
 
int mdbm_set_stats_func (MDBM *db, int flags, mdbm_stat_cb cb, void *user)
 Sets the callback function for a stat. More...
 
void mdbm_stat_all_page (MDBM *db)
 Prints to stdout various pieces of information, specifically: Total mapped db size, Total number of entries, ADDRESS SPACE page efficiency, ADDRESS SPACE byte efficiency, PHYSICAL MEM/DISK SPACE efficiency, Average bytes per record, Maximum B-tree level, Minimum B-tree level, Minimum free bytes on page, Minimum free bytes on page post compress. More...
 
int mdbm_get_stats (MDBM *db, mdbm_stats_t *s, size_t stats_size)
 Gets a a stats block with individual stat values. More...
 
int mdbm_get_db_info (MDBM *db, mdbm_db_info_t *info)
 Gets configuration information about a database. More...
 
int mdbm_chunk_iterate (MDBM *db, mdbm_chunk_iterate_func_t func, int flags, void *user)
 Iterates over all pages (starting at page 0). More...
 
int mdbm_get_db_stats (MDBM *db, mdbm_db_info_t *info, mdbm_stat_info_t *stats, int flags)
 Gets overall database stats. More...
 
int mdbm_get_window_stats (MDBM *db, mdbm_window_stats_t *stats, size_t s_size)
 Used to retrieve statistics about windowing usage on the associated database. More...
 
uint64_t mdbm_count_records (MDBM *db)
 Counts the number of records in an MDBM. More...
 
mdbm_ubig_t mdbm_count_pages (MDBM *db)
 Counts the number of pages used by an MDBM. More...
 

Detailed Description

The Statistics Group contains the API for capacity and performance indicators.

Macro Definition Documentation

#define MDBM_CLOCK_STANDARD   0
#define MDBM_CLOCK_TSC   1
#define MDBM_STATS_BASIC   0x1

Basic stats only.

#define MDBM_STATS_TIMED   0x2

SLOW! Stats that call get-time functions.

#define MDBM_STAT_CB_INC   0x0

Basic stat.

Value is a delta.

#define MDBM_STAT_CB_SET   0x1

Basic stat.

Value is the current value.

#define MDBM_STAT_CB_ELAPSED   0x2

Value is a time delta.

#define MDBM_STAT_CB_TIME   0x3

Value is the stat time.

#define COMBINE_STAT_TAG (   tag,
  flag 
)    (tag | (flag<<16))
#define MDBM_STAT_TAG_FETCH   1 /* Successful fetch stats-callback counter */

The various stats metrics (tags): All time/latency related stats (defined below) require: mdbm_set_stats_func(db, flags|MDBM_STAT_CB_TIME, ...)

#define MDBM_STAT_TAG_STORE   2 /* Successful store stats-callback counter */
#define MDBM_STAT_TAG_DELETE   3 /* Successful delete stats-callback counter */
#define MDBM_STAT_TAG_LOCK   4 /* lock stats-callback counter (not implemented) */
#define MDBM_STAT_TAG_FETCH_UNCACHED   5 /* Cache-miss with cache+backingstore */
#define MDBM_STAT_TAG_GETPAGE   6 /* Generic access counter in windowed mode */
#define MDBM_STAT_TAG_GETPAGE_UNCACHED   7 /* Windowed-mode "miss" (load new page into window) */
#define MDBM_STAT_TAG_CACHE_EVICT   8 /* Cache evict stats-callback counter */
#define MDBM_STAT_TAG_CACHE_STORE   9 /* Successful cache store counter (BS only) */
#define MDBM_STAT_TAG_PAGE_STORE   10 /* Successful page-level store indicator */
#define MDBM_STAT_TAG_PAGE_DELETE   11 /* Successful page-level delete indicator */
#define MDBM_STAT_TAG_SYNC   12 /* Counter of mdbm_syncs and fsyncs */
#define MDBM_STAT_TAG_FETCH_NOT_FOUND   13 /* Fetch cannot find a key in MDBM */
#define MDBM_STAT_TAG_FETCH_ERROR   14 /* Error occurred during fetch */
#define MDBM_STAT_TAG_STORE_ERROR   15 /* Error occurred during store (e.g. MODIFY failed) */
#define MDBM_STAT_TAG_DELETE_FAILED   16 /* Delete failed: cannot find a key in MDBM */
#define MDBM_STAT_TAG_FETCH_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_FETCH, MDBM_STAT_CB_ELAPSED)

Fetch latency (expensive to collect)

#define MDBM_STAT_TAG_STORE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_STORE, MDBM_STAT_CB_ELAPSED)

Store latency (expensive to collect)

#define MDBM_STAT_TAG_DELETE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_DELETE, MDBM_STAT_CB_ELAPSED)

Delete latency (expensive to collect)

#define MDBM_STAT_TAG_FETCH_TIME   COMBINE_STAT_TAG(MDBM_STAT_TAG_FETCH, MDBM_STAT_CB_TIME)

timestamp of last fetch (not yet implemented)

#define MDBM_STAT_TAG_STORE_TIME   COMBINE_STAT_TAG(MDBM_STAT_TAG_STORE, MDBM_STAT_CB_TIME)

timestamp of last store (not yet implemented)

#define MDBM_STAT_TAG_DELETE_TIME   COMBINE_STAT_TAG(MDBM_STAT_TAG_DELETE, MDBM_STAT_CB_TIME)

timestamp of last delete (not yet implemented)

#define MDBM_STAT_TAG_FETCH_UNCACHED_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_FETCH_UNCACHED, MDBM_STAT_CB_ELAPSED)

Cache miss latency for cache+Backingstore only (expensive to collect)

#define MDBM_STAT_TAG_GETPAGE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_GETPAGE, MDBM_STAT_CB_ELAPSED)

access latency in windowed mode (expensive to collect)

#define MDBM_STAT_TAG_GETPAGE_UNCACHED_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_GETPAGE_UNCACHED, MDBM_STAT_CB_ELAPSED)

windowed-mode miss latency (expensive to collect)

#define MDBM_STAT_TAG_CACHE_EVICT_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_CACHE_EVICT, MDBM_STAT_CB_ELAPSED)

cache evict latency (expensive to collect)

#define MDBM_STAT_TAG_CACHE_STORE_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_CACHE_STORE, MDBM_STAT_CB_ELAPSED)

Cache store latency in Cache+backingstore mode only (expensive to collect)

#define MDBM_STAT_TAG_PAGE_STORE_VALUE   COMBINE_STAT_TAG(MDBM_STAT_TAG_PAGE_STORE, MDBM_STAT_CB_SET)

Indicates a store occurred on a particular page.

Value returned by callback is the page number. It is up to the callback function to maintain a per-page count

#define MDBM_STAT_TAG_PAGE_DELETE_VALUE   COMBINE_STAT_TAG(MDBM_STAT_TAG_PAGE_DELETE, MDBM_STAT_CB_SET)

Indicates a delete occurred on a particular page.

Value returned by callback is the page number. It is up to the callback function to maintain a per-page count

#define MDBM_STAT_TAG_SYNC_LATENCY   COMBINE_STAT_TAG(MDBM_STAT_TAG_SYNC, MDBM_STAT_CB_ELAPSED)

mdbm_sync/fsync latency (expensive to collect)

#define MDBM_STAT_DELETED   0x1

Deprecated.

#define MDBM_STAT_KEYS   0x2

Deprecated.

#define MDBM_STAT_VALUES   0x4

Deprecated.

#define MDBM_STAT_PAGES_ONLY   0x8

Deprecated.

#define MDBM_STAT_NOLOCK   0x80

Do not lock for stat operation.

#define MDBM_STAT_BUCKETS   20

Number of buckets for stat histograms.

Typedef Documentation

typedef struct mdbm_stats mdbm_stats_t
typedef uint64_t mdbm_counter_t
typedef void(* mdbm_stat_cb)(MDBM *db, int tag, int flags, uint64_t value, void *user)

The general stats callback function definition.

Parameters
[in,out]dbDatabase handle
[in]tagInteger identifier of the stat. Use mdbm_get_stat_name to get the string id.
[in]flagsA MDBM_STAT_CB_* value indicating the kind of value.
[in]valueUpdate to the indicated value
[in]userUser-defined callback for data passed into mdbm_set_stats_func
typedef struct mdbm_db_info mdbm_db_info_t
typedef int(* mdbm_chunk_iterate_func_t)(void *user, const mdbm_chunk_info_t *info)

Enumeration Type Documentation

Enumerator
MDBM_STAT_TYPE_FETCH 

fetch* operations

MDBM_STAT_TYPE_STORE 

store* operations

MDBM_STAT_TYPE_DELETE 

delete* operations

MDBM_STAT_TYPE_MAX 
anonymous enum
Enumerator
MDBM_PTYPE_FREE 

Page type free.

MDBM_PTYPE_DATA 

Page type data.

MDBM_PTYPE_DIR 

Page type directory.

MDBM_PTYPE_LOB 

Page type large object.

Function Documentation

int mdbm_get_stat_counter ( MDBM db,
mdbm_stat_type  type,
mdbm_counter_t value 
)

Gets the number of operations performed for a stat type.

Parameters
[in,out]dbDatabase handle
[in]typeStat type to return
[out]valuePointer to returned stat's value
Returns
Stat counter status
Return values
-1Error
0Success

Values for type:

  • MDBM_STAT_TYPE_FETCH - For fetch* operations
  • MDBM_STAT_TYPE_STORE - For store* operations
  • MDBM_STAT_TYPE_DELETE - For delete* operations

Stat operations must be enabled for operations to be tracked. Use mdbm_enable_stat_operations to enable this feature.

Once enabled, statistics are persisted in the MDBM and are not reset on mdbm_close.

Use program `mdbm_stat -H' to display stat operation metrics stored in the header.

int mdbm_get_stat_time ( MDBM db,
mdbm_stat_type  type,
time_t *  value 
)

Gets the last time when an type operation was performed.

Parameters
[in,out]dbDatabase handle
[in]typeStat type to return.
[out]valuePointer to returned stat's value.
Returns
Stat time status
Return values
-1Error
0Success

Values for type:

  • MDBM_STAT_TYPE_FETCH - For fetch* operations
  • MDBM_STAT_TYPE_STORE - For store* operations
  • MDBM_STAT_TYPE_DELETE - For delete* operations

Stat operations must be enabled for operations to be tracked. Use mdbm_enable_stat_operations to enable this feature.

Once enabled, statistics are persisted in the MDBM and are not reset on mdbm_close.

Use program `mdbm_stat -H' to display stat operation metrics stored in the header.

void mdbm_reset_stat_operations ( MDBM db)

Resets the stat counter and last-time performed for fetch, store, and remove operations.

Parameters
[in,out]dbDatabase handle

Stat operations must be enabled for operations to be tracked. Use mdbm_enable_stat_operations to enable this feature. If stat operations are not enabled, using this function will merely reset and already cleared storage.

Use program `mdbm_stat -H' to display stat operation metrics stored in the header.

int mdbm_enable_stat_operations ( MDBM db,
int  flags 
)

Enables and disables gathering of stat counters and/or last-time performed for fetch, store, and remove operations.

Parameters
[in,out]dbDatabase handle
[in]flagsEnables stat operations so that we can track one or both of:
  1. Operations counters fetch, store and remove.
  2. Last timestamp when a fetch, store or delete was performed.

flags = MDBM_STATS_BASIC enables gathering only the stats counters. flags = MDBM_STATS_TIMED enables gathering only the stats timestamps. flags = (MDBM_STATS_BASIC | MDBM_STATS_TIMED) enables both the stats counters and timestamps. flags = 0 disables gathering of stats counters and timestamps.

Return values
-1Error
0Success

Use program `mdbm_stat -H' to display stat operation metrics stored in the header.

int mdbm_set_stat_time_func ( MDBM db,
int  flags 
)

Tells the MDBM library whether to use TSC (CPU TimeStamp Counters) for timing the performance of fetch, store and delete operations.

The standard behavior of timed stat operations is to use clock_gettime(MONOTONIC)

Parameters
[in,out]dbDatabase handle
[in]flagsflags == MDBM_CLOCK_TSC Enables use of TSC flags == MDBM_CLOCK_STANDARD Disables use of TSC
Return values
-1Error
0Success
const char* mdbm_get_stat_name ( int  tag)

Gets the name of a stat.

Parameters
[in]tagStat identifier
Returns
Name of stat identifier. "unknown_tag" is return if tag is unknown.
int mdbm_set_stats_func ( MDBM db,
int  flags,
mdbm_stat_cb  cb,
void *  user 
)

Sets the callback function for a stat.

Parameters
[in,out]dbDatabase handle
[in]flagsPassed to callback function
[in]cbCallback function
[in]userOpaque user information
Returns
Set stats function status
Return values
-1Error, and errno is set
0Success, and callback is set
void mdbm_stat_all_page ( MDBM db)

Prints to stdout various pieces of information, specifically: Total mapped db size, Total number of entries, ADDRESS SPACE page efficiency, ADDRESS SPACE byte efficiency, PHYSICAL MEM/DISK SPACE efficiency, Average bytes per record, Maximum B-tree level, Minimum B-tree level, Minimum free bytes on page, Minimum free bytes on page post compress.

If there are large objects, it loops through and reports record entries per page.

NOTE: There is only a V2 implementation. V3 not currently supported.

Parameters
[in,out]dbDatabase handle
int mdbm_get_stats ( MDBM db,
mdbm_stats_t s,
size_t  stats_size 
)

Gets a a stats block with individual stat values.

Parameters
[in,out]dbDatabase handle
[out]sStats block
[in]stats_sizeStats block s size. Only as many stats will be returned as according to this size. The stats block is filled from top-to-bottom.
Returns
Get stats status
Return values
-1Error, and errno is set
0Success
int mdbm_get_db_info ( MDBM db,
mdbm_db_info_t info 
)

Gets configuration information about a database.

Parameters
[in,out]dbDatabase handle
[out]infoDatabase information
Returns
Database info status
Return values
-1Error, and errno is set
0Success
int mdbm_chunk_iterate ( MDBM db,
mdbm_chunk_iterate_func_t  func,
int  flags,
void *  user 
)

Iterates over all pages (starting at page 0).

This function only does per-page iteration, where mdbm_iterate is intended for per-record iteration starting at a page number.

Parameters
[in,out]dbDatabase handle
[in]funcFunction to invoke for each chunk
[in]flagsIterations flags (below)
[in]userOpaque user pointer passed to func
Returns
Chunk iterate status
Return values
-1Error, and errno is set
0Success

Values for flags mask:

  • MDBM_ITERATE_NOLOCK - Do not lock during iteration
int mdbm_get_db_stats ( MDBM db,
mdbm_db_info_t info,
mdbm_stat_info_t stats,
int  flags 
)

Gets overall database stats.

Parameters
[in,out]dbDatabase handle
[out]infoDatabase page-based stats
[out]statsDatabase record-based stats
[in]flagsIteration control (below)
Returns
Database stats status
Return values
-1Error, errno is set
0Success

Values for flags mask:

  • MDBM_STAT_NOLOCK - Do not lock for overall operation
  • MDBM_ITERATE_NOLOCK - Do no lock for page-based iteration
int mdbm_get_window_stats ( MDBM db,
mdbm_window_stats_t stats,
size_t  s_size 
)

Used to retrieve statistics about windowing usage on the associated database.

The V3 statistics structure is as follows. It may be extended in later versions, in which case the s_size parameter should be set to the sizeof the struct used for that version.

typedef struct mdbm_window_stats {
uint64_t w_num_reused;
uint64_t w_num_remapped;
uint32_t w_window_size;

NOTE: V3 API

Parameters
[in,out]dbDatabase handle
[out]statsPointer to struct that will receive the statistics
[in]s_sizeSize of stats. Should be sizeof(mdbm_window_stats_t) for V3.
Returns
Get window stats status
Return values
-1Error
0Success
uint64_t mdbm_count_records ( MDBM db)

Counts the number of records in an MDBM.

Parameters
[in]dbDatabase handle.
Returns
Number of records stored in an MDBM (use instead of count_all_page).
mdbm_ubig_t mdbm_count_pages ( MDBM db)

Counts the number of pages used by an MDBM.

Parameters
[in]dbDatabase handle.
Returns
Number of pages: Count of all directory+data+LargeObject pages used by an MDBM