1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
8 public enum HistogramType
{
14 COMPACTION_TIME((byte) 0x2),
16 SUBCOMPACTION_SETUP_TIME((byte) 0x3),
18 TABLE_SYNC_MICROS((byte) 0x4),
20 COMPACTION_OUTFILE_SYNC_MICROS((byte) 0x5),
22 WAL_FILE_SYNC_MICROS((byte) 0x6),
24 MANIFEST_FILE_SYNC_MICROS((byte) 0x7),
27 * TIME SPENT IN IO DURING TABLE OPEN.
29 TABLE_OPEN_IO_MICROS((byte) 0x8),
31 DB_MULTIGET((byte) 0x9),
33 READ_BLOCK_COMPACTION_MICROS((byte) 0xA),
35 READ_BLOCK_GET_MICROS((byte) 0xB),
37 WRITE_RAW_BLOCK_MICROS((byte) 0xC),
39 STALL_L0_SLOWDOWN_COUNT((byte) 0xD),
41 STALL_MEMTABLE_COMPACTION_COUNT((byte) 0xE),
43 STALL_L0_NUM_FILES_COUNT((byte) 0xF),
45 HARD_RATE_LIMIT_DELAY_COUNT((byte) 0x10),
47 SOFT_RATE_LIMIT_DELAY_COUNT((byte) 0x11),
49 NUM_FILES_IN_SINGLE_COMPACTION((byte) 0x12),
53 WRITE_STALL((byte) 0x14),
55 SST_READ_MICROS((byte) 0x15),
58 * The number of subcompactions actually scheduled during a compaction.
60 NUM_SUBCOMPACTIONS_SCHEDULED((byte) 0x16),
63 * Value size distribution in each operation.
65 BYTES_PER_READ((byte) 0x17),
66 BYTES_PER_WRITE((byte) 0x18),
67 BYTES_PER_MULTIGET((byte) 0x19),
70 * number of bytes compressed.
72 BYTES_COMPRESSED((byte) 0x1A),
75 * number of bytes decompressed.
77 * number of bytes is when uncompressed; i.e. before/after respectively
79 BYTES_DECOMPRESSED((byte) 0x1B),
81 COMPRESSION_TIMES_NANOS((byte) 0x1C),
83 DECOMPRESSION_TIMES_NANOS((byte) 0x1D),
85 READ_NUM_MERGE_OPERANDS((byte) 0x1E),
88 * Time spent flushing memtable to disk.
90 FLUSH_TIME((byte) 0x20),
93 * Size of keys written to BlobDB.
95 BLOB_DB_KEY_SIZE((byte) 0x21),
98 * Size of values written to BlobDB.
100 BLOB_DB_VALUE_SIZE((byte) 0x22),
103 * BlobDB Put/PutWithTTL/PutUntil/Write latency.
105 BLOB_DB_WRITE_MICROS((byte) 0x23),
108 * BlobDB Get lagency.
110 BLOB_DB_GET_MICROS((byte) 0x24),
113 * BlobDB MultiGet latency.
115 BLOB_DB_MULTIGET_MICROS((byte) 0x25),
118 * BlobDB Seek/SeekToFirst/SeekToLast/SeekForPrev latency.
120 BLOB_DB_SEEK_MICROS((byte) 0x26),
123 * BlobDB Next latency.
125 BLOB_DB_NEXT_MICROS((byte) 0x27),
128 * BlobDB Prev latency.
130 BLOB_DB_PREV_MICROS((byte) 0x28),
133 * Blob file write latency.
135 BLOB_DB_BLOB_FILE_WRITE_MICROS((byte) 0x29),
138 * Blob file read latency.
140 BLOB_DB_BLOB_FILE_READ_MICROS((byte) 0x2A),
143 * Blob file sync latency.
145 BLOB_DB_BLOB_FILE_SYNC_MICROS((byte) 0x2B),
148 * BlobDB garbage collection time.
150 BLOB_DB_GC_MICROS((byte) 0x2C),
153 * BlobDB compression time.
155 BLOB_DB_COMPRESSION_MICROS((byte) 0x2D),
158 * BlobDB decompression time.
160 BLOB_DB_DECOMPRESSION_MICROS((byte) 0x2E),
163 * Num of Index and Filter blocks read from file system per level in MultiGet
166 NUM_INDEX_AND_FILTER_BLOCKS_READ_PER_LEVEL((byte) 0x2F),
169 * Num of Data blocks read from file system per level in MultiGet request.
171 NUM_DATA_BLOCKS_READ_PER_LEVEL((byte) 0x30),
174 * Num of SST files read from file system per level in MultiGet request.
176 NUM_SST_READ_PER_LEVEL((byte) 0x31),
179 * The number of retry in auto resume
181 ERROR_HANDLER_AUTORESUME_RETRY_COUNT((byte) 0x32),
183 ASYNC_READ_BYTES((byte) 0x33),
185 // 0x1F for backwards compatibility on current minor version.
186 HISTOGRAM_ENUM_MAX((byte) 0x1F);
188 private final byte value
;
190 HistogramType(final byte value
) {
195 * Returns the byte value of the enumerations value
197 * @return byte representation
199 public byte getValue() {
204 * Get Histogram type by byte value.
206 * @param value byte representation of HistogramType.
208 * @return {@link org.rocksdb.HistogramType} instance.
209 * @throws java.lang.IllegalArgumentException if an invalid
212 public static HistogramType
getHistogramType(final byte value
) {
213 for (final HistogramType histogramType
: HistogramType
.values()) {
214 if (histogramType
.getValue() == value
) {
215 return histogramType
;
218 throw new IllegalArgumentException(
219 "Illegal value provided for HistogramType.");