diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-03-27 09:49:00 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-03-27 09:49:00 -0400 |
commit | a29ce2465afd3117060d7b3915c46db0e0e6e65c (patch) | |
tree | bfa0166615fa4f85baa3bd40a760ce9612cd4692 | |
parent | e515ca6b1966207b5091999b9ad499ae18f5d075 (diff) | |
download | mongo-a29ce2465afd3117060d7b3915c46db0e0e6e65c.tar.gz |
Track cursor creation in the statistics (as demonstrated by the Basho
benchmarks, creating a cursor per operation isn't a good idea).
-rw-r--r-- | dist/stat_data.py | 1 | ||||
-rw-r--r-- | src/include/stat.h | 1 | ||||
-rw-r--r-- | src/include/wiredtiger.in | 60 | ||||
-rw-r--r-- | src/session/session_api.c | 1 | ||||
-rw-r--r-- | src/support/stat.c | 2 |
5 files changed, 36 insertions, 29 deletions
diff --git a/dist/stat_data.py b/dist/stat_data.py index 682941b4132..a2f75f63b0a 100644 --- a/dist/stat_data.py +++ b/dist/stat_data.py @@ -105,6 +105,7 @@ dsrc_stats = [ ########################################## # Operations ########################################## + Stat('cursor_create', 'cursor creation'), Stat('cursor_insert', 'cursor insert calls'), Stat('cursor_insert_bulk', 'bulk-loaded cursor-insert calls'), Stat('cursor_insert_bytes', diff --git a/src/include/stat.h b/src/include/stat.h index bafc92b8323..fb2438bd795 100644 --- a/src/include/stat.h +++ b/src/include/stat.h @@ -131,6 +131,7 @@ struct __wt_dsrc_stats { WT_STATS compress_write; WT_STATS compress_write_fail; WT_STATS compress_write_too_small; + WT_STATS cursor_create; WT_STATS cursor_insert; WT_STATS cursor_insert_bulk; WT_STATS cursor_insert_bytes; diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 16a2a8fb675..e960ef3fdda 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -2269,65 +2269,67 @@ extern int wiredtiger_extension_init(WT_SESSION *session, #define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 52 /*! page written was too small to compress */ #define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 53 +/*! cursor creation */ +#define WT_STAT_DSRC_CURSOR_CREATE 54 /*! cursor insert calls */ -#define WT_STAT_DSRC_CURSOR_INSERT 54 +#define WT_STAT_DSRC_CURSOR_INSERT 55 /*! bulk-loaded cursor-insert calls */ -#define WT_STAT_DSRC_CURSOR_INSERT_BULK 55 +#define WT_STAT_DSRC_CURSOR_INSERT_BULK 56 /*! cursor-insert key and value bytes inserted */ -#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 56 +#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 57 /*! cursor next calls */ -#define WT_STAT_DSRC_CURSOR_NEXT 57 +#define WT_STAT_DSRC_CURSOR_NEXT 58 /*! cursor prev calls */ -#define WT_STAT_DSRC_CURSOR_PREV 58 +#define WT_STAT_DSRC_CURSOR_PREV 59 /*! cursor remove calls */ -#define WT_STAT_DSRC_CURSOR_REMOVE 59 +#define WT_STAT_DSRC_CURSOR_REMOVE 60 /*! cursor-remove key bytes removed */ -#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 60 +#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 61 /*! cursor reset calls */ -#define WT_STAT_DSRC_CURSOR_RESET 61 +#define WT_STAT_DSRC_CURSOR_RESET 62 /*! cursor search calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH 62 +#define WT_STAT_DSRC_CURSOR_SEARCH 63 /*! cursor search near calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 63 +#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 64 /*! cursor update calls */ -#define WT_STAT_DSRC_CURSOR_UPDATE 64 +#define WT_STAT_DSRC_CURSOR_UPDATE 65 /*! cursor-update value bytes updated */ -#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 65 +#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 66 /*! chunks in the LSM tree */ -#define WT_STAT_DSRC_LSM_CHUNK_COUNT 66 +#define WT_STAT_DSRC_LSM_CHUNK_COUNT 67 /*! highest merge generation in the LSM tree */ -#define WT_STAT_DSRC_LSM_GENERATION_MAX 67 +#define WT_STAT_DSRC_LSM_GENERATION_MAX 68 /*! queries that could have benefited from a Bloom filter that did not * exist */ -#define WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM 68 +#define WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM 69 /*! reconciliation dictionary matches */ -#define WT_STAT_DSRC_REC_DICTIONARY 69 +#define WT_STAT_DSRC_REC_DICTIONARY 70 /*! reconciliation overflow keys written */ -#define WT_STAT_DSRC_REC_OVFL_KEY 70 +#define WT_STAT_DSRC_REC_OVFL_KEY 71 /*! reconciliation overflow values written */ -#define WT_STAT_DSRC_REC_OVFL_VALUE 71 +#define WT_STAT_DSRC_REC_OVFL_VALUE 72 /*! reconciliation pages deleted */ -#define WT_STAT_DSRC_REC_PAGE_DELETE 72 +#define WT_STAT_DSRC_REC_PAGE_DELETE 73 /*! reconciliation pages merged */ -#define WT_STAT_DSRC_REC_PAGE_MERGE 73 +#define WT_STAT_DSRC_REC_PAGE_MERGE 74 /*! page reconciliation calls */ -#define WT_STAT_DSRC_REC_PAGES 74 +#define WT_STAT_DSRC_REC_PAGES 75 /*! page reconciliation calls for eviction */ -#define WT_STAT_DSRC_REC_PAGES_EVICTION 75 +#define WT_STAT_DSRC_REC_PAGES_EVICTION 76 /*! reconciliation failed because an update could not be included */ -#define WT_STAT_DSRC_REC_SKIPPED_UPDATE 76 +#define WT_STAT_DSRC_REC_SKIPPED_UPDATE 77 /*! reconciliation internal pages split */ -#define WT_STAT_DSRC_REC_SPLIT_INTL 77 +#define WT_STAT_DSRC_REC_SPLIT_INTL 78 /*! reconciliation leaf pages split */ -#define WT_STAT_DSRC_REC_SPLIT_LEAF 78 +#define WT_STAT_DSRC_REC_SPLIT_LEAF 79 /*! reconciliation maximum number of splits created by for a page */ -#define WT_STAT_DSRC_REC_SPLIT_MAX 79 +#define WT_STAT_DSRC_REC_SPLIT_MAX 80 /*! object compaction */ -#define WT_STAT_DSRC_SESSION_COMPACT 80 +#define WT_STAT_DSRC_SESSION_COMPACT 81 /*! update conflicts */ -#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 81 +#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 82 /*! write generation conflicts */ -#define WT_STAT_DSRC_TXN_WRITE_CONFLICT 82 +#define WT_STAT_DSRC_TXN_WRITE_CONFLICT 83 /*! @} */ /* * Statistics section: END diff --git a/src/session/session_api.c b/src/session/session_api.c index bd40df07d6d..80ed8a2d33c 100644 --- a/src/session/session_api.c +++ b/src/session/session_api.c @@ -223,6 +223,7 @@ __session_open_cursor(WT_SESSION *wt_session, session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, open_cursor, config, cfg); + WT_DSTAT_INCR(session, cursor_create); if ((to_dup == NULL && uri == NULL) || (to_dup != NULL && uri != NULL)) WT_ERR_MSG(session, EINVAL, diff --git a/src/support/stat.c b/src/support/stat.c index 7df21d4719e..0b58896dc4c 100644 --- a/src/support/stat.c +++ b/src/support/stat.c @@ -74,6 +74,7 @@ __wt_stat_init_dsrc_stats(WT_DSRC_STATS *stats) stats->compress_write_fail.desc = "page written failed to compress"; stats->compress_write_too_small.desc = "page written was too small to compress"; + stats->cursor_create.desc = "cursor creation"; stats->cursor_insert.desc = "cursor insert calls"; stats->cursor_insert_bulk.desc = "bulk-loaded cursor-insert calls"; stats->cursor_insert_bytes.desc = @@ -171,6 +172,7 @@ __wt_stat_clear_dsrc_stats(void *stats_arg) stats->compress_write.v = 0; stats->compress_write_fail.v = 0; stats->compress_write_too_small.v = 0; + stats->cursor_create.v = 0; stats->cursor_insert.v = 0; stats->cursor_insert_bulk.v = 0; stats->cursor_insert_bytes.v = 0; |