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.log;
9 
10 import com.sleepycat.je.utilint.StatDefinition;
11 import com.sleepycat.je.utilint.StatDefinition.StatType;
12 
13 /**
14  * Per-stat Metadata for JE FileManager, FSyncManager, LogManager and
15  * LogBufferPool statistics.
16  */
17 public class LogStatDefinition {
18 
19     /* Group definition for all log statistics. */
20     public static final String GROUP_NAME = "I/O";
21     public static final String GROUP_DESC =
22         "Log file opens, fsyncs, reads, writes, cache misses.";
23 
24     /* Group definition for LogBufferPool statistics. */
25     public static final String LBF_GROUP_NAME = "LogBufferPool";
26     public static final String LBF_GROUP_DESC = "LogBufferPool statistics";
27 
28     /* Group definition for FileManager statistics. */
29     public static final String FILEMGR_GROUP_NAME = "FileManager";
30     public static final String FILEMGR_GROUP_DESC = "FileManager statistics";
31 
32     /* Group definition for FSyncManager statistics. */
33     public static final String FSYNCMGR_GROUP_NAME = "FSyncManager";
34     public static final String FSYNCMGR_GROUP_DESC = "FSyncManager statistics";
35 
36     /* Group definition for GrpCommitManager statistics. */
37     public static final String GRPCOMMITMGR_GROUP_NAME = "GrpCommitManager";
38     public static final String GRPCOMMITMGR_GROUP_DESC =
39         "GrpCommitManager statistics";
40 
41     /* The following stat definitions are used in FileManager. */
42     public static final StatDefinition FILEMGR_RANDOM_READS =
43         new StatDefinition("nRandomReads",
44                            "Number of disk reads which required " +
45                            "respositioning the disk head more than 1MB " +
46                            "from the previous file position.");
47 
48     public static final StatDefinition FILEMGR_RANDOM_WRITES =
49         new StatDefinition("nRandomWrites",
50                            "Number of disk writes which required " +
51                            "respositioning the disk head by more than 1MB " +
52                            "from the previous file position.");
53 
54     public static final StatDefinition FILEMGR_SEQUENTIAL_READS =
55         new StatDefinition("nSequentialReads",
56                            "Number of disk reads which did not require " +
57                            "respositioning the disk head more than 1MB from " +
58                            "the previous file position.");
59 
60     public static final StatDefinition FILEMGR_SEQUENTIAL_WRITES =
61         new StatDefinition("nSequentialWrites",
62                            "Number of disk writes which did not require " +
63                            "respositioning the disk head by more than 1MB " +
64                            "from the previous file position.");
65 
66     public static final StatDefinition FILEMGR_RANDOM_READ_BYTES =
67         new StatDefinition("nRandomReadBytes",
68                            "Number of bytes read which required " +
69                            "respositioning the disk head more than 1MB from " +
70                            "the previous file position.");
71 
72     public static final StatDefinition FILEMGR_RANDOM_WRITE_BYTES =
73         new StatDefinition("nRandomWriteBytes",
74                            "Number of bytes written which required " +
75                            "respositioning the disk head more than 1MB from " +
76                            "the previous file position.");
77 
78     public static final StatDefinition FILEMGR_SEQUENTIAL_READ_BYTES =
79         new StatDefinition("nSequentialReadBytes",
80                            "Number of bytes read which did not require " +
81                            "respositioning the disk head more than 1MB from " +
82                            "the previous file position.");
83 
84     public static final StatDefinition FILEMGR_SEQUENTIAL_WRITE_BYTES =
85         new StatDefinition("nSequentialWriteBytes",
86                            "Number of bytes written which did not require " +
87                            "respositioning the disk head more than 1MB from " +
88                            "the previous file position.");
89 
90     public static final StatDefinition FILEMGR_FILE_OPENS =
91         new StatDefinition("nFileOpens",
92                            "Number of times a log file has been opened.");
93 
94     public static final StatDefinition FILEMGR_OPEN_FILES =
95         new StatDefinition("nOpenFiles",
96                            "Number of files currently open in the file " +
97                            "cache.",
98                            StatType.CUMULATIVE);
99 
100     public static final StatDefinition FILEMGR_BYTES_READ_FROM_WRITEQUEUE =
101         new StatDefinition("nBytesReadFromWriteQueue",
102                            "Number of bytes read to fulfill file read " +
103                            "operations by reading out of the pending write " +
104                            "queue.");
105 
106     public static final StatDefinition FILEMGR_BYTES_WRITTEN_FROM_WRITEQUEUE =
107         new StatDefinition("nBytesWrittenFromWriteQueue",
108                            "Number of bytes written from the pending write " +
109                            "queue.");
110 
111     public static final StatDefinition FILEMGR_READS_FROM_WRITEQUEUE =
112         new StatDefinition("nReadsFromWriteQueue",
113                            "Number of file read operations which were " +
114                            "fulfilled by reading out of the pending write " +
115                            "queue.");
116 
117     public static final StatDefinition FILEMGR_WRITES_FROM_WRITEQUEUE =
118         new StatDefinition("nWritesFromWriteQueue",
119                            "Number of file write operations executed from " +
120                            "the pending write queue.");
121 
122     public static final StatDefinition FILEMGR_WRITEQUEUE_OVERFLOW =
123         new StatDefinition("nWriteQueueOverflow",
124                            "Number of write operations which would overflow " +
125                            "the Write Queue.");
126 
127     public static final StatDefinition FILEMGR_WRITEQUEUE_OVERFLOW_FAILURES =
128         new StatDefinition("nWriteQueueOverflowFailures",
129                            "Number of write operations which would overflow " +
130                            "the Write Queue and could not be queued.");
131 
132     /* The following stat definitions are used in FSyncManager. */
133     public static final StatDefinition FSYNCMGR_FSYNCS =
134         new StatDefinition("nFSyncs",
135                            "Number of fsyncs issued through the group " +
136                            "commit manager for actions such as transaction " +
137                            "commits and checkpoints. A subset " +
138                            "of nLogFsyncs.");
139 
140     public static final StatDefinition FSYNCMGR_FSYNC_REQUESTS =
141         new StatDefinition("nFSyncRequests",
142                            "Number of fsyncs requested through the group " +
143                            "commit manager for actions such as transaction " +
144                            "commits and checkpoints.");
145 
146     public static final StatDefinition FSYNCMGR_TIMEOUTS =
147         new StatDefinition("nGrpCommitTimeouts",
148                            "Number of requests submitted to the " +
149                            "group commit manager for actions such as " +
150                            "transaction commmits and checkpoints " +
151                            "which timed out.");
152 
153     public static final StatDefinition FILEMGR_LOG_FSYNCS =
154         new StatDefinition("nLogFSyncs",
155                            "Total number of fsyncs of the JE log. This " +
156                            "includes those fsyncs recorded under the nFsyncs " +
157                            "stat");
158 
159     /* The following stat definitions are used in GrpCommitManager. */
160     public static final StatDefinition GRPCMGR_FSYNC_TIME =
161         new StatDefinition("nFSyncTime",
162                            "Total fsync time in ms" +
163                            "stat");
164 
165     public static final StatDefinition GRPCMGR_N_GROUP_COMMIT_REQUESTS =
166         new StatDefinition("nGroupCommitRequests",
167                            "Number of group commit requests.");
168 
169     public static final StatDefinition GRPCMGR_N_GROUP_COMMIT_WAITS =
170             new StatDefinition("nGroupCommitWaits",
171                                "Number of group commit leader waits.");
172 
173     public static final StatDefinition GRPCMGR_N_LOG_MAX_GROUP_COMMIT =
174         new StatDefinition("nLogMaxGroupCommitThreshold",
175                            "Number of group commits that were initiated due " +
176                            "to the group commit size threshold " +
177                            "being exceeded.");
178 
179     public static StatDefinition GRPCMGR_N_LOG_INTERVAL_EXCEEDED =
180         new StatDefinition("nLogIntervalExceeded",
181                            "Number of group commits that were initiated due " +
182                            "to the group commit time interval " +
183                            "being exceeded.");
184 
185     /* The following stat definitions are used in LogManager. */
186     public static final StatDefinition LOGMGR_REPEAT_FAULT_READS =
187         new StatDefinition("nRepeatFaultReads",
188                            "Number of reads which had to be repeated when " +
189                            "faulting in an object from disk because the " +
190                            "read chunk size controlled by " +
191                            "je.log.faultReadSize is too small.");
192 
193     public static final StatDefinition LOGMGR_TEMP_BUFFER_WRITES =
194         new StatDefinition("nTempBufferWrites",
195                            "Number of writes which had to be completed " +
196                            "using the temporary marshalling buffer because " +
197                            "the fixed size log buffers specified by " +
198                            "je.log.totalBufferBytes and je.log.numBuffers " +
199                            "were not large enough.");
200 
201     public static final StatDefinition LOGMGR_END_OF_LOG =
202         new StatDefinition("endOfLog",
203                            "The location of the next entry to be written to " +
204                            "the log.",
205                            StatType.CUMULATIVE);
206 
207     public static final StatDefinition LBFP_NO_FREE_BUFFER =
208             new StatDefinition("nNoFreeBuffer",
209                                "Number of requests to get a free buffer "+
210                                "that force a log write.");
211 
212     /* The following stat definitions are used in LogBufferPool. */
213     public static final StatDefinition LBFP_NOT_RESIDENT =
214         new StatDefinition("nNotResident",
215                            "Number of request for database objects not " +
216                            "contained within the in memory data structure.");
217 
218     public static final StatDefinition LBFP_MISS =
219         new StatDefinition("nCacheMiss",
220                            "Total number of requests for database objects " +
221                            "which were not in memory.");
222 
223     public static final StatDefinition LBFP_LOG_BUFFERS =
224         new StatDefinition("nLogBuffers",
225                            "Number of log buffers currently instantiated.",
226                            StatType.CUMULATIVE);
227 
228     public static final StatDefinition LBFP_BUFFER_BYTES =
229         new StatDefinition("bufferBytes",
230                            "Total memory currently consumed by log buffers, " +
231                            "in bytes.",
232                            StatType.CUMULATIVE);
233 }
234