1 /*-
2  * Automatically built by dist/s_java_csharp.
3  *
4  * Copyright (c) 2002, 2020 Oracle and/or its affiliates.  All rights reserved.
5  *
6  * See the file LICENSE for license information.
7  */
8 
9 using System;
10 using System.Runtime.InteropServices;
11 
12 namespace BerkeleyDB.Internal {
13     [StructLayout(LayoutKind.Sequential)]
14     internal struct BTreeStatStruct {
15 	internal uint bt_magic;
16 	internal uint bt_version;
17 	internal uint bt_metaflags;
18 	internal uint bt_nkeys;
19 	internal uint bt_ndata;
20 	internal uint bt_pagecnt;
21 	internal uint bt_pagesize;
22 	internal uint bt_minkey;
23 	internal uint bt_ext_files;
24 	internal uint bt_nblobs;
25 	internal uint bt_re_len;
26 	internal uint bt_re_pad;
27 	internal uint bt_levels;
28 	internal uint bt_int_pg;
29 	internal uint bt_leaf_pg;
30 	internal uint bt_dup_pg;
31 	internal uint bt_over_pg;
32 	internal uint bt_empty_pg;
33 	internal uint bt_free;
34 	internal ulong bt_int_pgfree;
35 	internal ulong bt_leaf_pgfree;
36 	internal ulong bt_dup_pgfree;
37 	internal ulong bt_over_pgfree;
38     }
39 
40     [StructLayout(LayoutKind.Sequential)]
41     internal struct HashStatStruct {
42 	internal uint hash_magic;
43 	internal uint hash_version;
44 	internal uint hash_metaflags;
45 	internal uint hash_nkeys;
46 	internal uint hash_ndata;
47 	internal uint hash_ext_files;
48 	internal uint hash_nblobs;
49 	internal uint hash_pagecnt;
50 	internal uint hash_pagesize;
51 	internal uint hash_ffactor;
52 	internal uint hash_buckets;
53 	internal uint hash_free;
54 	internal ulong hash_bfree;
55 	internal uint hash_bigpages;
56 	internal ulong hash_big_bfree;
57 	internal uint hash_overflows;
58 	internal ulong hash_ovfl_free;
59 	internal uint hash_dup;
60 	internal ulong hash_dup_free;
61     }
62 
63     [StructLayout(LayoutKind.Sequential)]
64     internal struct HeapStatStruct {
65 	internal uint heap_magic;
66 	internal uint heap_version;
67 	internal uint heap_metaflags;
68 	internal uint heap_ext_files;
69 	internal uint heap_nblobs;
70 	internal uint heap_nrecs;
71 	internal uint heap_pagecnt;
72 	internal uint heap_pagesize;
73 	internal uint heap_nregions;
74 	internal uint heap_regionsize;
75     }
76 
77     [StructLayout(LayoutKind.Sequential)]
78     internal struct LockStatStruct {
79 	internal uint st_id;
80 	internal uint st_cur_maxid;
81 	internal uint st_initlocks;
82 	internal uint st_initlockers;
83 	internal uint st_initobjects;
84 	internal uint st_locks;
85 	internal uint st_lockers;
86 	internal uint st_objects;
87 	internal uint st_maxlocks;
88 	internal uint st_maxlockers;
89 	internal uint st_maxobjects;
90 	internal uint st_partitions;
91 	internal uint st_tablesize;
92 	internal int   st_nmodes;
93 	internal uint st_nlockers;
94 	internal uint st_nlocks;
95 	internal uint st_maxnlocks;
96 	internal uint st_maxhlocks;
97 	internal ulong st_locksteals;
98 	internal ulong st_maxlsteals;
99 	internal uint st_maxnlockers;
100 	internal uint st_nobjects;
101 	internal uint st_maxnobjects;
102 	internal uint st_maxhobjects;
103 	internal ulong st_objectsteals;
104 	internal ulong st_maxosteals;
105 	internal ulong st_nrequests;
106 	internal ulong st_nreleases;
107 	internal ulong st_nupgrade;
108 	internal ulong st_ndowngrade;
109 	internal ulong st_lock_wait;
110 	internal ulong st_lock_nowait;
111 	internal ulong st_ndeadlocks;
112 	internal uint st_locktimeout;
113 	internal ulong st_nlocktimeouts;
114 	internal uint st_txntimeout;
115 	internal ulong st_ntxntimeouts;
116 	internal ulong st_part_wait;
117 	internal ulong st_part_nowait;
118 	internal ulong st_part_max_wait;
119 	internal ulong st_part_max_nowait;
120 	internal ulong st_objs_wait;
121 	internal ulong st_objs_nowait;
122 	internal ulong st_lockers_wait;
123 	internal ulong st_lockers_nowait;
124 	internal ulong st_region_wait;
125 	internal ulong st_region_nowait;
126 	internal ulong st_nlockers_hit;
127 	internal ulong st_nlockers_reused;
128 	internal uint st_hash_len;
129 	internal IntPtr	  st_regsize;
130     }
131 
132     [StructLayout(LayoutKind.Sequential)]
133     internal struct LogStatStruct {
134 	internal uint st_magic;
135 	internal uint st_version;
136 	internal int   st_mode;
137 	internal uint st_lg_bsize;
138 	internal uint st_lg_size;
139 	internal uint st_wc_bytes;
140 	internal uint st_wc_mbytes;
141 	internal uint st_fileid_init;
142 	internal uint st_nfileid;
143 	internal uint st_maxnfileid;
144 	internal ulong st_record;
145 	internal uint st_w_bytes;
146 	internal uint st_w_mbytes;
147 	internal ulong st_wcount;
148 	internal ulong st_wcount_fill;
149 	internal ulong st_rcount;
150 	internal ulong st_scount;
151 	internal ulong st_region_wait;
152 	internal ulong st_region_nowait;
153 	internal uint st_cur_file;
154 	internal uint st_cur_offset;
155 	internal uint st_disk_file;
156 	internal uint st_disk_offset;
157 	internal uint st_maxcommitperflush;
158 	internal uint st_mincommitperflush;
159 	internal IntPtr	  st_regsize;
160     }
161 
162     [StructLayout(LayoutKind.Sequential)]
163     internal struct MPoolFileStatStruct {
164 	internal uint st_pagesize;
165 	internal uint st_map;
166 	internal ulong st_cache_hit;
167 	internal ulong st_cache_miss;
168 	internal ulong st_page_create;
169 	internal ulong st_page_in;
170 	internal ulong st_page_out;
171 	internal ulong st_backup_spins;
172 	internal string file_name;
173     }
174 
175     [StructLayout(LayoutKind.Sequential)]
176     internal struct MPoolStatStruct {
177 	internal uint st_gbytes;
178 	internal uint st_bytes;
179 	internal uint st_ncache;
180 	internal uint st_max_ncache;
181 	internal IntPtr st_mmapsize;
182 	internal int st_maxopenfd;
183 	internal int st_maxwrite;
184 	internal uint st_maxwrite_sleep;
185 	internal uint st_pages;
186 	internal uint st_map;
187 	internal ulong st_cache_hit;
188 	internal ulong st_cache_miss;
189 	internal ulong st_page_create;
190 	internal ulong st_page_in;
191 	internal ulong st_page_out;
192 	internal ulong st_ro_evict;
193 	internal ulong st_rw_evict;
194 	internal ulong st_page_trickle;
195 	internal uint st_page_clean;
196 	internal uint st_page_dirty;
197 	internal uint st_hash_buckets;
198 	internal uint st_hash_mutexes;
199 	internal uint st_pagesize;
200 	internal uint st_hash_searches;
201 	internal uint st_hash_longest;
202 	internal ulong st_hash_examined;
203 	internal ulong st_hash_nowait;
204 	internal ulong st_hash_wait;
205 	internal ulong st_hash_max_nowait;
206 	internal ulong st_hash_max_wait;
207 	internal ulong st_region_nowait;
208 	internal ulong st_region_wait;
209 	internal ulong st_mvcc_frozen;
210 	internal ulong st_mvcc_thawed;
211 	internal ulong st_mvcc_freed;
212 	internal ulong st_mvcc_reused;
213 	internal ulong st_alloc;
214 	internal ulong st_alloc_buckets;
215 	internal ulong st_alloc_max_buckets;
216 	internal ulong st_alloc_pages;
217 	internal ulong st_alloc_max_pages;
218 	internal ulong st_io_wait;
219 	internal ulong st_sync_interrupted;
220 	internal uint st_oddfsize_detect;
221 	internal uint st_oddfsize_resolve;
222 	internal IntPtr	  st_regsize;
223 	internal IntPtr	  st_regmax;
224     }
225 
226     internal struct MempStatStruct {
227         internal MPoolStatStruct st;
228         internal MPoolFileStatStruct[] files;
229 }
230 
231     [StructLayout(LayoutKind.Sequential)]
232     internal struct MutexStatStruct {
233 
234 	internal uint st_mutex_align;
235 	internal uint st_mutex_tas_spins;
236 	internal uint st_mutex_init;
237 	internal uint st_mutex_cnt;
238 	internal uint st_mutex_max;
239 	internal uint st_mutex_free;
240 	internal uint st_mutex_inuse;
241 	internal uint st_mutex_inuse_max;
242 
243 
244 	internal ulong st_region_wait;
245 	internal ulong st_region_nowait;
246 	internal IntPtr	  st_regsize;
247 	internal IntPtr	  st_regmax;
248     }
249 
250     [StructLayout(LayoutKind.Sequential)]
251     internal struct QueueStatStruct {
252 	internal uint qs_magic;
253 	internal uint qs_version;
254 	internal uint qs_metaflags;
255 	internal uint qs_nkeys;
256 	internal uint qs_ndata;
257 	internal uint qs_pagesize;
258 	internal uint qs_extentsize;
259 	internal uint qs_pages;
260 	internal uint qs_re_len;
261 	internal uint qs_re_pad;
262 	internal uint qs_pgfree;
263 	internal uint qs_first_recno;
264 	internal uint qs_cur_recno;
265     }
266 
267     [StructLayout(LayoutKind.Sequential)]
268     internal struct RecnoStatStruct {
269 	internal uint bt_magic;
270 	internal uint bt_version;
271 	internal uint bt_metaflags;
272 	internal uint bt_nkeys;
273 	internal uint bt_ndata;
274 	internal uint bt_pagecnt;
275 	internal uint bt_pagesize;
276 	internal uint bt_minkey;
277 	internal uint bt_ext_files;
278 	internal uint bt_nblobs;
279 	internal uint bt_re_len;
280 	internal uint bt_re_pad;
281 	internal uint bt_levels;
282 	internal uint bt_int_pg;
283 	internal uint bt_leaf_pg;
284 	internal uint bt_dup_pg;
285 	internal uint bt_over_pg;
286 	internal uint bt_empty_pg;
287 	internal uint bt_free;
288 	internal ulong bt_int_pgfree;
289 	internal ulong bt_leaf_pgfree;
290 	internal ulong bt_dup_pgfree;
291 	internal ulong bt_over_pgfree;
292     }
293 
294     [StructLayout(LayoutKind.Sequential)]
295     internal struct RepMgrStatStruct {
296 	internal ulong st_perm_failed;
297 	internal ulong st_msgs_queued;
298 	internal ulong st_msgs_dropped;
299 	internal uint st_incoming_queue_gbytes;
300 	internal uint st_incoming_queue_bytes;
301 	internal ulong st_incoming_msgs_dropped;
302 	internal ulong st_connection_drop;
303 	internal ulong st_connect_fail;
304 	internal uint st_elect_threads;
305 	internal uint st_group_stable_log_file;
306 	internal uint st_max_elect_threads;
307 	internal uint st_site_participants;
308 	internal uint st_site_total;
309 	internal uint st_site_views;
310 	internal uint st_polling_method;
311 	internal ulong st_takeovers;
312 	internal ulong st_write_ops_forwarded;
313 	internal ulong st_write_ops_received;
314     }
315 
316     [StructLayout(LayoutKind.Sequential)]
317     internal struct ReplicationStatStruct {
318 	/* !!!
319 	 * Many replication statistics fields cannot be protected by a mutex
320 	 * without an unacceptable performance penalty, since most message
321 	 * processing is done without the need to hold a region-wide lock.
322 	 * Fields whose comments end with a '+' may be updated without holding
323 	 * the replication or log mutexes (as appropriate), and thus may be
324 	 * off somewhat (or, on unreasonable architectures under unlucky
325 	 * circumstances, garbaged).
326 	 */
327 	internal uint st_startup_complete;
328 	internal uint st_view;
329 	internal ulong st_log_queued;
330 	internal uint st_status;
331 	internal DB_LSN_STRUCT st_next_lsn;
332 	internal DB_LSN_STRUCT st_waiting_lsn;
333 	internal DB_LSN_STRUCT st_max_perm_lsn;
334 	internal uint st_next_pg;
335 	internal uint st_waiting_pg;
336 
337 	internal uint st_dupmasters;
338 	internal IntPtr st_env_id;
339 	internal uint st_env_priority;
340 	internal ulong st_ext_duplicated;
341 	internal ulong st_ext_records;
342 	internal ulong st_ext_rereq;
343 	internal ulong st_ext_update_rereq;
344 	internal ulong st_bulk_fills;
345 	internal ulong st_bulk_overflows;
346 	internal ulong st_bulk_records;
347 	internal ulong st_bulk_transfers;
348 	internal ulong st_client_rerequests;
349 	internal ulong st_client_svc_req;
350 	internal ulong st_client_svc_miss;
351 	internal uint st_gen;
352 	internal uint st_egen;
353 	internal ulong st_lease_chk;
354 	internal ulong st_lease_chk_misses;
355 	internal ulong st_lease_chk_refresh;
356 	internal ulong st_lease_sends;
357 
358 	internal ulong st_log_duplicated;
359 	internal ulong st_log_queued_max;
360 	internal ulong st_log_queued_total;
361 	internal ulong st_log_records;
362 	internal ulong st_log_requested;
363 	internal IntPtr st_master;
364 	internal ulong st_master_changes;
365 	internal ulong st_msgs_badgen;
366 	internal ulong st_msgs_processed;
367 	internal ulong st_msgs_recover;
368 	internal ulong st_msgs_send_failures;
369 	internal ulong st_msgs_sent;
370 	internal ulong st_newsites;
371 	internal uint st_nsites;
372 	internal ulong st_nthrottles;
373 	internal ulong st_outdated;
374 	internal ulong st_pg_duplicated;
375 	internal ulong st_pg_records;
376 	internal ulong st_pg_requested;
377 	internal ulong st_txns_applied;
378 	internal ulong st_startsync_delayed;
379 
380 
381 	internal ulong st_elections;
382 	internal ulong st_elections_won;
383 
384 
385 	internal IntPtr st_election_cur_winner;
386 	internal uint st_election_gen;
387 	internal uint st_election_datagen;
388 	internal DB_LSN_STRUCT st_election_lsn;
389 	internal uint st_election_nsites;
390 	internal uint st_election_nvotes;
391 	internal uint st_election_priority;
392 	internal int   st_election_status;
393 	internal uint st_election_tiebreaker;
394 	internal uint st_election_votes;
395 	internal uint st_election_sec;
396 	internal uint st_election_usec;
397 	internal uint st_max_lease_sec;
398 	internal uint st_max_lease_usec;
399 
400 
401     }
402 
403     [StructLayout(LayoutKind.Sequential)]
404     internal struct SequenceStatStruct {
405 	internal ulong st_wait;
406 	internal ulong st_nowait;
407 	internal long  st_current;
408 	internal long  st_value;
409 	internal long  st_last_value;
410 	internal long  st_min;
411 	internal long  st_max;
412 	internal uint st_cache_size;
413 	internal uint st_flags;
414     }
415 
416     [StructLayout(LayoutKind.Sequential)]
417     internal struct TransactionStatStruct {
418 	internal uint st_nrestores;
419 	internal DB_LSN_STRUCT	  st_last_ckp;
420 	internal long	  st_time_ckp;
421 	internal uint st_last_txnid;
422 	internal uint st_inittxns;
423 	internal uint st_maxtxns;
424 	internal ulong st_naborts;
425 	internal ulong st_nbegins;
426 	internal ulong st_ncommits;
427 	internal uint st_nactive;
428 	internal uint st_nsnapshot;
429 	internal uint st_maxnactive;
430 	internal uint st_maxnsnapshot;
431 	internal ulong st_region_wait;
432 	internal ulong st_region_nowait;
433 	internal IntPtr	  st_regsize;
434 	internal IntPtr st_txnarray;
435     }
436 
437     [StructLayout(LayoutKind.Sequential)]
438     internal struct DB_LSN_STRUCT {
439         internal uint file;
440         internal uint offset;
441     }
442 
443     [StructLayout(LayoutKind.Sequential)]
444     internal struct DB_TXN_ACTIVE {
445 	internal uint txnid;
446 	internal uint parentid;
447 	internal int     pid;
448 	internal uint tid;
449 
450 	internal DB_LSN_STRUCT	  lsn;
451 
452 	internal DB_LSN_STRUCT	  read_lsn;
453 	internal uint mvcc_ref;
454 
455 	internal uint priority;
456 
457 	internal uint status;
458 
459 	internal uint xa_status;
460 
461 
462 	/*
463 	 * This array of txnids can either be NULL, or it is a
464 	 * DB_ENV->get_slice_count()-sized array. Any slices which have active
465 	 * subordinate transactions have non-empty entries.
466 	 */
467     }
468 
469     internal struct TxnStatStruct {
470         internal TransactionStatStruct st;
471         internal DB_TXN_ACTIVE[] st_txnarray;
472         internal byte[][] st_txngids;
473         internal string[] st_txnnames;
474     }
475 }
476 
477