summaryrefslogtreecommitdiff
path: root/dist/stat.py
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2012-10-08 17:23:39 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2012-10-08 17:23:39 +1100
commit44d97fd746a2dc4207e7735c1073b907b0273fde (patch)
treeaf243b51f488b580fdb3976e4b6d46628eb67842 /dist/stat.py
parentaf357b2111bf7c8c11ff9156d6754dfc8dfbc5b4 (diff)
downloadmongo-44d97fd746a2dc4207e7735c1073b907b0273fde.tar.gz
Add a new statistics cursor type "statistics:lsm".
Update ex_stat.c to demonstrate usage. Update ex_test_perf.c to have a statistics thread.
Diffstat (limited to 'dist/stat.py')
-rw-r--r--dist/stat.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/dist/stat.py b/dist/stat.py
index 0af0e65c04b..bbaaa08b06c 100644
--- a/dist/stat.py
+++ b/dist/stat.py
@@ -6,7 +6,7 @@ from dist import compare_srcfile
from dist import source_paths_list
# Read the source files.
-from stat_data import btree_stats, connection_stats
+from stat_data import btree_stats, connection_stats, lsm_stats
# print_struct --
# Print the structures for the stat.h file.
@@ -37,6 +37,7 @@ for line in open('../src/include/stat.h', 'r'):
skip = 1
print_struct('BTREE', 'btree', btree_stats)
print_struct('CONNECTION', 'connection', connection_stats)
+ print_struct('LSM', 'lsm', lsm_stats)
f.close()
compare_srcfile(tmp_file, '../src/include/stat.h')
@@ -75,6 +76,20 @@ def print_define():
max(1, 6 - int((len('WT_STAT_') + len(l.name)) / 8)) +
str(v) + '\n')
f.write('/*! @} */\n')
+ f.write('''
+/*!
+ * @}
+ * @name Statistics for lsm objects
+ * @anchor statistics_lsm
+ * @{
+ */
+''')
+ for v, l in enumerate(sorted(lsm_stats, key=attrgetter('desc'))):
+ f.write('/*! %s */\n' % '\n * '.join(textwrap.wrap(l.desc, 70)))
+ f.write('#define\tWT_STAT_' + l.name + "\t" *
+ max(1, 6 - int((len('WT_STAT_') + len(l.name)) / 8)) +
+ str(v) + '\n')
+ f.write('/*! @} */\n')
# Update the #defines in the wiredtiger.in file.
tmp_file = '__tmp'
@@ -141,5 +156,6 @@ f.write('#include "wt_internal.h"\n')
print_func('btree', btree_stats)
print_func('connection', connection_stats)
+print_func('lsm', lsm_stats)
f.close()
compare_srcfile(tmp_file, '../src/support/stat.c')