summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/support/stat.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-11-07 16:47:30 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2016-11-07 16:47:30 +1100
commit0f0db45770f45eab89bd7c2530a259f5ed5b6334 (patch)
treeea969f7a1ef67a08cf2280d5117f62a84ce94840 /src/third_party/wiredtiger/src/support/stat.c
parentd23e79eb9e69bd746416d9f674dfaee59457c887 (diff)
downloadmongo-0f0db45770f45eab89bd7c2530a259f5ed5b6334.tar.gz
Import wiredtiger: 74430da40c96247c0a0d92f011ccfb2b175f1f32 from branch mongodb-3.4
ref: ef9a7983ea..74430da40c for: 3.4.0 SERVER-26753 Minor speed regression (13%) and 'choppy' performance in 3.4 vs 3.2 WT-2415 Add option for join cursors to return false positives WT-2945 Occasional hang running reconfigure fuzz test WT-2947 test suite populate functions need refactoring WT-2953 Test format failure - stuck cache with 1/42MB dirty WT-2961 Add a version drop-down to the web version of the docs WT-2964 WTPERF parallel-pop-btree hung in populate phase WT-2968 backup cursor opens every file WT-2971 Add documentation for raw compression to the WT docs WT-2975 Reduce the memory allocated for statistics WT-2991 Coverity issue 1365198 WT-2998 Add error messages to error returns that might be confusing. WT-2999 Memory leak in join WT_CURSOR with custom extractor WT-3001 WT_EXTENSION_API references are named inconsistently. WT-3003 log generation should not auto generate the record and op types WT-3005 Add top-level .gitignore file. WT-3007 Remove duplicated word in comment WT-3008 Run wtperf stress testing against all maintained branches WT-3009 Test format hung/aborted with small cache (sub 10mB)
Diffstat (limited to 'src/third_party/wiredtiger/src/support/stat.c')
-rw-r--r--src/third_party/wiredtiger/src/support/stat.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c
index 6e8e218a0db..5acd9fc713f 100644
--- a/src/third_party/wiredtiger/src/support/stat.c
+++ b/src/third_party/wiredtiger/src/support/stat.c
@@ -138,15 +138,27 @@ __wt_stat_dsrc_init_single(WT_DSRC_STATS *stats)
memset(stats, 0, sizeof(*stats));
}
-void
-__wt_stat_dsrc_init(WT_DATA_HANDLE *handle)
+int
+__wt_stat_dsrc_init(
+ WT_SESSION_IMPL *session, WT_DATA_HANDLE *handle)
{
int i;
+ WT_RET(__wt_calloc(session, (size_t)WT_COUNTER_SLOTS,
+ sizeof(*handle->stat_array), &handle->stat_array));
+
for (i = 0; i < WT_COUNTER_SLOTS; ++i) {
handle->stats[i] = &handle->stat_array[i];
__wt_stat_dsrc_init_single(handle->stats[i]);
}
+ return (0);
+}
+
+void
+__wt_stat_dsrc_discard(
+ WT_SESSION_IMPL *session, WT_DATA_HANDLE *handle)
+{
+ __wt_free(session, handle->stat_array);
}
void
@@ -860,15 +872,27 @@ __wt_stat_connection_init_single(WT_CONNECTION_STATS *stats)
memset(stats, 0, sizeof(*stats));
}
-void
-__wt_stat_connection_init(WT_CONNECTION_IMPL *handle)
+int
+__wt_stat_connection_init(
+ WT_SESSION_IMPL *session, WT_CONNECTION_IMPL *handle)
{
int i;
+ WT_RET(__wt_calloc(session, (size_t)WT_COUNTER_SLOTS,
+ sizeof(*handle->stat_array), &handle->stat_array));
+
for (i = 0; i < WT_COUNTER_SLOTS; ++i) {
handle->stats[i] = &handle->stat_array[i];
__wt_stat_connection_init_single(handle->stats[i]);
}
+ return (0);
+}
+
+void
+__wt_stat_connection_discard(
+ WT_SESSION_IMPL *session, WT_CONNECTION_IMPL *handle)
+{
+ __wt_free(session, handle->stat_array);
}
void