summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/LogStats.java
blob: f2b824ea4eb63545671adb5de962f1e988c5a541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/*-
 * Automatically built by dist/s_java_stat.
 * Only the javadoc comments can be edited.
 *
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2002, 2015 Oracle and/or its affiliates.  All rights reserved.
 */

package com.sleepycat.db;

/**
Log statistics for a database environment.
*/
public class LogStats {
    // no public constructor
    /* package */ LogStats() {}

    private int st_magic;
    /**
    The magic number that identifies a file as a log file.
    */
    public int getMagic() {
        return st_magic;
    }

    private int st_version;
    /**
    The version of the log file type.
    */
    public int getVersion() {
        return st_version;
    }

    private int st_mode;
    /**
    The mode of any created log files.
    */
    public int getMode() {
        return st_mode;
    }

    private int st_lg_bsize;
    /**
    The in-memory log record cache size.
    */
    public int getLgBSize() {
        return st_lg_bsize;
    }

    private int st_lg_size;
    /**
    The current log file size.
    */
    public int getLgSize() {
        return st_lg_size;
    }

    private int st_wc_bytes;
    /**
    The number of bytes over and above {@link com.sleepycat.db.LogStats#getWcMbytes LogStats.getWcMbytes}
    written to this log since the last checkpoint.
    */
    public int getWcBytes() {
        return st_wc_bytes;
    }

    private int st_wc_mbytes;
    /**
    The number of megabytes written to this log since the last checkpoint.
    */
    public int getWcMbytes() {
        return st_wc_mbytes;
    }

    private int st_fileid_init;
    /** The initial allocated file logging identifiers. */
    public int getFileidInit() {
        return st_fileid_init;
    }

    private int st_nfileid;
    /** The current number of file logging identifiers. */
    public int getNumFileId() {
        return st_nfileid;
    }

    private int st_maxnfileid;
    /** The maximum number of file logging identifiers used. */
    public int getMaxNfileId() {
        return st_maxnfileid;
    }

    private long st_record;
    /** The number of records written to this log. **/
    public long getRecord() {
        return st_record;
    }

    private int st_w_bytes;
    /**
    The number of bytes over and above {@link #getWMbytes} written to this log.
    */
    public int getWBytes() {
        return st_w_bytes;
    }

    private int st_w_mbytes;
    /**
    The number of megabytes written to this log.
    */
    public int getWMbytes() {
        return st_w_mbytes;
    }

    private long st_wcount;
    /**
    The number of times the log has been written to disk.
    */
    public long getWCount() {
        return st_wcount;
    }

    private long st_wcount_fill;
    /**
    The number of times the log has been written to disk because the
    in-memory log record cache filled up.
    */
    public long getWCountFill() {
        return st_wcount_fill;
    }

    private long st_rcount;
    /** The number of times the log has been read from disk. **/
    public long getRCount() {
        return st_rcount;
    }

    private long st_scount;
    /**
    The number of times the log has been flushed to disk.
    */
    public long getSCount() {
        return st_scount;
    }

    private long st_region_wait;
    /**
    The number of times that a thread of control was forced to wait
    before obtaining the log region mutex.
    */
    public long getRegionWait() {
        return st_region_wait;
    }

    private long st_region_nowait;
    /**
    The number of times that a thread of control was able to obtain
    the log region mutex without waiting.
    */
    public long getRegionNowait() {
        return st_region_nowait;
    }

    private int st_cur_file;
    /**
    The current log file number.
    */
    public int getCurFile() {
        return st_cur_file;
    }

    private int st_cur_offset;
    /**
    The byte offset in the current log file.
    */
    public int getCurOffset() {
        return st_cur_offset;
    }

    private int st_disk_file;
    /**
    The log file number of the last record known to be on disk.
    */
    public int getDiskFile() {
        return st_disk_file;
    }

    private int st_disk_offset;
    /**
    The byte offset of the last record known to be on disk.
    */
    public int getDiskOffset() {
        return st_disk_offset;
    }

    private int st_maxcommitperflush;
    /**
    The maximum number of commits contained in a single log flush.
    */
    public int getMaxCommitperflush() {
        return st_maxcommitperflush;
    }

    private int st_mincommitperflush;
    /**
    The minimum number of commits contained in a single log flush that
    contained a commit.
    */
    public int getMinCommitperflush() {
        return st_mincommitperflush;
    }

    private long st_regsize;
    /**
    The size of the region.
    */
    public long getRegSize() {
        return st_regsize;
    }

    /**
    For convenience, the LogStats class has a toString method that lists
    all the data fields.
    */
    public String toString() {
        return "LogStats:"
            + "\n  st_magic=" + st_magic
            + "\n  st_version=" + st_version
            + "\n  st_mode=" + st_mode
            + "\n  st_lg_bsize=" + st_lg_bsize
            + "\n  st_lg_size=" + st_lg_size
            + "\n  st_wc_bytes=" + st_wc_bytes
            + "\n  st_wc_mbytes=" + st_wc_mbytes
            + "\n  st_fileid_init=" + st_fileid_init
            + "\n  st_nfileid=" + st_nfileid
            + "\n  st_maxnfileid=" + st_maxnfileid
            + "\n  st_record=" + st_record
            + "\n  st_w_bytes=" + st_w_bytes
            + "\n  st_w_mbytes=" + st_w_mbytes
            + "\n  st_wcount=" + st_wcount
            + "\n  st_wcount_fill=" + st_wcount_fill
            + "\n  st_rcount=" + st_rcount
            + "\n  st_scount=" + st_scount
            + "\n  st_region_wait=" + st_region_wait
            + "\n  st_region_nowait=" + st_region_nowait
            + "\n  st_cur_file=" + st_cur_file
            + "\n  st_cur_offset=" + st_cur_offset
            + "\n  st_disk_file=" + st_disk_file
            + "\n  st_disk_offset=" + st_disk_offset
            + "\n  st_maxcommitperflush=" + st_maxcommitperflush
            + "\n  st_mincommitperflush=" + st_mincommitperflush
            + "\n  st_regsize=" + st_regsize
            ;
    }
}