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.dbi;
9 
10 import com.sleepycat.je.utilint.StatDefinition;
11 import com.sleepycat.je.utilint.StatDefinition.StatType;
12 
13 /**
14  * Per-stat Metadata for JE EnvironmentImpl and MemoryBudget statistics.
15  */
16 public class DbiStatDefinition {
17 
18     public static final String MB_GROUP_NAME = "Cache Layout";
19     public static final String MB_GROUP_DESC =
20         "Allocation of resources in the cache.";
21 
22     public static final String ENV_GROUP_NAME = "Environment";
23     public static final String ENV_GROUP_DESC =
24         "General environment wide statistics.";
25 
26     public static final String THROUGHPUT_GROUP_NAME = "Op";
27     public static final String THROUGHPUT_GROUP_DESC =
28         "Thoughput statistics for JE calls.";
29 
30     /* The following stat definitions are used in MemoryBudget. */
31     public static final StatDefinition MB_SHARED_CACHE_TOTAL_BYTES =
32         new StatDefinition("sharedCacheTotalBytes",
33                            "Total amount of the shared JE cache in use, in " +
34                            "bytes.",
35                            StatType.CUMULATIVE);
36 
37     public static final StatDefinition MB_TOTAL_BYTES =
38         new StatDefinition("cacheTotalBytes",
39                            "Total amount of JE cache in use, in bytes.",
40                            StatType.CUMULATIVE);
41 
42     public static final StatDefinition MB_DATA_BYTES =
43         new StatDefinition("dataBytes",
44                            "Amount of JE cache used for holding data, keys " +
45                            "and internal Btree nodes, in bytes.",
46                            StatType.CUMULATIVE);
47 
48     public static final StatDefinition MB_DATA_ADMIN_BYTES =
49         new StatDefinition("dataAdminBytes",
50                            "Amount of JE cache used for holding database " +
51                            "metadata, in bytes.",
52                            StatType.CUMULATIVE);
53 
54     public static final StatDefinition MB_ADMIN_BYTES =
55         new StatDefinition("adminBytes",
56                            "Number of bytes of JE cache used for log " +
57                            "cleaning metadata and other administrative " +
58                            "structure, in bytes.",
59                            StatType.CUMULATIVE);
60 
61     public static final StatDefinition MB_LOCK_BYTES =
62         new StatDefinition("lockBytes",
63                            "Number of bytes of JE cache used for holding " +
64                            "locks and transactions, in bytes.",
65                            StatType.CUMULATIVE);
66 
67     /* The following stat definitions are used in EnvironmentImpl. */
68     public static final StatDefinition ENVIMPL_RELATCHES_REQUIRED =
69         new StatDefinition("btreeRelatchesRequired",
70                            "Returns the number of btree latch upgrades " +
71                            "required while operating on this " +
72                            "Environment. A measurement of contention.");
73 
74     public static final StatDefinition ENVIMPL_CREATION_TIME =
75         new StatDefinition("environmentCreationTime",
76                            "Returns the time the Environment " +
77                            "was created. ",
78                            StatType.CUMULATIVE);
79 
80     /* The following stat definitions are used for throughput. */
81     public static final StatDefinition THROUGHPUT_DB_DELETE =
82         new StatDefinition("dbDelete",
83                            "Number of times Database.delete is called.");
84 
85     public static final StatDefinition THROUGHPUT_DB_GET =
86         new StatDefinition("dbGet",
87                            "Number of times Database.get is called.");
88 
89     public static final StatDefinition THROUGHPUT_DB_GETSEARCHBOTH =
90         new StatDefinition("dbGetSearchBoth",
91                            "Number of times Database.getSearchBoth " +
92                            "is called.");
93 
94     public static final StatDefinition THROUGHPUT_DB_PUT =
95         new StatDefinition("dbPut",
96                            "Number of times Database.put is called.");
97 
98     public static final StatDefinition THROUGHPUT_DB_PUTNODUPDATA =
99         new StatDefinition("dbPutNoDupData",
100                            "Number of times Database.putNoDupData " +
101                            "is called.");
102 
103     public static final StatDefinition THROUGHPUT_DB_PUTNOOVERWRITE =
104         new StatDefinition("dbPutNoOverWrite",
105                            "Number of times Database.putNoOverWrite " +
106                            "is called.");
107 
108     public static final StatDefinition THROUGHPUT_DB_REMOVESEQUENCE =
109         new StatDefinition("dbRemoveSequence",
110                            "Number of times Database.removeSequence " +
111                            "is called.");
112 
113     public static final StatDefinition THROUGHPUT_CURSOR_DELETE =
114         new StatDefinition("cursorDelete",
115                            "Number of times Cursor.delete is called.");
116 
117     public static final StatDefinition THROUGHPUT_CURSOR_GETCURRENT =
118         new StatDefinition("cursorGetCurrent",
119                            "Number of times Cursor.getCurrent is called.");
120 
121     public static final StatDefinition THROUGHPUT_CURSOR_GETFIRST =
122         new StatDefinition("cursorGetFirst",
123                            "Number of times Cursor.getFirst is called.");
124 
125     public static final StatDefinition THROUGHPUT_CURSOR_GETLAST =
126         new StatDefinition("cursorGetLast",
127                            "Number of times Cursor.getLast is called.");
128 
129     public static final StatDefinition THROUGHPUT_CURSOR_GETNEXT =
130         new StatDefinition("cursorGetNext",
131                            "Number of times Cursor.getNext is called.");
132 
133     public static final StatDefinition THROUGHPUT_CURSOR_GETNEXTDUP =
134         new StatDefinition("cursorGetNextDup",
135                            "Number of times Cursor.getNextDup is called.");
136 
137     public static final StatDefinition THROUGHPUT_CURSOR_GETNEXTNODUP =
138         new StatDefinition("cursorGetNextNoDup",
139                            "Number of times Cursor.getNextNoDup " +
140                            "is called.");
141 
142     public static final StatDefinition THROUGHPUT_CURSOR_GETPREV =
143         new StatDefinition("cursorGetPrev",
144                            "Number of times Cursor.getPrev is called.");
145 
146     public static final StatDefinition THROUGHPUT_CURSOR_GETPREVDUP =
147         new StatDefinition("cursorGetPrevDup",
148                            "Number of times Cursor.getPrevDup is called.");
149 
150     public static final StatDefinition THROUGHPUT_CURSOR_GETPREVNODUP =
151         new StatDefinition("cursorGetPrevNoDup",
152                            "Number of times Cursor. getPrevNoDup " +
153                             "is called.");
154 
155     public static final StatDefinition THROUGHPUT_CURSOR_PUT =
156         new StatDefinition("cursorPut",
157                            "Number of times Cursor.put is called.");
158 
159     public static final StatDefinition THROUGHPUT_CURSOR_PUTCURRENT =
160         new StatDefinition("cursorPutCurrent",
161                            "Number of times Cursor.putCurrent is called.");
162 
163     public static final StatDefinition THROUGHPUT_CURSOR_PUTNODUPDATA =
164         new StatDefinition("cursorPutNoDupData",
165                            "Number of times Cursor.putNoDupData " +
166                            "is called.");
167 
168     public static final StatDefinition THROUGHPUT_CURSOR_PUTNOOVERWRITE =
169         new StatDefinition("cursorPutNoOverwrite",
170                            "Number of times Cursor.putNoOverwrite " +
171                            "is called.");
172 
173     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_DELETE =
174         new StatDefinition("secondaryCursorDelete",
175                            "Number of times SecondaryCursor.delete " +
176                            "is called.");
177 
178     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETCURRENT =
179         new StatDefinition("secondaryCursorGetCurrent",
180                            "Number of times SecondaryCursor.getCurrent " +
181                            "is called.");
182 
183     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETFIRST =
184         new StatDefinition("secondaryCursorGetFirst",
185                            "Number of times SecondaryCursor.getFirst " +
186                            "is called.");
187 
188     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETLAST =
189         new StatDefinition("secondaryCursorGetLast",
190                            "Number of times SecondaryCursor.getLast " +
191                            "is called.");
192 
193     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETNEXT =
194         new StatDefinition("secondaryCursorGetNext",
195                            "Number of times SecondaryCursor.getNext " +
196                            "is called.");
197 
198     public static final StatDefinition
199         THROUGHPUT_SECONDARYCURSOR_GETNEXTDUP =
200             new StatDefinition("secondaryCursorGetNextDup",
201                                "Number of times SecondaryCursor.getNextDup " +
202                                "is called.");
203 
204     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETNEXTNODUP =
205         new StatDefinition("secondaryCursorGetNextNoDup",
206                            "Number of times SecondaryCursor.getNextNoDup " +
207                            "is called.");
208 
209     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETPREV =
210         new StatDefinition("secondaryCursorGetPrev",
211                            "Number of times SecondaryCursor.getPrev " +
212                            "is called.");
213 
214     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETPREVDUP =
215         new StatDefinition("secondaryCursorGetPrevDup",
216                            "Number of times SecondaryCursor.getPrevDup " +
217                            "is called.");
218 
219     public static final StatDefinition THROUGHPUT_SECONDARYCURSOR_GETPREVNODUP =
220         new StatDefinition("secondaryCursorGetPrevNoDup",
221                            "Number of times SecondaryCursor.getPrevNoDup " +
222                            "is called.");
223 
224     public static final StatDefinition THROUGHPUT_SECONDARYDB_DELETE =
225         new StatDefinition("secondaryDbDelete",
226                            "Number of times SecondaryDatabase.delete " +
227                            "is called.");
228 
229     public static final StatDefinition THROUGHPUT_SECONDARYDB_GET =
230         new StatDefinition("secondaryDbGet",
231                            "Number of times SecondaryDatabase.get " +
232                            "is called.");
233 
234     public static final StatDefinition THROUGHPUT_SECONDARYDB_GETSEARCHBOTH =
235         new StatDefinition("secondaryDbGetSearchBoth",
236                            "Number of times " +
237                            "SecondaryDatabase.getSearchBoth is called.");
238 
239     public static final StatDefinition THROUGHPUT_DOSCURSOR_GETNEXT =
240         new StatDefinition("dosCursorGetNext",
241                            "Number of times DiskOrderedCursor.getNext " +
242                            "is called.");
243 
244     /*
245      * The number of user (non-internal) Cursor get operations performed
246      * in BIN deltas
247      */
248     public static final StatDefinition THROUGHPUT_BIN_DELTA_GETS =
249         new StatDefinition("nBinDeltaGetOps",
250                            "The number of gets performed in BIN deltas");
251 
252     /*
253      * The number of user (non-internal) Cursor insert operations performed
254      * in BIN deltas
255      */
256     public static final StatDefinition THROUGHPUT_BIN_DELTA_INSERTS =
257         new StatDefinition("nBinDeltaInsertOps",
258                            "The number of inserts performed in BIN deltas");
259 
260     /*
261      * The number of user (non-internal) Cursor update operations performed
262      * in BIN deltas
263      */
264     public static final StatDefinition THROUGHPUT_BIN_DELTA_UPDATES =
265         new StatDefinition("nBinDeltaUpdateOps",
266                            "The number of updates performed in BIN deltas");
267 
268     /*
269      * The number of user (non-internal) Cursor update operations performed
270      * in BIN deltas
271      */
272     public static final StatDefinition THROUGHPUT_BIN_DELTA_DELETES =
273         new StatDefinition("nBinDeltaDeleteOps",
274                            "The number of deletes performed in BIN deltas");
275 
276 }
277