1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002, 2014 Oracle and/or its affiliates.  All rights reserved.
5  *
6  */
7 
8 package com.sleepycat.je;
9 
10 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_BACKLOG;
11 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_BIN_DELTAS_CLEANED;
12 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_BIN_DELTAS_DEAD;
13 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_BIN_DELTAS_MIGRATED;
14 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_BIN_DELTAS_OBSOLETE;
15 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_CLUSTER_LNS_PROCESSED;
16 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_DELETIONS;
17 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_ENTRIES_READ;
18 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_FILE_DELETION_BACKLOG;
19 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_INS_CLEANED;
20 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_INS_DEAD;
21 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_INS_MIGRATED;
22 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_INS_OBSOLETE;
23 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LAST_KNOWN_UTILIZATION;
24 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNQUEUE_HITS;
25 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNS_CLEANED;
26 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNS_DEAD;
27 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNS_LOCKED;
28 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNS_MARKED;
29 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNS_MIGRATED;
30 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LNS_OBSOLETE;
31 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_LN_SIZE_CORRECTION_FACTOR;
32 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_MARKED_LNS_PROCESSED;
33 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_PENDING_LNS_LOCKED;
34 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_PENDING_LNS_PROCESSED;
35 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_PENDING_LN_QUEUE_SIZE;
36 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_PROBE_RUNS;
37 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_REPEAT_ITERATOR_READS;
38 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_RUNS;
39 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_TOTAL_LOG_SIZE;
40 import static com.sleepycat.je.cleaner.CleanerStatDefinition.CLEANER_TO_BE_CLEANED_LNS_PROCESSED;
41 import static com.sleepycat.je.dbi.DbiStatDefinition.ENVIMPL_CREATION_TIME;
42 import static com.sleepycat.je.dbi.DbiStatDefinition.ENVIMPL_RELATCHES_REQUIRED;
43 import static com.sleepycat.je.dbi.DbiStatDefinition.MB_ADMIN_BYTES;
44 import static com.sleepycat.je.dbi.DbiStatDefinition.MB_DATA_ADMIN_BYTES;
45 import static com.sleepycat.je.dbi.DbiStatDefinition.MB_DATA_BYTES;
46 import static com.sleepycat.je.dbi.DbiStatDefinition.MB_LOCK_BYTES;
47 import static com.sleepycat.je.dbi.DbiStatDefinition.MB_SHARED_CACHE_TOTAL_BYTES;
48 import static com.sleepycat.je.dbi.DbiStatDefinition.MB_TOTAL_BYTES;
49 import static com.sleepycat.je.dbi.DbiStatDefinition.THROUGHPUT_BIN_DELTA_GETS;
50 import static com.sleepycat.je.dbi.DbiStatDefinition.THROUGHPUT_BIN_DELTA_INSERTS;
51 import static com.sleepycat.je.dbi.DbiStatDefinition.THROUGHPUT_BIN_DELTA_UPDATES;
52 import static com.sleepycat.je.dbi.DbiStatDefinition.THROUGHPUT_BIN_DELTA_DELETES;
53 import static com.sleepycat.je.evictor.EvictorStatDefinition.BIN_DELTA_FETCH_MISS;
54 import static com.sleepycat.je.evictor.EvictorStatDefinition.BIN_FETCH;
55 import static com.sleepycat.je.evictor.EvictorStatDefinition.BIN_FETCH_MISS;
56 import static com.sleepycat.je.evictor.EvictorStatDefinition.BIN_FETCH_MISS_RATIO;
57 import static com.sleepycat.je.evictor.EvictorStatDefinition.BIN_DELTA_BLIND_OPS;
58 import static com.sleepycat.je.evictor.EvictorStatDefinition.FULL_BIN_MISS;
59 import static com.sleepycat.je.evictor.EvictorStatDefinition.CACHED_BINS;
60 import static com.sleepycat.je.evictor.EvictorStatDefinition.CACHED_BIN_DELTAS;
61 import static com.sleepycat.je.evictor.EvictorStatDefinition.CACHED_IN_COMPACT_KEY;
62 import static com.sleepycat.je.evictor.EvictorStatDefinition.CACHED_IN_NO_TARGET;
63 import static com.sleepycat.je.evictor.EvictorStatDefinition.CACHED_IN_SPARSE_TARGET;
64 import static com.sleepycat.je.evictor.EvictorStatDefinition.CACHED_UPPER_INS;
65 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_MUTATED;
66 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_STRIPPED;
67 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_EVICTION_RUNS;
68 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_EVICTED;
69 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_TARGETED;
70 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_ROOT_NODES_EVICTED;
71 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_LNS_EVICTED;
72 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_PUT_BACK;
73 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_SKIPPED;
74 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_NODES_MOVED_TO_DIRTY_LRU;
75 import static com.sleepycat.je.evictor.EvictorStatDefinition.EVICTOR_SHARED_CACHE_ENVS;
76 import static com.sleepycat.je.evictor.EvictorStatDefinition.LN_FETCH;
77 import static com.sleepycat.je.evictor.EvictorStatDefinition.LN_FETCH_MISS;
78 import static com.sleepycat.je.evictor.EvictorStatDefinition.THREAD_UNAVAILABLE;
79 import static com.sleepycat.je.evictor.EvictorStatDefinition.UPPER_IN_FETCH;
80 import static com.sleepycat.je.evictor.EvictorStatDefinition.UPPER_IN_FETCH_MISS;
81 import static com.sleepycat.je.incomp.INCompStatDefinition.INCOMP_CURSORS_BINS;
82 import static com.sleepycat.je.incomp.INCompStatDefinition.INCOMP_DBCLOSED_BINS;
83 import static com.sleepycat.je.incomp.INCompStatDefinition.INCOMP_NON_EMPTY_BINS;
84 import static com.sleepycat.je.incomp.INCompStatDefinition.INCOMP_PROCESSED_BINS;
85 import static com.sleepycat.je.incomp.INCompStatDefinition.INCOMP_QUEUE_SIZE;
86 import static com.sleepycat.je.incomp.INCompStatDefinition.INCOMP_SPLIT_BINS;
87 import static com.sleepycat.je.latch.LatchStatDefinition.LATCH_CONTENTION;
88 import static com.sleepycat.je.latch.LatchStatDefinition.LATCH_NOWAIT_SUCCESS;
89 import static com.sleepycat.je.latch.LatchStatDefinition.LATCH_NOWAIT_UNSUCCESS;
90 import static com.sleepycat.je.latch.LatchStatDefinition.LATCH_NO_WAITERS;
91 import static com.sleepycat.je.latch.LatchStatDefinition.LATCH_RELEASES;
92 import static com.sleepycat.je.latch.LatchStatDefinition.LATCH_SELF_OWNED;
93 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_BYTES_READ_FROM_WRITEQUEUE;
94 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_BYTES_WRITTEN_FROM_WRITEQUEUE;
95 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_FILE_OPENS;
96 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_LOG_FSYNCS;
97 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_OPEN_FILES;
98 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_RANDOM_READS;
99 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_RANDOM_READ_BYTES;
100 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_RANDOM_WRITES;
101 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_RANDOM_WRITE_BYTES;
102 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_READS_FROM_WRITEQUEUE;
103 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_SEQUENTIAL_READS;
104 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_SEQUENTIAL_READ_BYTES;
105 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_SEQUENTIAL_WRITES;
106 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_SEQUENTIAL_WRITE_BYTES;
107 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_WRITEQUEUE_OVERFLOW;
108 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_WRITEQUEUE_OVERFLOW_FAILURES;
109 import static com.sleepycat.je.log.LogStatDefinition.FILEMGR_WRITES_FROM_WRITEQUEUE;
110 import static com.sleepycat.je.log.LogStatDefinition.FSYNCMGR_FSYNCS;
111 import static com.sleepycat.je.log.LogStatDefinition.FSYNCMGR_FSYNC_REQUESTS;
112 import static com.sleepycat.je.log.LogStatDefinition.FSYNCMGR_TIMEOUTS;
113 import static com.sleepycat.je.log.LogStatDefinition.LBFP_BUFFER_BYTES;
114 import static com.sleepycat.je.log.LogStatDefinition.LBFP_LOG_BUFFERS;
115 import static com.sleepycat.je.log.LogStatDefinition.LBFP_MISS;
116 import static com.sleepycat.je.log.LogStatDefinition.LBFP_NOT_RESIDENT;
117 import static com.sleepycat.je.log.LogStatDefinition.LOGMGR_END_OF_LOG;
118 import static com.sleepycat.je.log.LogStatDefinition.LOGMGR_REPEAT_FAULT_READS;
119 import static com.sleepycat.je.log.LogStatDefinition.LOGMGR_TEMP_BUFFER_WRITES;
120 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_CHECKPOINTS;
121 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_DELTA_IN_FLUSH;
122 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_FULL_BIN_FLUSH;
123 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_FULL_IN_FLUSH;
124 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_LAST_CKPTID;
125 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_LAST_CKPT_END;
126 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_LAST_CKPT_INTERVAL;
127 import static com.sleepycat.je.recovery.CheckpointStatDefinition.CKPT_LAST_CKPT_START;
128 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_OWNERS;
129 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_READ_LOCKS;
130 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_REQUESTS;
131 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_TOTAL;
132 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_WAITERS;
133 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_WAITS;
134 import static com.sleepycat.je.txn.LockStatDefinition.LOCK_WRITE_LOCKS;
135 
136 import java.io.Serializable;
137 import java.util.Arrays;
138 import java.util.Collection;
139 import java.util.HashMap;
140 import java.util.Map;
141 
142 import com.sleepycat.je.cleaner.CleanerStatDefinition;
143 import com.sleepycat.je.dbi.DbiStatDefinition;
144 import com.sleepycat.je.evictor.Evictor.EvictionSource;
145 import com.sleepycat.je.evictor.EvictorStatDefinition;
146 import com.sleepycat.je.incomp.INCompStatDefinition;
147 import com.sleepycat.je.log.LogStatDefinition;
148 import com.sleepycat.je.recovery.CheckpointStatDefinition;
149 import com.sleepycat.je.txn.LockStatDefinition;
150 import com.sleepycat.je.utilint.StatGroup;
151 
152 /**
153  * Statistics for a single environment.
154  * <p>
155  * The statistics are logically grouped into several categories. Viewing the
156  * statistics through {@link EnvironmentStats#toString()} displays the values
157  * in these categories, as does viewing the stats through the {@link <a
158  * href="{@docRoot}/../jconsole/JConsole-plugin.html">JEMonitor mbean</a>}.
159  * Viewing the stats with {@link EnvironmentStats#toStringVerbose()} will
160  * provide more detailed descriptions of the stats and stat categories.
161  * <p>
162  * The current categories are:
163  * <ul>
164  * <li><b>IO</b>: Log file opens, reads, writes, cache misses.</li>
165  * <li><b>Cache</b>: Data, keys, internal btree nodes, locks and JE metadata
166  * reside in the cache. If the cache is too full, nodes, data and keys are
167  * periodically evicted to stay within the defined cache size.</li>
168  * <li><b>Log Cleaning</b>: Maintenance of JE's append only storage system.
169  * See this <a href="{@docRoot}/../GettingStartedGuide/logfilesrevealed.html">
170  * overview</a> of the logging system. Log files are removed as their
171  * contents become obsolete.</li>
172  * <li><b>Node Compression</b>: Internal btree nodes are compressed and removed
173  * when their contents become sparse. </li>
174  * <li><b>Checkpoints</b>: The frequency and extent of checkpointing activity.
175  * </li>
176  * <li><b>Environment</b>: Miscellaneous environment wide statistics.
177  * </li>
178  * <li><b>Locks</b>: Number of locking operations, contention on lock table.
179  * </li>
180  * </ul>
181  * @see <a href="{@docRoot}/../jconsole/JConsole-plugin.html">Viewing
182  * Statistics with JConsole</a>
183  */
184 public class EnvironmentStats implements Serializable {
185 
186     private static final long serialVersionUID = 1734048134L;
187 
188     private StatGroup incompStats;
189     private StatGroup cacheStats;
190     private StatGroup ckptStats;
191     private StatGroup cleanerStats;
192     private StatGroup logStats;
193     private StatGroup lockStats;
194     private StatGroup envImplStats;
195     private StatGroup throughputStats;
196 
197     /**
198      * @hidden
199      * Internal use only.
200      */
EnvironmentStats()201     public EnvironmentStats() {
202         incompStats = new StatGroup(INCompStatDefinition.GROUP_NAME,
203                                     INCompStatDefinition.GROUP_DESC);
204 
205         /*
206          * Memory budget stats are displayed with evictor stats, as a single
207          * cache category.
208          */
209         cacheStats = new StatGroup(EvictorStatDefinition.GROUP_NAME,
210                                    EvictorStatDefinition.GROUP_DESC);
211         ckptStats = new StatGroup(CheckpointStatDefinition.GROUP_NAME,
212                                   CheckpointStatDefinition.GROUP_DESC);
213         cleanerStats = new StatGroup(CleanerStatDefinition.GROUP_NAME,
214                                      CleanerStatDefinition.GROUP_DESC);
215         logStats = new StatGroup(LogStatDefinition.GROUP_NAME,
216                                  LogStatDefinition.GROUP_DESC);
217         lockStats = new StatGroup(LockStatDefinition.GROUP_NAME,
218                                   LockStatDefinition.GROUP_DESC);
219         envImplStats = new StatGroup(DbiStatDefinition.ENV_GROUP_NAME,
220                                      DbiStatDefinition.ENV_GROUP_DESC);
221         throughputStats =
222             new StatGroup(DbiStatDefinition.THROUGHPUT_GROUP_NAME,
223                           DbiStatDefinition.THROUGHPUT_GROUP_DESC);
224     }
225 
226     /**
227      * @hidden
228      * Internal use only.
229      */
getStatGroups()230     public Collection<StatGroup> getStatGroups() {
231         return Arrays.asList(cacheStats, ckptStats, cleanerStats, logStats,
232                              lockStats, envImplStats, incompStats,
233                              throughputStats);
234     }
235 
236     /**
237      * @hidden
238      * Internal use only.
239      */
getStatGroupsMap()240     public Map<String, StatGroup> getStatGroupsMap() {
241         HashMap<String, StatGroup> map = new HashMap<String, StatGroup>();
242         map.put(cacheStats.getName(), cacheStats);
243         map.put(ckptStats.getName(), ckptStats);
244         map.put(cleanerStats.getName(), cleanerStats);
245         map.put(logStats.getName(), logStats);
246         map.put(lockStats.getName(), lockStats);
247         map.put(envImplStats.getName(), envImplStats);
248         map.put(incompStats.getName(), incompStats);
249         map.put(throughputStats.getName(), throughputStats);
250         return map;
251     }
252 
253     /**
254      * @hidden
255      * Internal use only.
256      */
setStatGroup(StatGroup sg)257     public void setStatGroup(StatGroup sg) {
258 
259         if (sg.getName().equals(INCompStatDefinition.GROUP_NAME)) {
260             incompStats = sg;
261         } else if (sg.getName().equals(EvictorStatDefinition.GROUP_NAME)) {
262             cacheStats = sg;
263         } else if (sg.getName().equals(CheckpointStatDefinition.GROUP_NAME)) {
264             ckptStats = sg;
265         } else if (sg.getName().equals(CleanerStatDefinition.GROUP_NAME)) {
266             cleanerStats = sg;
267         } else if (sg.getName().equals(LogStatDefinition.GROUP_NAME)) {
268             logStats = sg;
269         } else if (sg.getName().equals(LockStatDefinition.GROUP_NAME)) {
270             lockStats = sg;
271         } else if (sg.getName().equals(DbiStatDefinition.ENV_GROUP_NAME)) {
272             envImplStats = sg;
273         } else if (sg.getName().equals(
274             DbiStatDefinition.THROUGHPUT_GROUP_NAME)) {
275             throughputStats = sg;
276         } else {
277             throw EnvironmentFailureException.unexpectedState
278             ("Invalid stat group name in setStatGroup " +
279             sg.getName());
280         }
281     }
282 
283     /**
284      * @hidden
285      * Internal use only
286      * For JConsole plugin support.
287      */
getStatGroupTitles()288     public static String[] getStatGroupTitles() {
289         return new String[] {
290             LogStatDefinition.GROUP_NAME,
291             EvictorStatDefinition.GROUP_NAME,
292             CleanerStatDefinition.GROUP_NAME,
293             INCompStatDefinition.GROUP_NAME,
294             CheckpointStatDefinition.GROUP_NAME,
295             DbiStatDefinition.ENV_GROUP_NAME,
296             LockStatDefinition.GROUP_NAME};
297     }
298 
299     /**
300      * @hidden
301      * Internal use only.
302      */
setINCompStats(StatGroup stats)303     public void setINCompStats(StatGroup stats) {
304         incompStats = stats;
305     }
306 
307     /**
308      * @hidden
309      * Internal use only.
310      */
setCkptStats(StatGroup stats)311     public void setCkptStats(StatGroup stats) {
312         ckptStats = stats;
313     }
314 
315     /**
316      * @hidden
317      * Internal use only.
318      */
setCleanerStats(StatGroup stats)319     public void setCleanerStats(StatGroup stats) {
320         cleanerStats = stats;
321     }
322 
323     /**
324      * @hidden
325      * Internal use only.
326      */
setLogStats(StatGroup stats)327     public void setLogStats(StatGroup stats) {
328         logStats = stats;
329     }
330 
331     /**
332      * @hidden
333      * Internal use only.
334      */
setMBAndEvictorStats(StatGroup clonedMBStats, StatGroup clonedEvictorStats)335     public void setMBAndEvictorStats(StatGroup clonedMBStats,
336                                      StatGroup clonedEvictorStats){
337         cacheStats = clonedEvictorStats;
338         cacheStats.addAll(clonedMBStats);
339     }
340 
341     /**
342      * @hidden
343      * Internal use only.
344      */
setCacheStats(StatGroup clonedCacheStats)345     public void setCacheStats(StatGroup clonedCacheStats) {
346         cacheStats = clonedCacheStats;
347     }
348 
349     /**
350      * @hidden
351      * Internal use only.
352      */
setLockStats(StatGroup stats)353     public void setLockStats(StatGroup stats) {
354         lockStats = stats;
355     }
356 
357     /**
358      * @hidden
359      * Internal use only.
360      */
setEnvImplStats(StatGroup stats)361     public void setEnvImplStats(StatGroup stats) {
362         envImplStats = stats;
363     }
364 
365     /* INCompressor stats. */
366 
367     /**
368      * The number of BINs encountered by the INCompressor that had cursors
369      * referring to them when the compressor ran.
370      */
getCursorsBins()371     public long getCursorsBins() {
372         return incompStats.getLong(INCOMP_CURSORS_BINS);
373     }
374 
375     /**
376      * The time the Environment was created.
377      */
getEnvironmentCreationTime()378     public long getEnvironmentCreationTime() {
379         return envImplStats.getLong(ENVIMPL_CREATION_TIME);
380     }
381 
382     /**
383      * The number of BINs encountered by the INCompressor that had their
384      * database closed between the time they were put on the compressor queue
385      * and when the compressor ran.
386      */
getDbClosedBins()387     public long getDbClosedBins() {
388         return incompStats.getLong(INCOMP_DBCLOSED_BINS);
389     }
390 
391     /**
392      * The number of entries in the INCompressor queue when the getStats()
393      * call was made.
394      */
getInCompQueueSize()395     public long getInCompQueueSize() {
396         return incompStats.getLong(INCOMP_QUEUE_SIZE);
397     }
398 
399     /**
400      * The number of BINs encountered by the INCompressor that were not
401      * actually empty when the compressor ran.
402      */
getNonEmptyBins()403     public long getNonEmptyBins() {
404         return incompStats.getLong(INCOMP_NON_EMPTY_BINS);
405     }
406 
407     /**
408      * The number of BINs that were successfully processed by the IN
409      * Compressor.
410      */
getProcessedBins()411     public long getProcessedBins() {
412         return incompStats.getLong(INCOMP_PROCESSED_BINS);
413     }
414 
415     /**
416      * The number of BINs encountered by the INCompressor that were split
417      * between the time they were put on the compressor queue and when the
418      * compressor ran.
419      */
getSplitBins()420     public long getSplitBins() {
421         return incompStats.getLong(INCOMP_SPLIT_BINS);
422     }
423 
424     /* Checkpointer stats. */
425 
426     /**
427      * The Id of the last checkpoint.
428      */
getLastCheckpointId()429     public long getLastCheckpointId() {
430         return ckptStats.getLong(CKPT_LAST_CKPTID);
431     }
432 
433     /**
434      * The total number of checkpoints run so far.
435      */
getNCheckpoints()436     public long getNCheckpoints() {
437         return ckptStats.getLong(CKPT_CHECKPOINTS);
438     }
439 
440     /**
441      * The accumulated number of full INs flushed to the log.
442      */
getNFullINFlush()443     public long getNFullINFlush() {
444         return ckptStats.getLong(CKPT_FULL_IN_FLUSH);
445     }
446 
447     /**
448      * The accumulated number of full BINs flushed to the log.
449      */
getNFullBINFlush()450     public long getNFullBINFlush() {
451         return ckptStats.getLong(CKPT_FULL_BIN_FLUSH);
452     }
453 
454     /**
455      * The accumulated number of Delta INs flushed to the log.
456      */
getNDeltaINFlush()457     public long getNDeltaINFlush() {
458         return ckptStats.getLong(CKPT_DELTA_IN_FLUSH);
459     }
460 
461     /**
462      * Byte length from last checkpoint start to the previous checkpoint start.
463      */
getLastCheckpointInterval()464     public long getLastCheckpointInterval() {
465         return ckptStats.getLong(CKPT_LAST_CKPT_INTERVAL);
466     }
467 
468     /**
469      * The location in the log of the last checkpoint start.
470      */
getLastCheckpointStart()471     public long getLastCheckpointStart() {
472         return ckptStats.getLong(CKPT_LAST_CKPT_START);
473     }
474 
475     /**
476      * The location in the log of the last checkpoint end.
477      */
getLastCheckpointEnd()478     public long getLastCheckpointEnd() {
479         return ckptStats.getLong(CKPT_LAST_CKPT_END);
480     }
481 
482     /* Cleaner stats. */
483 
484     /**
485      * The number of files to be cleaned to reach the target utilization.
486      */
getCleanerBacklog()487     public int getCleanerBacklog() {
488         return cleanerStats.getInt(CLEANER_BACKLOG);
489     }
490 
491     /**
492      * The number of log files that are ready to be deleted.  A file that is
493      * ready to be deleted may not yet have been deleted for any of the
494      * following reasons:
495      * <ul>
496      * <li>A checkpoint has not yet completed.  Files are deleted only at the
497      * end of each checkpoint.</li>
498      * <li>A read-only process is running, which prevents file deletion.</li>
499      * <li>A file is protected from deletion by an in-progress {@link
500      * com.sleepycat.je.util.DbBackup}.</li>
501      * <li>A file is protected from deletion because it is needed for
502      * replication (High Availability applications only).</li>
503      * </ul>
504      */
getFileDeletionBacklog()505     public int getFileDeletionBacklog() {
506         return cleanerStats.getInt(CLEANER_FILE_DELETION_BACKLOG);
507     }
508 
509     /**
510      * The last known log utilization as a percentage.  This statistic provides
511      * a cheap way of checking the log utilization without having to run the
512      * DbSpace utility.
513      * <p>
514      * The log utilization is the percentage of the total log size (all .jdb
515      * files) that is utilized or active.  The remaining portion of the log
516      * is obsolete.  The log cleaner is responsible for keeping the log
517      * utilization below the configured threshold,
518      * {@link EnvironmentConfig#CLEANER_MIN_UTILIZATION}.
519      * <p>
520      * This statistic is computed every time the log cleaner examines the
521      * utilization of the log, in order to determine whether cleaning is
522      * needed.  The frequency can be configured using
523      * {@link EnvironmentConfig#CLEANER_BYTES_INTERVAL}.
524      * <p>
525      * Note that the size of the utilized data in the log is always greater
526      * than the amount of user data (total size of keys and data).  The active
527      * Btree internal nodes and other metadata are also included.
528      *
529      * @return the last known utilization, or -1 if the utilization has not
530      * been calculated for this environment since it was last opened.
531      */
getLastKnownUtilization()532     public int getLastKnownUtilization() {
533         return cleanerStats.getInt(CLEANER_LAST_KNOWN_UTILIZATION);
534     }
535 
536     /**
537      * The factor used to correct average LN size, for LNs whose obsolete size
538      * is unknown.  Used to calculate corrected utilization.
539      *
540      * <p>{@link Float#NaN} is returned when a correction factor is not
541      * applicable because all record sizes have not yet been counted or enough
542      * data has not yet been collected to determine a representative
543      * average.</p>
544      *
545      * <p>When deletions and updates are performed and the record (LN) is not
546      * in cache, the size of the obsolete record in the log is unknown and
547      * estimated log utilization may be incorrect.  The correction factor is
548      * determined when true utilization is calculated as log files are
549      * cleaned.</p>
550      */
getLNSizeCorrectionFactor()551     public float getLNSizeCorrectionFactor() {
552         return cleanerStats.getFloat(CLEANER_LN_SIZE_CORRECTION_FACTOR);
553     }
554 
555     /**
556      * @deprecated in JE 5.0.56, use {@link #getCorrectedAvgLNSize} instead.
557      */
getCorrectedAvgLNSize()558     public float getCorrectedAvgLNSize() {
559         return Float.NaN;
560     }
561 
562     /**
563      * @deprecated in JE 5.0.56, use {@link #getCorrectedAvgLNSize} instead.
564      */
getEstimatedAvgLNSize()565     public float getEstimatedAvgLNSize() {
566         return Float.NaN;
567     }
568 
569     /**
570      * Number of cleaner runs, including probe runs.
571      *
572      * @see #getNCleanerProbeRuns
573      */
getNCleanerRuns()574     public long getNCleanerRuns() {
575         return cleanerStats.getLong(CLEANER_RUNS);
576     }
577 
578     /**
579      * Number of cleaner runs for probing utilization.
580      *
581      * <p>When utilization may be incorrect (see {@link
582      * #getCorrectedAvgLNSize}) and no log cleaning occurs because the
583      * estimated utilization is higher than the configured utilization
584      * threshold, a cleaner run is made to probe utilization and determine the
585      * correction factor. This run is read-only and does not clean or delete
586      * the log file; it only calculates utilization.</p>
587      */
getNCleanerProbeRuns()588     public long getNCleanerProbeRuns() {
589         return cleanerStats.getLong(CLEANER_PROBE_RUNS);
590     }
591 
592     /**
593      * The number of cleaner file deletions this session.
594      */
getNCleanerDeletions()595     public long getNCleanerDeletions() {
596         return cleanerStats.getLong(CLEANER_DELETIONS);
597     }
598 
599     /**
600      * The number of LNs pending because they were locked and could not be
601      * migrated.
602      */
getPendingLNQueueSize()603     public int getPendingLNQueueSize() {
604         return cleanerStats.getInt(CLEANER_PENDING_LN_QUEUE_SIZE);
605     }
606 
607     /**
608      * The accumulated number of log entries read by the cleaner.
609      */
getNCleanerEntriesRead()610     public long getNCleanerEntriesRead() {
611         return cleanerStats.getLong(CLEANER_ENTRIES_READ);
612     }
613 
614     /**
615      * The accumulated number of INs obsolete.
616      */
getNINsObsolete()617     public long getNINsObsolete() {
618         return cleanerStats.getLong(CLEANER_INS_OBSOLETE);
619     }
620 
621     /**
622      * The accumulated number of INs cleaned.
623      */
getNINsCleaned()624     public long getNINsCleaned() {
625         return cleanerStats.getLong(CLEANER_INS_CLEANED);
626     }
627 
628     /**
629      * The accumulated number of INs that were not found in the tree anymore
630      * (deleted).
631      */
getNINsDead()632     public long getNINsDead() {
633         return cleanerStats.getLong(CLEANER_INS_DEAD);
634     }
635 
636     /**
637      * The accumulated number of INs migrated.
638      */
getNINsMigrated()639     public long getNINsMigrated() {
640         return cleanerStats.getLong(CLEANER_INS_MIGRATED);
641     }
642 
643     /**
644      * The accumulated number of BIN-deltas obsolete.
645      */
getNBINDeltasObsolete()646     public long getNBINDeltasObsolete() {
647         return cleanerStats.getLong(CLEANER_BIN_DELTAS_OBSOLETE);
648     }
649 
650     /**
651      * The accumulated number of BIN-deltas cleaned.
652      */
getNBINDeltasCleaned()653     public long getNBINDeltasCleaned() {
654         return cleanerStats.getLong(CLEANER_BIN_DELTAS_CLEANED);
655     }
656 
657     /**
658      * The accumulated number of BIN-deltas that were not found in the tree
659      * anymore (deleted).
660      */
getNBINDeltasDead()661     public long getNBINDeltasDead() {
662         return cleanerStats.getLong(CLEANER_BIN_DELTAS_DEAD);
663     }
664 
665     /**
666      * The accumulated number of BIN-deltas migrated.
667      */
getNBINDeltasMigrated()668     public long getNBINDeltasMigrated() {
669         return cleanerStats.getLong(CLEANER_BIN_DELTAS_MIGRATED);
670     }
671 
672     /**
673      * The accumulated number of LNs obsolete.
674      */
getNLNsObsolete()675     public long getNLNsObsolete() {
676         return cleanerStats.getLong(CLEANER_LNS_OBSOLETE);
677     }
678 
679     /**
680      * The accumulated number of LNs cleaned.
681      */
getNLNsCleaned()682     public long getNLNsCleaned() {
683         return cleanerStats.getLong(CLEANER_LNS_CLEANED);
684     }
685 
686     /**
687      * The accumulated number of LNs that were not found in the tree anymore
688      * (deleted).
689      */
getNLNsDead()690     public long getNLNsDead() {
691         return cleanerStats.getLong(CLEANER_LNS_DEAD);
692     }
693 
694     /**
695      * The accumulated number of LNs encountered that were locked.
696      */
getNLNsLocked()697     public long getNLNsLocked() {
698         return cleanerStats.getLong(CLEANER_LNS_LOCKED);
699     }
700 
701     /**
702      * The accumulated number of LNs encountered that were migrated forward in
703      * the log by the cleaner.
704      */
getNLNsMigrated()705     public long getNLNsMigrated() {
706         return cleanerStats.getLong(CLEANER_LNS_MIGRATED);
707     }
708 
709     /**
710      * The accumulated number of LNs in temporary DBs that were dirtied by the
711      * cleaner and subsequently logging during checkpoint/eviction.
712      */
getNLNsMarked()713     public long getNLNsMarked() {
714         return cleanerStats.getLong(CLEANER_LNS_MARKED);
715     }
716 
717     /**
718      * The accumulated number of LNs processed without a tree lookup.
719      */
getNLNQueueHits()720     public long getNLNQueueHits() {
721         return cleanerStats.getLong(CLEANER_LNQUEUE_HITS);
722     }
723 
724     /**
725      * The accumulated number of LNs processed because they were previously
726      * locked.
727      */
getNPendingLNsProcessed()728     public long getNPendingLNsProcessed() {
729         return cleanerStats.getLong(CLEANER_PENDING_LNS_PROCESSED);
730     }
731 
732     /**
733      * The accumulated number of LNs processed because they were previously
734      * marked for migration.
735      */
getNMarkedLNsProcessed()736     public long getNMarkedLNsProcessed() {
737         return cleanerStats.getLong(CLEANER_MARKED_LNS_PROCESSED);
738     }
739 
740     /**
741      * The accumulated number of LNs processed because they are soon to be
742      * cleaned.
743      */
getNToBeCleanedLNsProcessed()744     public long getNToBeCleanedLNsProcessed() {
745         return cleanerStats.getLong(CLEANER_TO_BE_CLEANED_LNS_PROCESSED);
746     }
747 
748     /**
749      * The accumulated number of LNs processed because they qualify for
750      * clustering.
751      */
getNClusterLNsProcessed()752     public long getNClusterLNsProcessed() {
753         return cleanerStats.getLong(CLEANER_CLUSTER_LNS_PROCESSED);
754     }
755 
756     /**
757      * The accumulated number of pending LNs that could not be locked for
758      * migration because of a long duration application lock.
759      */
getNPendingLNsLocked()760     public long getNPendingLNsLocked() {
761         return cleanerStats.getLong(CLEANER_PENDING_LNS_LOCKED);
762     }
763 
764     /**
765      * The number of times we tried to read a log entry larger than the read
766      * buffer size and couldn't grow the log buffer to accommodate the large
767      * object. This happens during scans of the log during activities like
768      * environment open or log cleaning. Implies that the read chunk size
769      * controlled by je.log.iteratorReadSize is too small.
770      */
getNRepeatIteratorReads()771     public long getNRepeatIteratorReads() {
772         return cleanerStats.getLong(CLEANER_REPEAT_ITERATOR_READS);
773     }
774 
775     /**
776      * An approximation of the current total log size in bytes.
777      */
getTotalLogSize()778     public long getTotalLogSize() {
779         return cleanerStats.getLong(CLEANER_TOTAL_LOG_SIZE);
780     }
781 
782     /* LogManager stats. */
783 
784     /**
785      * The total number of requests for database objects which were not in
786      * memory.
787      */
getNCacheMiss()788     public long getNCacheMiss() {
789         return logStats.getAtomicLong(LBFP_MISS);
790     }
791 
792     /**
793      * The location of the next entry to be written to the log.
794      *
795      * <p>Note that the log entries prior to this position may not yet have
796      * been flushed to disk.  Flushing can be forced using a Sync or
797      * WriteNoSync commit, or a checkpoint.</p>
798      */
getEndOfLog()799     public long getEndOfLog() {
800         return logStats.getLong(LOGMGR_END_OF_LOG);
801     }
802 
803     /**
804      * The number of fsyncs issued through the group commit manager. A subset
805      * of nLogFsyncs.
806      */
getNFSyncs()807     public long getNFSyncs() {
808         return logStats.getAtomicLong(FSYNCMGR_FSYNCS);
809     }
810 
811     /**
812      * The number of fsyncs requested through the group commit manager.
813      */
getNFSyncRequests()814     public long getNFSyncRequests() {
815         return logStats.getLong(FSYNCMGR_FSYNC_REQUESTS);
816     }
817 
818     /**
819      * The number of fsync requests submitted to the group commit manager which
820      * timed out.
821      */
getNFSyncTimeouts()822     public long getNFSyncTimeouts() {
823         return logStats.getLong(FSYNCMGR_TIMEOUTS);
824     }
825 
826     /**
827      * The total number of fsyncs of the JE log. This includes those fsyncs
828      * issued on behalf of transaction commits.
829      */
getNLogFSyncs()830     public long getNLogFSyncs() {
831         return logStats.getLong(FILEMGR_LOG_FSYNCS);
832     }
833 
834     /**
835      * The number of log buffers currently instantiated.
836      */
getNLogBuffers()837     public int getNLogBuffers() {
838         return logStats.getInt(LBFP_LOG_BUFFERS);
839     }
840 
841     /**
842      * The number of disk reads which required repositioning the disk head
843      * more than 1MB from the previous file position.  Reads in a different
844      * *.jdb log file then the last IO constitute a random read.
845      * <p>
846      * This number is approximate and may differ from the actual number of
847      * random disk reads depending on the type of disks and file system, disk
848      * geometry, and file system cache size.
849      */
getNRandomReads()850     public long getNRandomReads() {
851         return logStats.getLong(FILEMGR_RANDOM_READS);
852     }
853 
854     /**
855      * The number of bytes read which required repositioning the disk head
856      * more than 1MB from the previous file position.  Reads in a different
857      * *.jdb log file then the last IO constitute a random read.
858      * <p>
859      * This number is approximate vary depending on the type of disks and file
860      * system, disk geometry, and file system cache size.
861      */
getNRandomReadBytes()862     public long getNRandomReadBytes() {
863         return logStats.getLong(FILEMGR_RANDOM_READ_BYTES);
864     }
865 
866     /**
867      * The number of disk writes which required repositioning the disk head by
868      * more than 1MB from the previous file position.  Writes to a different
869      * *.jdb log file (i.e. a file "flip") then the last IO constitute a random
870      * write.
871      * <p>
872      * This number is approximate and may differ from the actual number of
873      * random disk writes depending on the type of disks and file system, disk
874      * geometry, and file system cache size.
875      */
getNRandomWrites()876     public long getNRandomWrites() {
877         return logStats.getLong(FILEMGR_RANDOM_WRITES);
878     }
879 
880     /**
881      * The number of bytes written which required repositioning the disk head
882      * more than 1MB from the previous file position.  Writes in a different
883      * *.jdb log file then the last IO constitute a random write.
884      * <p>
885      * This number is approximate vary depending on the type of disks and file
886      * system, disk geometry, and file system cache size.
887      */
getNRandomWriteBytes()888     public long getNRandomWriteBytes() {
889         return logStats.getLong(FILEMGR_RANDOM_WRITE_BYTES);
890     }
891 
892     /**
893      * The number of disk reads which did not require repositioning the disk
894      * head more than 1MB from the previous file position.  Reads in a
895      * different *.jdb log file then the last IO constitute a random read.
896      * <p>
897      * This number is approximate and may differ from the actual number of
898      * sequential disk reads depending on the type of disks and file system,
899      * disk geometry, and file system cache size.
900      */
getNSequentialReads()901     public long getNSequentialReads() {
902         return logStats.getLong(FILEMGR_SEQUENTIAL_READS);
903     }
904 
905     /**
906      * The number of bytes read which did not require repositioning the disk
907      * head more than 1MB from the previous file position.  Reads in a
908      * different *.jdb log file then the last IO constitute a random read.
909      * <p>
910      * This number is approximate vary depending on the type of disks and file
911      * system, disk geometry, and file system cache size.
912      */
getNSequentialReadBytes()913     public long getNSequentialReadBytes() {
914         return logStats.getLong(FILEMGR_SEQUENTIAL_READ_BYTES);
915     }
916 
917     /**
918      * The number of disk writes which did not require repositioning the disk
919      * head by more than 1MB from the previous file position.  Writes to a
920      * different *.jdb log file (i.e. a file "flip") then the last IO
921      * constitute a random write.
922      * <p>
923      * This number is approximate and may differ from the actual number of
924      * sequential disk writes depending on the type of disks and file system,
925      * disk geometry, and file system cache size.
926      */
getNSequentialWrites()927     public long getNSequentialWrites() {
928         return logStats.getLong(FILEMGR_SEQUENTIAL_WRITES);
929     }
930 
931     /**
932      * The number of bytes written which did not require repositioning the
933      * disk head more than 1MB from the previous file position.  Writes in a
934      * different *.jdb log file then the last IO constitute a random write.
935      * <p>
936      * This number is approximate vary depending on the type of disks and file
937      * system, disk geometry, and file system cache size.
938      */
getNSequentialWriteBytes()939     public long getNSequentialWriteBytes() {
940         return logStats.getLong(FILEMGR_SEQUENTIAL_WRITE_BYTES);
941     }
942 
943     /**
944      * The number of bytes read to fulfill file read operations by reading out
945      * of the pending write queue.
946      */
getNBytesReadFromWriteQueue()947     public long getNBytesReadFromWriteQueue() {
948         return logStats.getLong(FILEMGR_BYTES_READ_FROM_WRITEQUEUE);
949     }
950 
951     /**
952      * The number of bytes written from the pending write queue.
953      */
getNBytesWrittenFromWriteQueue()954     public long getNBytesWrittenFromWriteQueue() {
955         return logStats.getLong(FILEMGR_BYTES_WRITTEN_FROM_WRITEQUEUE);
956     }
957 
958     /**
959      * The number of file read operations which were fulfilled by reading out
960      * of the pending write queue.
961      */
getNReadsFromWriteQueue()962     public long getNReadsFromWriteQueue() {
963         return logStats.getLong(FILEMGR_READS_FROM_WRITEQUEUE);
964     }
965 
966     /**
967      * The number of file writes operations executed from the pending write
968      * queue.
969      */
getNWritesFromWriteQueue()970     public long getNWritesFromWriteQueue() {
971         return logStats.getLong(FILEMGR_WRITES_FROM_WRITEQUEUE);
972     }
973 
974     /**
975      * The number of writes operations which would overflow the Write Queue.
976      */
getNWriteQueueOverflow()977     public long getNWriteQueueOverflow() {
978         return logStats.getLong(FILEMGR_WRITEQUEUE_OVERFLOW);
979     }
980 
981     /**
982      * The number of writes operations which would overflow the Write Queue
983      * and could not be queued.
984      */
getNWriteQueueOverflowFailures()985     public long getNWriteQueueOverflowFailures() {
986         return logStats.getLong(FILEMGR_WRITEQUEUE_OVERFLOW_FAILURES);
987     }
988 
989     /**
990      * The total memory currently consumed by log buffers, in bytes.  If this
991      * environment uses the shared cache, this method returns only the amount
992      * used by this environment.
993      */
getBufferBytes()994     public long getBufferBytes() {
995         return logStats.getLong(LBFP_BUFFER_BYTES);
996     }
997 
998     /**
999      * The number of requests for database objects not contained within the
1000      * in memory data structures.
1001      */
getNNotResident()1002     public long getNNotResident() {
1003         return logStats.getAtomicLong(LBFP_NOT_RESIDENT);
1004     }
1005 
1006     /**
1007      * The number of reads which had to be repeated when faulting in an object
1008      * from disk because the read chunk size controlled by je.log.faultReadSize
1009      * is too small.
1010      */
getNRepeatFaultReads()1011     public long getNRepeatFaultReads() {
1012         return logStats.getLong(LOGMGR_REPEAT_FAULT_READS);
1013     }
1014 
1015     /**
1016      * The number of writes which had to be completed using the temporary
1017      * marshalling buffer because the fixed size log buffers specified by
1018      * je.log.totalBufferBytes and je.log.numBuffers were not large enough.
1019      */
getNTempBufferWrites()1020     public long getNTempBufferWrites() {
1021         return logStats.getLong(LOGMGR_TEMP_BUFFER_WRITES);
1022     }
1023 
1024     /**
1025      * The number of times a log file has been opened.
1026      */
getNFileOpens()1027     public int getNFileOpens() {
1028         return logStats.getInt(FILEMGR_FILE_OPENS);
1029     }
1030 
1031     /**
1032      * The number of files currently open in the file cache.
1033      */
getNOpenFiles()1034     public int getNOpenFiles() {
1035         return logStats.getInt(FILEMGR_OPEN_FILES);
1036     }
1037 
1038     /* Return Evictor stats. */
1039 
1040     /**
1041      * @deprecated The method returns 0 always.
1042      */
getRequiredEvictBytes()1043     public long getRequiredEvictBytes() {
1044         return 0;
1045     }
1046 
1047     /**
1048      * @deprecated This statistic has no meaning after the implementation
1049      * of the new evictor in JE 6.0. The method returns 0 always.
1050      */
getNNodesScanned()1051     public long getNNodesScanned() {
1052         return 0;
1053     }
1054 
1055     /**
1056      * Number of eviction runs, an indicator of the eviction activity level.
1057      *
1058      * @deprecated Use getNEvictionRuns() instead.
1059      */
getNEvictPasses()1060     public long getNEvictPasses() {
1061         return cacheStats.getLong(EVICTOR_EVICTION_RUNS);
1062     }
1063 
1064     /**
1065      * Number of nodes selected as eviction targets. An eviction target may
1066      * actually be evicted, or skipped, or put back to the LRU, potentially
1067      * after partial eviction (stripping) or BIN-delta mutation is done on it.
1068      *
1069      * @deprecated Use getNNodesTargeted() instead.
1070      */
getNNodesSelected()1071     public long getNNodesSelected() {
1072         return cacheStats.getLong(EVICTOR_NODES_TARGETED);
1073     }
1074 
1075     /**
1076      * Number of nodes evicted.
1077      *
1078      * @deprecated Use getNNodesEvicted() instead.
1079      */
getNNodesExplicitlyEvicted()1080     public long getNNodesExplicitlyEvicted() {
1081         return cacheStats.getLong(EVICTOR_NODES_EVICTED);
1082     }
1083 
1084     /**
1085      * Number of BINs whose child LNs were evicted (stripped).
1086      *
1087      * @deprecated Use getNNodesStripped() instead.
1088      */
getNBINsStripped()1089     public long getNBINsStripped() {
1090         return cacheStats.getLong(EVICTOR_NODES_STRIPPED);
1091     }
1092 
1093     /**
1094      * Number of BINs mutated to BIN-deltas by eviction.
1095      *
1096      * @deprecated Use getNNodesMutated() instead.
1097      */
getNBINsMutated()1098     public long getNBINsMutated() {
1099         return cacheStats.getLong(EVICTOR_NODES_MUTATED);
1100     }
1101 
1102     /**
1103      * Number of eviction runs, an indicator of the eviction activity level.
1104      */
getNEvictionRuns()1105     public long getNEvictionRuns() {
1106         return cacheStats.getLong(EVICTOR_EVICTION_RUNS);
1107     }
1108 
1109     /**
1110      * Number of nodes selected as eviction targets. An eviction target may
1111      * actually be evicted, or skipped, or put back to the LRU, potentially
1112      * after partial eviction (stripping) or BIN-delta mutation is done on it.
1113      */
getNNodesTargeted()1114     public long getNNodesTargeted() {
1115         return cacheStats.getLong(EVICTOR_NODES_TARGETED);
1116     }
1117 
1118     /**
1119      * Number of nodes evicted.
1120      */
getNNodesEvicted()1121     public long getNNodesEvicted() {
1122         return cacheStats.getLong(EVICTOR_NODES_EVICTED);
1123     }
1124 
1125     /**
1126      * Number of database root nodes evicted.
1127      */
getNRootNodesEvicted()1128     public long getNRootNodesEvicted() {
1129         return cacheStats.getLong(EVICTOR_ROOT_NODES_EVICTED);
1130     }
1131 
1132     /**
1133      * Number of LNs evicted as a result of BIN stripping
1134      */
getNLNsEvicted()1135     public long getNLNsEvicted() {
1136         return cacheStats.getLong(EVICTOR_LNS_EVICTED);
1137     }
1138 
1139     /**
1140      * Number of BINs whose child LNs were evicted (stripped).
1141      */
getNNodesStripped()1142     public long getNNodesStripped() {
1143         return cacheStats.getLong(EVICTOR_NODES_STRIPPED);
1144     }
1145 
1146     /**
1147      * Number of BINs mutated to BIN-deltas by eviction.
1148      */
getNNodesMutated()1149     public long getNNodesMutated() {
1150         return cacheStats.getLong(EVICTOR_NODES_MUTATED);
1151     }
1152 
1153     /**
1154      * Number of nodes back into the LRU without any action taken on them.
1155      * For example, a target BIN will immediatelly be put back if it is
1156      * pinned, or is marked "hot", or none of it LNs are evictable."
1157      */
getNNodesPutBack()1158     public long getNNodesPutBack() {
1159         return cacheStats.getLong(EVICTOR_NODES_PUT_BACK);
1160     }
1161 
1162     /**
1163      * Number of nodes moved from the "mixed" to the dirty LRU.
1164      */
getNNodesMovedToDirtyLRU()1165     public long getNNodesMovedToDirtyLRU() {
1166         return cacheStats.getLong(EVICTOR_NODES_MOVED_TO_DIRTY_LRU);
1167     }
1168 
1169     /**
1170      * Number of nodes removed from the LRU without any action taken on them.
1171      * For example, a node will be skipped if it has already been evicted by
1172      * another thread.
1173      */
getNNodesSkipped()1174     public long getNNodesSkipped() {
1175         return cacheStats.getLong(EVICTOR_NODES_SKIPPED);
1176     }
1177 
1178     /**
1179      * Number of eviction tasks that were submitted to the background evictor
1180      * pool, but were refused because all eviction threads were busy. This may
1181      * indicate the need to change the size of the evictor pool through the
1182      * je.evictor.*Threads properties.
1183      */
getNThreadUnavailable()1184     public long getNThreadUnavailable() {
1185         return cacheStats.getAtomicLong(THREAD_UNAVAILABLE);
1186     }
1187 
1188     /**
1189      * The number of environments using the shared cache.  This method says
1190      * nothing about whether this environment is using the shared cache or not.
1191      */
getNSharedCacheEnvironments()1192     public int getNSharedCacheEnvironments() {
1193         return cacheStats.getInt(EVICTOR_SHARED_CACHE_ENVS);
1194     }
1195 
1196     /**
1197      * Number of LNs (data records) requested by btree operations. Can be used
1198      * to gauge cache hit/miss ratios.
1199      */
getNLNsFetch()1200     public long getNLNsFetch() {
1201         return cacheStats.getAtomicLong(LN_FETCH);
1202     }
1203 
1204     /**
1205      * Number of upper INs (non bottom internal nodes) requested by btree
1206      * operations. Can be used to gauge cache hit/miss ratios.
1207      */
getNUpperINsFetch()1208     public long getNUpperINsFetch() {
1209         return cacheStats.getAtomicLong(UPPER_IN_FETCH);
1210     }
1211 
1212     /**
1213      * Number of BINs (bottom internal nodes) requested by btree
1214      * operations. Can be used to gauge cache hit/miss ratios.
1215      */
getNBINsFetch()1216     public long getNBINsFetch() {
1217         return cacheStats.getAtomicLong(BIN_FETCH);
1218     }
1219 
1220     /**
1221      * Number of LNs (data records) requested by btree operations that were not
1222      * in cache. Can be used to gauge cache hit/miss ratios.
1223      */
getNLNsFetchMiss()1224     public long getNLNsFetchMiss() {
1225         return cacheStats.getAtomicLong(LN_FETCH_MISS);
1226     }
1227 
1228     /**
1229      * Number of upper INs (non-bottom internal nodes) requested by btree
1230      * operations that were not in cache. Can be used to gauge cache hit/miss
1231      * ratios.
1232      */
getNUpperINsFetchMiss()1233     public long getNUpperINsFetchMiss() {
1234         return cacheStats.getAtomicLong(UPPER_IN_FETCH_MISS);
1235     }
1236 
1237     /**
1238      * Number of full BINs (bottom internal nodes) and BIN deltas fetched to
1239      * satisfy btree operations. Can be used to gauge cache hit/miss ratios.
1240      */
getNBINsFetchMiss()1241     public long getNBINsFetchMiss() {
1242         return cacheStats.getAtomicLong(BIN_FETCH_MISS);
1243     }
1244 
1245     /**
1246      * Number of BIN-deltas (partial BINS) fetched to satisfy btree
1247      * operations. Can be used to gauge cache hit/miss ratios.
1248      */
getNBINDeltasFetchMiss()1249     public long getNBINDeltasFetchMiss() {
1250         return cacheStats.getAtomicLong(BIN_DELTA_FETCH_MISS);
1251     }
1252 
1253     /**
1254      * The ratio between the number of BINs (full or deltas) fetched to
1255      * satisfy btree operations and the number of BINs requested by btree
1256      * operations.
1257      */
getNBINsFetchMissRatio()1258     public float getNBINsFetchMissRatio() {
1259         return cacheStats.getFloat(BIN_FETCH_MISS_RATIO);
1260     }
1261 
1262     /**
1263      * Number of times a BIN-delta had to be mutated to a full BIN (and as a
1264      * result a full BIN had to be read in from the log).
1265      */
getNFullBINsMiss()1266     public long getNFullBINsMiss() {
1267         return cacheStats.getAtomicLong(FULL_BIN_MISS);
1268     }
1269 
1270     /**
1271      * The number of operations performed blindly in BIN deltas
1272      */
getNBINDeltaBlindOps()1273     public long getNBINDeltaBlindOps() {
1274         return cacheStats.getAtomicLong(BIN_DELTA_BLIND_OPS);
1275     }
1276 
1277     /**
1278      * Number of INs (internal nodes) in cache. The cache holds INs and BINS,
1279      * so this indicates the proportion used by each type of node. When used on
1280      * shared environment caches, will only be visible via
1281      * StatConfig.setFast(false).
1282      */
getNCachedUpperINs()1283     public long getNCachedUpperINs() {
1284         return cacheStats.getLong(CACHED_UPPER_INS);
1285     }
1286 
1287     /**
1288      * Number of BINs (bottom internal nodes) in cache. The cache holds INs and
1289      * BINS, so this indicates the proportion used by each type of node. When
1290      * used on shared environment caches, will only be visible via
1291      * StatConfig.setFast(false).
1292      */
getNCachedBINs()1293     public long getNCachedBINs() {
1294         return cacheStats.getLong(CACHED_BINS);
1295     }
1296 
1297     /**
1298      * Number of BIN-deltas (partial BINs) in cache.  This is a subset of the
1299      * nCachedBINs value.
1300      */
getNCachedBINDeltas()1301     public long getNCachedBINDeltas() {
1302         return cacheStats.getLong(CACHED_BIN_DELTAS);
1303     }
1304 
1305     /**
1306      * Number of INs that use a compact sparse array representation to point
1307      * to child nodes in the cache. This helps provide some insight into what
1308      * is resident in the cache.
1309      */
getNINSparseTarget()1310     public long getNINSparseTarget() {
1311         return cacheStats.getLong(CACHED_IN_SPARSE_TARGET);
1312     }
1313 
1314     /**
1315      * Number of INs that use a compact representation when none of its child
1316      * nodes are in the cache. This helps provide some insight into what
1317      * is resident in the cache.
1318      */
getNINNoTarget()1319     public long getNINNoTarget() {
1320         return cacheStats.getLong(CACHED_IN_NO_TARGET);
1321     }
1322 
1323     /**
1324      * Number of INs that use a compact key representation to minimize the key
1325      * object representation overhead. This helps provide some insight into
1326      * what is resident in the cache. In addition, if this number is low, and
1327      * the application may want to try using Database.setKeyPrefix to enable
1328      * key prefixing, and to see if that lets JE use the compact key
1329      * representation more often.
1330      */
getNINCompactKeyIN()1331     public long getNINCompactKeyIN() {
1332         return cacheStats.getLong(CACHED_IN_COMPACT_KEY);
1333     }
1334 
1335     /**
1336      * @deprecated This statistic has been removed. The method returns 0
1337      * always.
1338      */
getNBINsEvictedEvictorThread()1339     public long getNBINsEvictedEvictorThread() {
1340         return 0;
1341     }
1342 
1343     /**
1344      * @deprecated This statistic has been removed. The method returns 0
1345      * always.
1346      */
getNBINsEvictedManual()1347     public long getNBINsEvictedManual() {
1348         return 0;
1349     }
1350 
1351     /**
1352      * @deprecated This statistic has been removed. The method returns 0
1353      * always.
1354      */
getNBINsEvictedCritical()1355     public long getNBINsEvictedCritical() {
1356         return 0;
1357     }
1358 
1359     /**
1360      * @deprecated This statistic has been removed. The method returns 0
1361      * always.
1362      */
getNBINsEvictedCacheMode()1363     public long getNBINsEvictedCacheMode() {
1364         return 0;
1365     }
1366 
1367     /**
1368      * @deprecated This statistic has been removed. The method returns 0
1369      * always.
1370      */
getNBINsEvictedDaemon()1371     public long getNBINsEvictedDaemon() {
1372         return 0;
1373     }
1374 
1375     /**
1376      * @deprecated This statistic has been removed. The method returns 0
1377      * always.
1378      */
getNUpperINsEvictedEvictorThread()1379     public long getNUpperINsEvictedEvictorThread() {
1380         return 0;
1381     }
1382 
1383     /**
1384      * @deprecated This statistic has been removed. The method returns 0
1385      * always.
1386      */
getNUpperINsEvictedManual()1387     public long getNUpperINsEvictedManual() {
1388         return 0;
1389     }
1390 
1391     /**
1392      * @deprecated This statistic has been removed. The method returns 0
1393      * always.
1394      */
getNUpperINsEvictedCritical()1395     public long getNUpperINsEvictedCritical() {
1396         return 0;
1397     }
1398 
1399     /**
1400      * @deprecated This statistic has been removed. The method returns 0
1401      * always.
1402      */
getNUpperINsEvictedCacheMode()1403     public long getNUpperINsEvictedCacheMode() {
1404         return 0;
1405     }
1406 
1407     /**
1408      * @deprecated This statistic has been removed. The method returns 0
1409      * always.
1410      */
getNUpperINsEvictedDaemon()1411     public long getNUpperINsEvictedDaemon() {
1412         return 0;
1413     }
1414 
1415     /**
1416      * @deprecated This statistic has been removed. The method returns 0
1417      * always.
1418      */
getNBatchesEvictorThread()1419     public long getNBatchesEvictorThread() {
1420         return 0;
1421     }
1422 
1423     /**
1424      * @deprecated This statistic has been removed. The method returns 0
1425      * always.
1426      */
getNBatchesManual()1427     public long getNBatchesManual() {
1428         return 0;
1429     }
1430 
1431     /**
1432      * @deprecated This statistic has been removed. The method returns 0
1433      * always.
1434      */
getNBatchesCacheMode()1435     public long getNBatchesCacheMode() {
1436         return 0;
1437     }
1438 
1439     /**
1440      * @deprecated This statistic has been removed. The method returns 0
1441      * always.
1442      */
getNBatchesCritical()1443     public long getNBatchesCritical() {
1444         return 0;
1445     }
1446 
1447     /**
1448      * @deprecated This statistic has been removed. The method returns 0
1449      * always.
1450      */
getNBatchesDaemon()1451     public long getNBatchesDaemon() {
1452         return 0;
1453     }
1454 
1455     /**
1456      * Number of bytes evicted by evictor pool threads. It serves as an
1457      * indicator of which part of the system is doing eviction work.
1458      */
getNBytesEvictedEvictorThread()1459     public long getNBytesEvictedEvictorThread() {
1460         return cacheStats.getLong(
1461             EvictionSource.EVICTORTHREAD.getNumBytesEvictedStatDef());
1462     }
1463 
1464     /**
1465      * Number of bytes evicted by the {@link Environment#evictMemory} method,
1466      * which is called during Environment startup, or by application code. It
1467      * serves as an indicator of which part of the system is doing eviction
1468      * work.
1469      */
getNBytesEvictedManual()1470     public long getNBytesEvictedManual() {
1471         return cacheStats.getLong(
1472             EvictionSource.MANUAL.getNumBytesEvictedStatDef());
1473     }
1474 
1475     /**
1476      * Number of bytes evicted in the course of executing operations that
1477      * use an explicitly set {@link CacheMode}. It serves as an
1478      * indicator of which part of the system is doing eviction work.
1479      */
getNBytesEvictedCacheMode()1480     public long getNBytesEvictedCacheMode() {
1481         return cacheStats.getLong(
1482             EvictionSource.CACHEMODE.getNumBytesEvictedStatDef());
1483     }
1484 
1485     /**
1486      * Number of bytes evicted in the course of executing operations that
1487      * will cause the cache to go over budget. It serves as an indicator of
1488      * which part of the system is doing eviction work.
1489      */
getNBytesEvictedCritical()1490     public long getNBytesEvictedCritical() {
1491         return cacheStats.getLong(
1492             EvictionSource.CRITICAL.getNumBytesEvictedStatDef());
1493     }
1494 
1495     /**
1496      * Number of bytes evicted by JE deamon threads. It serves as an
1497      * indicator of which part of the system is doing eviction work.
1498      */
getNBytesEvictedDeamon()1499     public long getNBytesEvictedDeamon() {
1500         return cacheStats.getLong(
1501             EvictionSource.DAEMON.getNumBytesEvictedStatDef());
1502     }
1503 
1504     /**
1505      * @deprecated This statistic has been removed. The method returns 0
1506      * always.
1507      */
getAvgBatchEvictorThread()1508     public long getAvgBatchEvictorThread() {
1509         return 0;
1510     }
1511 
1512     /**
1513      * @deprecated This statistic has been removed. The method returns 0
1514      * always.
1515      */
getAvgBatchManual()1516     public long getAvgBatchManual() {
1517         return 0;
1518     }
1519 
1520     /**
1521      * @deprecated This statistic has been removed. The method returns 0
1522      * always.
1523      */
getAvgBatchCacheMode()1524     public long getAvgBatchCacheMode() {
1525         return 0;
1526     }
1527 
1528     /**
1529      * @deprecated This statistic has been removed. The method returns 0
1530      * always.
1531      */
getAvgBatchCritical()1532     public long getAvgBatchCritical() {
1533         return 0;
1534     }
1535 
1536     /**
1537      * @deprecated This statistic has been removed. The method returns 0
1538      * always.
1539      */
getAvgBatchDaemon()1540     public long getAvgBatchDaemon() {
1541         return 0;
1542     }
1543 
1544     /* MemoryBudget stats. */
1545 
1546     /**
1547      * The total amount of the shared JE cache in use, in bytes.  If this
1548      * environment uses the shared cache, this method returns the total amount
1549      * used by all environments that are sharing the cache.  If this
1550      * environment does not use the shared cache, this method returns zero.
1551      *
1552      * <p>To get the configured maximum cache size, see {@link
1553      * EnvironmentMutableConfig#getCacheSize}.</p>
1554      */
getSharedCacheTotalBytes()1555     public long getSharedCacheTotalBytes() {
1556         return cacheStats.getLong(MB_SHARED_CACHE_TOTAL_BYTES);
1557     }
1558 
1559     /**
1560      * The total amount of JE cache in use, in bytes.  If this environment uses
1561      * the shared cache, this method returns only the amount used by this
1562      * environment.
1563      *
1564      * <p>This method returns the sum of {@link #getDataBytes}, {@link
1565      * #getAdminBytes}, {@link #getLockBytes} and {@link #getBufferBytes}.</p>
1566      *
1567      * <p>To get the configured maximum cache size, see {@link
1568      * EnvironmentMutableConfig#getCacheSize}.</p>
1569      */
getCacheTotalBytes()1570     public long getCacheTotalBytes() {
1571         return cacheStats.getLong(MB_TOTAL_BYTES);
1572     }
1573 
1574     /**
1575      * The amount of JE cache used for holding data, keys and internal Btree
1576      * nodes, in bytes.  If this environment uses the shared cache, this method
1577      * returns only the amount used by this environment.
1578      *
1579      * <p>The value returned by this method includes the amount returned by
1580      * {@link #getDataAdminBytes}.</p>
1581      */
getDataBytes()1582     public long getDataBytes() {
1583         return cacheStats.getLong(MB_DATA_BYTES);
1584     }
1585 
1586     /**
1587      * The portion of data bytes ({@link #getDataBytes}) in the cache that are
1588      * allocated for per-database cleaner utilization metadata.
1589      */
getDataAdminBytes()1590     public long getDataAdminBytes() {
1591         return cacheStats.getLong(MB_DATA_ADMIN_BYTES);
1592     }
1593 
1594     /**
1595      * The number of bytes of JE cache used for log cleaning metadata and other
1596      * administrative structures.  If this environment uses the shared cache,
1597      * this method returns only the amount used by this environment.
1598      */
getAdminBytes()1599     public long getAdminBytes() {
1600         return cacheStats.getLong(MB_ADMIN_BYTES);
1601     }
1602 
1603     /**
1604      * The number of bytes of JE cache used for holding locks and transactions.
1605      * If this environment uses the shared cache, this method returns only the
1606      * amount used by this environment.
1607      */
getLockBytes()1608     public long getLockBytes() {
1609         return cacheStats.getLong(MB_LOCK_BYTES);
1610     }
1611 
1612     /**
1613      * The amount of JE cache used for all items except for the log buffers, in
1614      * bytes.  If this environment uses the shared cache, this method returns
1615      * only the amount used by this environment.
1616      *
1617      * @deprecated Please use {@link #getDataBytes} to get the amount of cache
1618      * used for data and use {@link #getAdminBytes}, {@link #getLockBytes} and
1619      * {@link #getBufferBytes} to get other components of the total cache usage
1620      * ({@link #getCacheTotalBytes}).
1621      */
getCacheDataBytes()1622     public long getCacheDataBytes() {
1623         return getCacheTotalBytes() - getBufferBytes();
1624     }
1625 
1626     /* EnvironmentImpl stats. */
1627 
1628     /**
1629      * Returns the number of latch upgrades (relatches) required while
1630      * operating on this Environment.  Latch upgrades are required when an
1631      * operation assumes that a shared (read) latch will be sufficient but
1632      * later determines that an exclusive (write) latch will actually be
1633      * required.
1634      *
1635      * @return number of latch upgrades (relatches) required.
1636      */
getRelatchesRequired()1637     public long getRelatchesRequired() {
1638         return envImplStats.getLong(ENVIMPL_RELATCHES_REQUIRED);
1639     }
1640 
1641     /* TxnManager stats. */
1642 
1643     /**
1644      * Total lock owners in lock table.  Only provided when {@link
1645      * com.sleepycat.je.Environment#getStats Environment.getStats} is
1646      * called in "slow" mode.
1647      */
getNOwners()1648     public int getNOwners() {
1649         return lockStats.getInt(LOCK_OWNERS);
1650     }
1651 
1652     /**
1653      * Total read locks currently held.  Only provided when {@link
1654      * com.sleepycat.je.Environment#getStats Environment.getStats} is
1655      * called in "slow" mode.
1656      */
getNReadLocks()1657     public int getNReadLocks() {
1658         return lockStats.getInt(LOCK_READ_LOCKS);
1659     }
1660 
1661     /**
1662      * Total locks currently in lock table.  Only provided when {@link
1663      * com.sleepycat.je.Environment#getStats Environment.getStats} is
1664      * called in "slow" mode.
1665      */
getNTotalLocks()1666     public int getNTotalLocks() {
1667         return lockStats.getInt(LOCK_TOTAL);
1668     }
1669 
1670     /**
1671      * Total transactions waiting for locks.  Only provided when {@link
1672      * com.sleepycat.je.Environment#getStats Environment.getStats} is
1673      * called in "slow" mode.
1674      */
getNWaiters()1675     public int getNWaiters() {
1676         return lockStats.getInt(LOCK_WAITERS);
1677     }
1678 
1679     /**
1680      * Total write locks currently held.  Only provided when {@link
1681      * com.sleepycat.je.Environment#getStats Environment.getStats} is
1682      * called in "slow" mode.
1683      */
getNWriteLocks()1684     public int getNWriteLocks() {
1685         return lockStats.getInt(LOCK_WRITE_LOCKS);
1686     }
1687 
1688     /**
1689      * Total number of lock requests to date.
1690      */
getNRequests()1691     public long getNRequests() {
1692         return lockStats.getLong(LOCK_REQUESTS);
1693     }
1694 
1695     /**
1696      * Total number of lock waits to date.
1697      */
getNWaits()1698     public long getNWaits() {
1699         return lockStats.getLong(LOCK_WAITS);
1700     }
1701 
1702     /**
1703      * Number of acquires of lock table latch with no contention.
1704      */
getNAcquiresNoWaiters()1705     public int getNAcquiresNoWaiters() {
1706         return lockStats.getInt(LATCH_NO_WAITERS);
1707     }
1708 
1709     /**
1710      * Number of acquires of lock table latch when it was already owned
1711      * by the caller.
1712      */
getNAcquiresSelfOwned()1713     public int getNAcquiresSelfOwned() {
1714         return lockStats.getInt(LATCH_SELF_OWNED);
1715     }
1716 
1717     /**
1718      * Number of acquires of lock table latch when it was already owned by
1719      * another thread.
1720      */
getNAcquiresWithContention()1721     public int getNAcquiresWithContention() {
1722         return lockStats.getInt(LATCH_CONTENTION);
1723     }
1724 
1725     /**
1726      * Number of successful no-wait acquires of the lock table latch.
1727      */
getNAcquiresNoWaitSuccessful()1728     public int getNAcquiresNoWaitSuccessful() {
1729         return lockStats.getInt(LATCH_NOWAIT_SUCCESS);
1730     }
1731 
1732     /**
1733      * Number of unsuccessful no-wait acquires of the lock table latch.
1734      */
getNAcquiresNoWaitUnSuccessful()1735     public int getNAcquiresNoWaitUnSuccessful() {
1736         return lockStats.getInt(LATCH_NOWAIT_UNSUCCESS);
1737     }
1738 
1739     /**
1740      * Number of releases of the lock table latch.
1741      */
getNReleases()1742     public int getNReleases() {
1743         return lockStats.getInt(LATCH_RELEASES);
1744     }
1745 
1746     /**
1747      * The number of user (non-internal) Cursor and Database get operations
1748      * performed in BIN deltas.
1749      */
getNBinDeltaGetOps()1750     public long getNBinDeltaGetOps() {
1751         return throughputStats.getAtomicLong(THROUGHPUT_BIN_DELTA_GETS);
1752     }
1753 
1754     /**
1755      * The number of user (non-internal) Cursor and Database insert operations
1756      * performed in BIN deltas (these are insertions performed via the various
1757      * put methods).
1758      */
getNBinDeltaInsertOps()1759     public long getNBinDeltaInsertOps() {
1760         return throughputStats.getAtomicLong(THROUGHPUT_BIN_DELTA_INSERTS);
1761     }
1762 
1763     /**
1764      * The number of user (non-internal) Cursor and Database update operations
1765      * performed in BIN deltas (these are updates performed via the various
1766      * put methods).
1767      */
getNBinDeltaUpdateOps()1768     public long getNBinDeltaUpdateOps() {
1769         return throughputStats.getAtomicLong(THROUGHPUT_BIN_DELTA_UPDATES);
1770     }
1771 
1772     /**
1773      * The number of user (non-internal) Cursor and Database delete operations
1774      * performed in BIN deltas.
1775      */
getNBinDeltaDeleteOps()1776     public long getNBinDeltaDeleteOps() {
1777         return throughputStats.getAtomicLong(THROUGHPUT_BIN_DELTA_DELETES);
1778     }
1779 
1780     /**
1781      * Returns a String representation of the stats in the form of
1782      * &lt;stat&gt;=&lt;value&gt;
1783      */
1784     @Override
toString()1785     public String toString() {
1786         StringBuilder sb = new StringBuilder();
1787 
1788         /* IO */
1789         sb.append(logStats.toString());
1790 
1791         /* Cache */
1792         sb.append(cacheStats.toString());
1793 
1794         /* Cleaner */
1795         sb.append(cleanerStats.toString());
1796 
1797         /* INCompressor */
1798         sb.append(incompStats.toString());
1799 
1800         /* Checkpointer */
1801         sb.append(ckptStats.toString());
1802 
1803         /* EnvironmentImpl */
1804         sb.append(envImplStats.toString());
1805 
1806         /* Lock Stats */
1807         sb.append(lockStats.toString());
1808 
1809         return sb.toString();
1810     }
1811 
1812     /**
1813      * Returns a String representation of the stats which includes stats
1814      * descriptions in addition to &lt;stat&gt;=&lt;value&gt;
1815      */
toStringVerbose()1816     public String toStringVerbose() {
1817         StringBuilder sb = new StringBuilder();
1818 
1819         /* IO */
1820         sb.append(logStats.toStringVerbose());
1821 
1822         /* Cache */
1823         sb.append(cacheStats.toStringVerbose());
1824 
1825         /* Cleaner */
1826         sb.append(cleanerStats.toStringVerbose());
1827 
1828         /* INCompressor */
1829         sb.append(incompStats.toStringVerbose());
1830 
1831         /* Checkpointer */
1832         sb.append(ckptStats.toStringVerbose());
1833 
1834         /* EnvironmentImpl */
1835         sb.append(envImplStats.toStringVerbose());
1836 
1837         /* Lock Stats */
1838         sb.append(lockStats.toStringVerbose());
1839 
1840         return sb.toString();
1841     }
1842 
1843     /**
1844      * @hidden
1845      * Internal use only.
1846      * JConsole plugin support: Get tips for stats.
1847      */
getTips()1848     public Map<String, String> getTips() {
1849         Map<String, String> tipsMap = new HashMap<String, String>();
1850         cacheStats.addToTipMap(tipsMap);
1851         ckptStats.addToTipMap(tipsMap);
1852         cleanerStats.addToTipMap(tipsMap);
1853         logStats.addToTipMap(tipsMap);
1854         lockStats.addToTipMap(tipsMap);
1855         envImplStats.addToTipMap(tipsMap);
1856 
1857         return tipsMap;
1858     }
1859 }
1860