blob: e5da46ab7ed9d101e3e91d9632660327cde60fa2 (
plain)
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
|
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2009, 2015 Oracle and/or its affiliates. All rights reserved.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace BerkeleyDB {
/// <summary>
/// Statistical information about the memory pool subsystem
/// </summary>
public class MPoolStats {
private Internal.MPoolStatStruct st;
private CacheInfo ci;
private List<MPoolFileStats> mempfiles;
internal MPoolStats(Internal.MempStatStruct stats) {
st = stats.st;
ci = new CacheInfo(st.st_gbytes, st.st_bytes, (int)st.st_max_ncache);
mempfiles = new List<MPoolFileStats>();
foreach (Internal.MPoolFileStatStruct file in stats.files)
mempfiles.Add(new MPoolFileStats(file));
}
/// <summary>
/// Total cache size and number of regions
/// </summary>
public CacheInfo CacheSettings { get { return ci; } }
/// <summary>
/// Maximum number of regions.
/// </summary>
public uint CacheRegions { get { return st.st_ncache; } }
/// <summary>
/// Maximum file size for mmap.
/// </summary>
public ulong MaxMMapSize { get { return (ulong)st.st_mmapsize.ToInt64(); } }
/// <summary>
/// Maximum number of open file descriptors.
/// </summary>
public int MaxOpenFileDescriptors { get { return st.st_maxopenfd; } }
/// <summary>
/// Maximum buffers to write.
/// </summary>
public int MaxBufferWrites { get { return st.st_maxwrite; } }
/// <summary>
/// Sleep after writing max buffers.
/// </summary>
public uint MaxBufferWritesSleep { get { return st.st_maxwrite_sleep; } }
/// <summary>
/// Total number of pages.
/// </summary>
public uint Pages { get { return st.st_pages; } }
/// <summary>
/// Pages from mapped files.
/// </summary>
public uint MappedPages { get { return st.st_map; } }
/// <summary>
/// Pages found in the cache.
/// </summary>
public ulong PagesInCache { get { return st.st_cache_hit; } }
/// <summary>
/// Pages not found in the cache.
/// </summary>
public ulong PagesNotInCache { get { return st.st_cache_miss; } }
/// <summary>
/// Pages created in the cache.
/// </summary>
public ulong PagesCreatedInCache { get { return st.st_page_create; } }
/// <summary>
/// Pages read in.
/// </summary>
public ulong PagesRead { get { return st.st_page_in; } }
/// <summary>
/// Pages written out.
/// </summary>
public ulong PagesWritten { get { return st.st_page_out; } }
/// <summary>
/// Clean pages forced from the cache.
/// </summary>
public ulong CleanPagesEvicted { get { return st.st_ro_evict; } }
/// <summary>
/// Dirty pages forced from the cache.
/// </summary>
public ulong DirtyPagesEvicted { get { return st.st_rw_evict; } }
/// <summary>
/// Pages written by memp_trickle.
/// </summary>
public ulong PagesTrickled { get { return st.st_page_trickle; } }
/// <summary>
/// Clean pages.
/// </summary>
public uint CleanPages { get { return st.st_page_clean; } }
/// <summary>
/// Dirty pages.
/// </summary>
public uint DirtyPages { get { return st.st_page_dirty; } }
/// <summary>
/// Number of hash buckets.
/// </summary>
public uint HashBuckets { get { return st.st_hash_buckets; } }
/// <summary>
/// Number of hash bucket mutexes.
/// </summary>
public uint HashBucketMutexes { get { return st.st_hash_mutexes; } }
/// <summary>
/// Assumed page size.
/// </summary>
public uint PageSize { get { return st.st_pagesize; } }
/// <summary>
/// Total hash chain searches.
/// </summary>
public uint HashChainSearches { get { return st.st_hash_searches; } }
/// <summary>
/// Longest hash chain searched.
/// </summary>
public uint LongestHashChainSearch { get { return st.st_hash_longest; } }
/// <summary>
/// Total hash entries searched.
/// </summary>
public ulong HashEntriesSearched { get { return st.st_hash_examined; } }
/// <summary>
/// Hash lock granted with nowait.
/// </summary>
public ulong HashLockNoWait { get { return st.st_hash_nowait; } }
/// <summary>
/// Hash lock granted after wait.
/// </summary>
public ulong HashLockWait { get { return st.st_hash_wait; } }
/// <summary>
/// Max hash lock granted with nowait.
/// </summary>
public ulong MaxHashLockNoWait { get { return st.st_hash_max_nowait; } }
/// <summary>
/// Max hash lock granted after wait.
/// </summary>
public ulong MaxHashLockWait { get { return st.st_hash_max_wait; } }
/// <summary>
/// Region lock granted with nowait.
/// </summary>
public ulong RegionLockNoWait { get { return st.st_region_nowait; } }
/// <summary>
/// Region lock granted after wait.
/// </summary>
public ulong RegionLockWait { get { return st.st_region_wait; } }
/// <summary>
/// Buffers frozen.
/// </summary>
public ulong FrozenBuffers { get { return st.st_mvcc_frozen; } }
/// <summary>
/// Buffers thawed.
/// </summary>
public ulong ThawedBuffers { get { return st.st_mvcc_thawed; } }
/// <summary>
/// Frozen buffers freed.
/// </summary>
public ulong FrozenBuffersFreed { get { return st.st_mvcc_freed; } }
/// <summary>
/// Outdated invisible buffers reused.
/// </summary>
public ulong OutdatedInvisibleBuffersReused { get { return st.st_mvcc_reused; } }
/// <summary>
/// Number of page allocations.
/// </summary>
public ulong PageAllocations { get { return st.st_alloc; } }
/// <summary>
/// Buckets checked during allocation.
/// </summary>
public ulong BucketsCheckedDuringAlloc { get { return st.st_alloc_buckets; } }
/// <summary>
/// Max buckets checked during allocation.
/// </summary>
public ulong MaxBucketsCheckedDuringAlloc { get { return st.st_alloc_max_buckets; } }
/// <summary>
/// Pages checked during allocation.
/// </summary>
public ulong PagesCheckedDuringAlloc { get { return st.st_alloc_pages; } }
/// <summary>
/// Max pages checked during allocation.
/// </summary>
public ulong MaxPagesCheckedDuringAlloc { get { return st.st_alloc_max_pages; } }
/// <summary>
/// Thread waited on buffer I/O.
/// </summary>
public ulong BlockedOperations { get { return st.st_io_wait; } }
/// <summary>
/// Number of times sync interrupted.
/// </summary>
public ulong SyncInterrupted { get { return st.st_sync_interrupted; } }
/// <summary>
/// Odd file size detected.
/// </summary>
public uint OddFileSizeDetected { get { return st.st_oddfsize_detect; } }
/// <summary>
/// Odd file size resolved.
/// </summary>
public uint OddFileSizeResolve { get { return st.st_oddfsize_resolve; } }
/// <summary>
/// Region size.
/// </summary>
public ulong RegionSize { get { return (ulong)st.st_regsize.ToInt64(); } }
/// <summary>
/// Individual cache max.
/// </summary>
public ulong RegionMax { get { return (ulong)st.st_regmax.ToInt64(); } }
/// <summary>
/// Stats for files open in the memory pool
/// </summary>
public List<MPoolFileStats> Files { get { return mempfiles; } }
}
}
|