1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
# Auto-generate statistics #defines, with initialization, clear and aggregate
# functions.
#
# NOTE: Statistics reports show individual objects as operations per second.
# All objects where that does not make sense should have the word 'currently'
# or the phrase 'in the cache' in their text description, for example, 'files
# currently open'.
#
# Optional configuration flags:
# no_clear Value ignored by the statistics refresh function
# no_aggregate Ignore the value when aggregating statistics
# max_aggregate Take the maximum value when aggregating statistics
# no_scale Don't scale value per second in the logging tool script
from operator import attrgetter
class Stat:
def __init__(self, name, desc, flags=''):
self.name = name
self.desc = desc
self.flags = flags
def __cmp__(self, other):
return cmp(self.name, other.name)
##########################################
# CONNECTION statistics
##########################################
connection_stats = [
##########################################
# System statistics
##########################################
Stat('cond_wait', 'pthread mutex condition wait calls'),
Stat('file_open', 'files currently open', 'no_clear,no_scale'),
Stat('memory_allocation', 'memory allocations'),
Stat('memory_free', 'memory frees'),
Stat('memory_grow', 'memory re-allocations'),
Stat('read_io', 'total read I/Os'),
Stat('rwlock_read', 'pthread mutex shared lock read-lock calls'),
Stat('rwlock_write', 'pthread mutex shared lock write-lock calls'),
Stat('write_io', 'total write I/Os'),
##########################################
# Block manager statistics
##########################################
Stat('block_byte_map_read', 'block manager: mapped bytes read'),
Stat('block_byte_read', 'block manager: bytes read'),
Stat('block_byte_write', 'block manager: bytes written'),
Stat('block_map_read', 'block manager: mapped blocks read'),
Stat('block_preload', 'block manager: blocks pre-loaded'),
Stat('block_read', 'block manager: blocks read'),
Stat('block_write', 'block manager: blocks written'),
##########################################
# Cache and eviction statistics
##########################################
Stat('cache_bytes_dirty',
'cache: tracked dirty bytes in the cache', 'no_scale'),
Stat('cache_bytes_inuse',
'cache: bytes currently in the cache', 'no_clear,no_scale'),
Stat('cache_bytes_max',
'cache: maximum bytes configured', 'no_clear,no_scale'),
Stat('cache_bytes_read', 'cache: bytes read into cache'),
Stat('cache_bytes_write', 'cache: bytes written from cache'),
Stat('cache_eviction_clean', 'cache: unmodified pages evicted'),
Stat('cache_eviction_dirty', 'cache: modified pages evicted'),
Stat('cache_eviction_checkpoint',
'cache: checkpoint blocked page eviction'),
Stat('cache_eviction_fail',
'cache: pages selected for eviction unable to be evicted'),
Stat('cache_eviction_force',
'cache: pages evicted because they exceeded the in-memory maximum'),
Stat('cache_eviction_force_fail',
'cache: failed eviction of pages that exceeded the ' +
'in-memory maximum'),
Stat('cache_eviction_hazard',
'cache: hazard pointer blocked page eviction'),
Stat('cache_eviction_internal', 'cache: internal pages evicted'),
Stat('cache_eviction_merge',
'cache: internal page merge operations completed'),
Stat('cache_eviction_merge_fail',
'cache: internal page merge attempts that could not complete'),
Stat('cache_eviction_merge_levels', 'cache: internal levels merged'),
Stat('cache_eviction_slow',
'cache: eviction server unable to reach eviction goal'),
Stat('cache_eviction_walk', 'cache: pages walked for eviction'),
Stat('cache_inmem_split',
'pages split because they were unable to be evicted'),
Stat('cache_pages_dirty',
'cache: tracked dirty pages in the cache', 'no_scale'),
Stat('cache_pages_inuse',
'cache: pages currently held in the cache', 'no_clear,no_scale'),
Stat('cache_read', 'cache: pages read into cache'),
Stat('cache_write', 'cache: pages written from cache'),
##########################################
# Dhandle statistics
##########################################
Stat('dh_conn_handles', 'dhandle: connection dhandles swept'),
Stat('dh_conn_sweeps', 'dhandle: connection sweep attempts'),
Stat('dh_session_handles', 'dhandle: session dhandles swept'),
Stat('dh_session_sweeps', 'dhandle: session sweep attempts'),
Stat('dh_sweep_evict', 'dhandle: sweeps conflicting with evict'),
##########################################
# Logging statistics
##########################################
Stat('log_buffer_grow',
'log: log buffer size increases'),
Stat('log_buffer_size',
'log: total log buffer size', 'no_clear,no_scale'),
Stat('log_bytes_user', 'log: user provided log bytes written'),
Stat('log_bytes_written', 'log: log bytes written'),
Stat('log_max_filesize', 'log: maximum log file size', 'no_clear'),
Stat('log_reads', 'log: log read operations'),
Stat('log_scan_records', 'log: records processed by log scan'),
Stat('log_scan_rereads', 'log: log scan records requiring two reads'),
Stat('log_scans', 'log: log scan operations'),
Stat('log_sync', 'log: log sync operations'),
Stat('log_writes', 'log: log write operations'),
Stat('log_slot_consolidated', 'log: logging bytes consolidated'),
Stat('log_slot_closes', 'log: consolidated slot closures'),
Stat('log_slot_joins', 'log: consolidated slot joins'),
Stat('log_slot_races', 'log: consolidated slot join races'),
Stat('log_slot_switch_fails',
'log: slots selected for switching that were unavailable'),
Stat('log_slot_toobig', 'log: record size exceeded maximum'),
Stat('log_slot_toosmall',
'log: failed to find a slot large enough for record'),
Stat('log_slot_transitions', 'log: consolidated slot join transitions'),
##########################################
# Reconciliation statistics
##########################################
Stat('rec_pages', 'page reconciliation calls'),
Stat('rec_pages_eviction', 'page reconciliation calls for eviction'),
Stat('rec_skipped_update',
'reconciliation failed because an update could not be included'),
##########################################
# Transaction statistics
##########################################
Stat('txn_begin', 'transactions'),
Stat('txn_checkpoint', 'transaction checkpoints'),
Stat('txn_checkpoint_running',
'transaction checkpoint currently running',
'no_aggregate,no_clear,no_scale'),
Stat('txn_commit', 'transactions committed'),
Stat('txn_fail_cache', 'transaction failures due to cache overflow'),
Stat('txn_rollback', 'transactions rolled-back'),
##########################################
# LSM statistics
##########################################
Stat('lsm_rows_merged', 'rows merged in an LSM tree'),
##########################################
# Session operations
##########################################
Stat('session_cursor_open', 'open cursor count', 'no_clear,no_scale'),
##########################################
# Total Btree cursor operations
##########################################
Stat('cursor_create', 'cursor creation'),
Stat('cursor_insert', 'Btree cursor insert calls'),
Stat('cursor_next', 'Btree cursor next calls'),
Stat('cursor_prev', 'Btree cursor prev calls'),
Stat('cursor_remove', 'Btree cursor remove calls'),
Stat('cursor_reset', 'Btree cursor reset calls'),
Stat('cursor_search', 'Btree cursor search calls'),
Stat('cursor_search_near', 'Btree cursor search near calls'),
Stat('cursor_update', 'Btree cursor update calls'),
]
connection_stats = sorted(connection_stats, key=attrgetter('name'))
##########################################
# Data source statistics
##########################################
dsrc_stats = [
##########################################
# Session operations
##########################################
Stat('session_compact', 'object compaction'),
Stat('session_cursor_open', 'open cursor count', 'no_clear,no_scale'),
##########################################
# Cursor 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',
'cursor-insert key and value bytes inserted'),
Stat('cursor_next', 'cursor next calls'),
Stat('cursor_prev', 'cursor prev calls'),
Stat('cursor_remove', 'cursor remove calls'),
Stat('cursor_remove_bytes', 'cursor-remove key bytes removed'),
Stat('cursor_reset', 'cursor reset calls'),
Stat('cursor_search', 'cursor search calls'),
Stat('cursor_search_near', 'cursor search near calls'),
Stat('cursor_update', 'cursor update calls'),
Stat('cursor_update_bytes', 'cursor-update value bytes updated'),
##########################################
# Btree statistics
##########################################
Stat('btree_column_deleted',
'column-store variable-size deleted values', 'no_scale'),
Stat('btree_column_fix',
'column-store fixed-size leaf pages', 'no_scale'),
Stat('btree_column_internal',
'column-store internal pages', 'no_scale'),
Stat('btree_column_variable',
'column-store variable-size leaf pages', 'no_scale'),
Stat('btree_compact_rewrite', 'pages rewritten by compaction'),
Stat('btree_entries',
'total LSM, table or file object key/value pairs', 'no_scale'),
Stat('btree_fixed_len', 'fixed-record size', 'no_aggregate,no_scale'),
Stat('btree_maximum_depth',
'maximum tree depth', 'max_aggregate,no_scale'),
Stat('btree_maxintlitem',
'maximum internal page item size', 'no_aggregate,no_scale'),
Stat('btree_maxintlpage',
'maximum internal page size', 'no_aggregate,no_scale'),
Stat('btree_maxleafitem',
'maximum leaf page item size', 'no_aggregate,no_scale'),
Stat('btree_maxleafpage',
'maximum leaf page size', 'no_aggregate,no_scale'),
Stat('btree_overflow', 'overflow pages', 'no_scale'),
Stat('btree_row_internal', 'row-store internal pages', 'no_scale'),
Stat('btree_row_leaf', 'row-store leaf pages', 'no_scale'),
##########################################
# LSM statistics
##########################################
Stat('bloom_count', 'bloom filters in the LSM tree', 'no_scale'),
Stat('bloom_false_positive', 'bloom filter false positives'),
Stat('bloom_hit', 'bloom filter hits'),
Stat('bloom_miss', 'bloom filter misses'),
Stat('bloom_page_evict',
'bloom filter pages evicted from cache'),
Stat('bloom_page_read', 'bloom filter pages read into cache'),
Stat('bloom_size', 'total size of bloom filters', 'no_scale'),
Stat('lsm_chunk_count',
'chunks in the LSM tree', 'no_aggregate,no_scale'),
Stat('lsm_generation_max',
'highest merge generation in the LSM tree',
'max_aggregate,no_scale'),
Stat('lsm_lookup_no_bloom',
'queries that could have benefited ' +
'from a Bloom filter that did not exist'),
##########################################
# Block manager statistics
##########################################
Stat('block_alloc', 'block manager: blocks allocated'),
Stat('allocation_size',
'block manager: file allocation unit size',
'no_aggregate,no_scale'),
Stat('block_checkpoint_size',
'block manager: checkpoint size', 'no_scale'),
Stat('block_extension',
'block manager: allocations requiring file extension'),
Stat('block_free', 'block manager: blocks freed'),
Stat('block_magic',
'block manager: file magic number', 'no_aggregate,no_scale'),
Stat('block_major', 'block manager: file major version number',
'no_aggregate,no_scale'),
Stat('block_minor',
'block manager: minor version number', 'no_aggregate,no_scale'),
Stat('block_reuse_bytes',
'block manager: file bytes available for reuse'),
Stat('block_size', 'block manager: file size in bytes', 'no_scale'),
##########################################
# Cache and eviction statistics
##########################################
Stat('cache_bytes_read', 'bytes read into cache'),
Stat('cache_bytes_write', 'bytes written from cache'),
Stat('cache_eviction_clean', 'unmodified pages evicted'),
Stat('cache_eviction_checkpoint',
'cache: checkpoint blocked page eviction'),
Stat('cache_eviction_dirty', 'modified pages evicted'),
Stat('cache_eviction_fail',
'data source pages selected for eviction unable to be evicted'),
Stat('cache_eviction_hazard',
'cache: hazard pointer blocked page eviction'),
Stat('cache_eviction_internal', 'internal pages evicted'),
Stat('cache_eviction_merge',
'cache: internal page merge operations completed'),
Stat('cache_eviction_merge_fail',
'cache: internal page merge attempts that could not complete'),
Stat('cache_eviction_merge_levels', 'cache: internal levels merged'),
Stat('cache_inmem_split',
'pages split because they were unable to be evicted'),
Stat('cache_overflow_value',
'overflow values cached in memory', 'no_scale'),
Stat('cache_read', 'pages read into cache'),
Stat('cache_read_overflow', 'overflow pages read into cache'),
Stat('cache_write', 'pages written from cache'),
##########################################
# Compression statistics
##########################################
Stat('compress_raw_ok', 'raw compression call succeeded'),
Stat('compress_raw_fail',
'raw compression call failed, no additional data available'),
Stat('compress_raw_fail_temporary',
'raw compression call failed, additional data available'),
Stat('compress_read', 'compressed pages read'),
Stat('compress_write', 'compressed pages written'),
Stat('compress_write_fail', 'page written failed to compress'),
Stat('compress_write_too_small',
'page written was too small to compress'),
##########################################
# Reconciliation statistics
##########################################
Stat('rec_dictionary', 'reconciliation dictionary matches'),
Stat('rec_overflow_key_internal',
'reconciliation internal-page overflow keys'),
Stat('rec_overflow_key_leaf', 'reconciliation leaf-page overflow keys'),
Stat('rec_overflow_value', 'reconciliation overflow values written'),
Stat('rec_page_delete', 'reconciliation pages deleted'),
Stat('rec_page_merge', 'reconciliation pages merged'),
Stat('rec_pages', 'page reconciliation calls'),
Stat('rec_pages_eviction', 'page reconciliation calls for eviction'),
Stat('rec_skipped_update',
'reconciliation failed because an update could not be included'),
Stat('rec_split_internal', 'reconciliation internal pages split'),
Stat('rec_split_leaf', 'reconciliation leaf pages split'),
Stat('rec_split_max',
'reconciliation maximum splits for a page',
'max_aggregate,no_scale'),
##########################################
# Transaction statistics
##########################################
Stat('txn_update_conflict', 'update conflicts'),
]
dsrc_stats = sorted(dsrc_stats, key=attrgetter('name'))
|