The Statistics Group contains the API for capacity and performance indicators.
More...
|
#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...
|
|
|
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...
|
|
The Statistics Group contains the API for capacity and performance indicators.
Gets the number of operations performed for a stat type.
- Parameters
-
[in,out] | db | Database handle |
[in] | type | Stat type to return |
[out] | value | Pointer to returned stat's value |
- Returns
- Stat counter status
- Return values
-
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.
Gets the last time when an type operation was performed.
- Parameters
-
[in,out] | db | Database handle |
[in] | type | Stat type to return. |
[out] | value | Pointer to returned stat's value. |
- Returns
- Stat time status
- Return values
-
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] | db | Database 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] | db | Database handle |
[in] | flags | Enables stat operations so that we can track one or both of:
- Operations counters fetch, store and remove.
- 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
-
Use program `mdbm_stat -H' to display stat operation metrics stored in the header.
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] | db | Database handle |