diff options
author | Don Anderson <dda@ddanderson.com> | 2015-11-17 10:34:11 -0500 |
---|---|---|
committer | Don Anderson <dda@ddanderson.com> | 2015-11-17 10:34:11 -0500 |
commit | a22cde620d799e8019a72c427ba5b2b8e2e39489 (patch) | |
tree | 5fe06ed5b285006149cca41e0a9da1f4565192d7 /src/include/cursor.h | |
parent | 1d26b39e4f65f5c2076cbdd9cfa21f237e0d0947 (diff) | |
download | mongo-a22cde620d799e8019a72c427ba5b2b8e2e39489.tar.gz |
WT-1315. Support statistics on join cursors.
Statistics for these are a bit different than for a data source or a
connection:
1) The statistics are simple (currently only 3), but range over sets of
indices, so traversing the stats is a two level operation. Added a private
callback API to advance to the next index when the stats have been
exhausted.
2) cursors are used as single threaded operations, so arrays of stats is to
avoid thread conflicts is not needed.
Minor change: the stats_desc callback changed to return an int, and added
an arg to provide some context. In the join cursor case, the returned desc
is not a static string, it needs to be created and managed.
Diffstat (limited to 'src/include/cursor.h')
-rw-r--r-- | src/include/cursor.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/include/cursor.h b/src/include/cursor.h index a65a95e91f5..98f520b9fd8 100644 --- a/src/include/cursor.h +++ b/src/include/cursor.h @@ -300,9 +300,11 @@ struct __wt_cursor_join_entry { #define WT_CURJOIN_ENTRY_OWN_BLOOM 0x04 /* this entry owns the bloom */ uint8_t flags; - WT_CURSOR_JOIN_ENDPOINT *ends; /* reference endpoints */ + WT_CURSOR_JOIN_ENDPOINT *ends; /* reference endpoints */ size_t ends_allocated; size_t ends_next; + + WT_JOIN_STATS stats; /* Join statistics */ }; struct __wt_cursor_join { @@ -356,6 +358,13 @@ struct __wt_cursor_metadata { uint32_t flags; }; +struct __wt_join_stats_group { + const char *desc_prefix; /* Prefix appears before description */ + WT_CURSOR_JOIN *join_cursor; + size_t join_cursor_entry; /* Position in entries */ + WT_JOIN_STATS join_stats; +}; + struct __wt_cursor_stat { WT_CURSOR iface; @@ -365,14 +374,19 @@ struct __wt_cursor_stat { int64_t *stats; /* Statistics */ int stats_base; /* Base statistics value */ int stats_count; /* Count of statistics values */ - const char *(*stats_desc)(int); /* Statistics descriptions */ + int (*stats_desc)(WT_CURSOR_STAT *, int, const char **); + /* Statistics descriptions */ + int (*next_set)(WT_SESSION_IMPL *, WT_CURSOR_STAT *, bool, + bool); /* Advance to next set */ union { /* Copies of the statistics */ WT_DSRC_STATS dsrc_stats; WT_CONNECTION_STATS conn_stats; + WT_JOIN_STATS_GROUP join_stats_group; } u; const char **cfg; /* Original cursor configuration */ + char *desc_buf; /* Saved description string */ int key; /* Current stats key */ uint64_t v; /* Current stats value */ |