]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/TickerType.java
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).
9 * The logical mapping of tickers defined in rocksdb::Tickers.
11 * Java byte value mappings don't align 1:1 to the c++ values. c++ rocksdb::Tickers enumeration type
12 * is uint32_t and java org.rocksdb.TickerType is byte, this causes mapping issues when
13 * rocksdb::Tickers value is greater then 127 (0x7F) for jbyte jni interface as range greater is not
14 * available. Without breaking interface in minor versions, value mappings for
15 * org.rocksdb.TickerType leverage full byte range [-128 (-0x80), (0x7F)]. Newer tickers added
16 * should descend into negative values until TICKER_ENUM_MAX reaches -128 (-0x80).
18 public enum TickerType
{
21 * total block cache misses
23 * REQUIRES: BLOCK_CACHE_MISS == BLOCK_CACHE_INDEX_MISS +
24 * BLOCK_CACHE_FILTER_MISS +
25 * BLOCK_CACHE_DATA_MISS;
27 BLOCK_CACHE_MISS((byte) 0x0),
30 * total block cache hit
32 * REQUIRES: BLOCK_CACHE_HIT == BLOCK_CACHE_INDEX_HIT +
33 * BLOCK_CACHE_FILTER_HIT +
34 * BLOCK_CACHE_DATA_HIT;
36 BLOCK_CACHE_HIT((byte) 0x1),
38 BLOCK_CACHE_ADD((byte) 0x2),
41 * # of failures when adding blocks to block cache.
43 BLOCK_CACHE_ADD_FAILURES((byte) 0x3),
46 * # of times cache miss when accessing index block from block cache.
48 BLOCK_CACHE_INDEX_MISS((byte) 0x4),
51 * # of times cache hit when accessing index block from block cache.
53 BLOCK_CACHE_INDEX_HIT((byte) 0x5),
56 * # of index blocks added to block cache.
58 BLOCK_CACHE_INDEX_ADD((byte) 0x6),
61 * # of bytes of index blocks inserted into cache
63 BLOCK_CACHE_INDEX_BYTES_INSERT((byte) 0x7),
66 * # of bytes of index block erased from cache
68 BLOCK_CACHE_INDEX_BYTES_EVICT((byte) 0x8),
71 * # of times cache miss when accessing filter block from block cache.
73 BLOCK_CACHE_FILTER_MISS((byte) 0x9),
76 * # of times cache hit when accessing filter block from block cache.
78 BLOCK_CACHE_FILTER_HIT((byte) 0xA),
81 * # of filter blocks added to block cache.
83 BLOCK_CACHE_FILTER_ADD((byte) 0xB),
86 * # of bytes of bloom filter blocks inserted into cache
88 BLOCK_CACHE_FILTER_BYTES_INSERT((byte) 0xC),
91 * # of bytes of bloom filter block erased from cache
93 BLOCK_CACHE_FILTER_BYTES_EVICT((byte) 0xD),
96 * # of times cache miss when accessing data block from block cache.
98 BLOCK_CACHE_DATA_MISS((byte) 0xE),
101 * # of times cache hit when accessing data block from block cache.
103 BLOCK_CACHE_DATA_HIT((byte) 0xF),
106 * # of data blocks added to block cache.
108 BLOCK_CACHE_DATA_ADD((byte) 0x10),
111 * # of bytes of data blocks inserted into cache
113 BLOCK_CACHE_DATA_BYTES_INSERT((byte) 0x11),
116 * # of bytes read from cache.
118 BLOCK_CACHE_BYTES_READ((byte) 0x12),
121 * # of bytes written into cache.
123 BLOCK_CACHE_BYTES_WRITE((byte) 0x13),
126 * # of times bloom filter has avoided file reads.
128 BLOOM_FILTER_USEFUL((byte) 0x14),
131 * # persistent cache hit
133 PERSISTENT_CACHE_HIT((byte) 0x15),
136 * # persistent cache miss
138 PERSISTENT_CACHE_MISS((byte) 0x16),
141 * # total simulation block cache hits
143 SIM_BLOCK_CACHE_HIT((byte) 0x17),
146 * # total simulation block cache misses
148 SIM_BLOCK_CACHE_MISS((byte) 0x18),
151 * # of memtable hits.
153 MEMTABLE_HIT((byte) 0x19),
156 * # of memtable misses.
158 MEMTABLE_MISS((byte) 0x1A),
161 * # of Get() queries served by L0
163 GET_HIT_L0((byte) 0x1B),
166 * # of Get() queries served by L1
168 GET_HIT_L1((byte) 0x1C),
171 * # of Get() queries served by L2 and up
173 GET_HIT_L2_AND_UP((byte) 0x1D),
176 * COMPACTION_KEY_DROP_* count the reasons for key drop during compaction
177 * There are 4 reasons currently.
181 * key was written with a newer value.
183 COMPACTION_KEY_DROP_NEWER_ENTRY((byte) 0x1E),
186 * Also includes keys dropped for range del.
187 * The key is obsolete.
189 COMPACTION_KEY_DROP_OBSOLETE((byte) 0x1F),
192 * key was covered by a range tombstone.
194 COMPACTION_KEY_DROP_RANGE_DEL((byte) 0x20),
197 * User compaction function has dropped the key.
199 COMPACTION_KEY_DROP_USER((byte) 0x21),
202 * all keys in range were deleted.
204 COMPACTION_RANGE_DEL_DROP_OBSOLETE((byte) 0x22),
207 * Number of keys written to the database via the Put and Write call's.
209 NUMBER_KEYS_WRITTEN((byte) 0x23),
212 * Number of Keys read.
214 NUMBER_KEYS_READ((byte) 0x24),
217 * Number keys updated, if inplace update is enabled
219 NUMBER_KEYS_UPDATED((byte) 0x25),
222 * The number of uncompressed bytes issued by DB::Put(), DB::Delete(),\
223 * DB::Merge(), and DB::Write().
225 BYTES_WRITTEN((byte) 0x26),
228 * The number of uncompressed bytes read from DB::Get(). It could be
229 * either from memtables, cache, or table files.
231 * For the number of logical bytes read from DB::MultiGet(),
232 * please use {@link #NUMBER_MULTIGET_BYTES_READ}.
234 BYTES_READ((byte) 0x27),
237 * The number of calls to seek.
239 NUMBER_DB_SEEK((byte) 0x28),
242 * The number of calls to next.
244 NUMBER_DB_NEXT((byte) 0x29),
247 * The number of calls to prev.
249 NUMBER_DB_PREV((byte) 0x2A),
252 * The number of calls to seek that returned data.
254 NUMBER_DB_SEEK_FOUND((byte) 0x2B),
257 * The number of calls to next that returned data.
259 NUMBER_DB_NEXT_FOUND((byte) 0x2C),
262 * The number of calls to prev that returned data.
264 NUMBER_DB_PREV_FOUND((byte) 0x2D),
267 * The number of uncompressed bytes read from an iterator.
268 * Includes size of key and value.
270 ITER_BYTES_READ((byte) 0x2E),
272 NO_FILE_CLOSES((byte) 0x2F),
274 NO_FILE_OPENS((byte) 0x30),
276 NO_FILE_ERRORS((byte) 0x31),
279 * Time system had to wait to do LO-L1 compactions.
284 STALL_L0_SLOWDOWN_MICROS((byte) 0x32),
287 * Time system had to wait to move memtable to L1.
292 STALL_MEMTABLE_COMPACTION_MICROS((byte) 0x33),
295 * write throttle because of too many files in L0.
300 STALL_L0_NUM_FILES_MICROS((byte) 0x34),
303 * Writer has to wait for compaction or flush to finish.
305 STALL_MICROS((byte) 0x35),
308 * The wait time for db mutex.
310 * Disabled by default. To enable it set stats level to {@link StatsLevel#ALL}
312 DB_MUTEX_WAIT_MICROS((byte) 0x36),
314 RATE_LIMIT_DELAY_MILLIS((byte) 0x37),
317 * Number of iterators created.
320 NO_ITERATORS((byte) 0x38),
323 * Number of MultiGet calls.
325 NUMBER_MULTIGET_CALLS((byte) 0x39),
328 * Number of MultiGet keys read.
330 NUMBER_MULTIGET_KEYS_READ((byte) 0x3A),
333 * Number of MultiGet bytes read.
335 NUMBER_MULTIGET_BYTES_READ((byte) 0x3B),
338 * Number of deletes records that were not required to be
339 * written to storage because key does not exist.
341 NUMBER_FILTERED_DELETES((byte) 0x3C),
342 NUMBER_MERGE_FAILURES((byte) 0x3D),
345 * Number of times bloom was checked before creating iterator on a
346 * file, and the number of times the check was useful in avoiding
347 * iterator creation (and thus likely IOPs).
349 BLOOM_FILTER_PREFIX_CHECKED((byte) 0x3E),
350 BLOOM_FILTER_PREFIX_USEFUL((byte) 0x3F),
353 * Number of times we had to reseek inside an iteration to skip
354 * over large number of keys with same userkey.
356 NUMBER_OF_RESEEKS_IN_ITERATION((byte) 0x40),
359 * Record the number of calls to {@link RocksDB#getUpdatesSince(long)}. Useful to keep track of
360 * transaction log iterator refreshes.
362 GET_UPDATES_SINCE_CALLS((byte) 0x41),
365 * Miss in the compressed block cache.
367 BLOCK_CACHE_COMPRESSED_MISS((byte) 0x42),
370 * Hit in the compressed block cache.
372 BLOCK_CACHE_COMPRESSED_HIT((byte) 0x43),
375 * Number of blocks added to compressed block cache.
377 BLOCK_CACHE_COMPRESSED_ADD((byte) 0x44),
380 * Number of failures when adding blocks to compressed block cache.
382 BLOCK_CACHE_COMPRESSED_ADD_FAILURES((byte) 0x45),
385 * Number of times WAL sync is done.
387 WAL_FILE_SYNCED((byte) 0x46),
390 * Number of bytes written to WAL.
392 WAL_FILE_BYTES((byte) 0x47),
395 * Writes can be processed by requesting thread or by the thread at the
396 * head of the writers queue.
398 WRITE_DONE_BY_SELF((byte) 0x48),
401 * Equivalent to writes done for others.
403 WRITE_DONE_BY_OTHER((byte) 0x49),
406 * Number of writes ending up with timed-out.
408 WRITE_TIMEDOUT((byte) 0x4A),
411 * Number of Write calls that request WAL.
413 WRITE_WITH_WAL((byte) 0x4B),
416 * Bytes read during compaction.
418 COMPACT_READ_BYTES((byte) 0x4C),
421 * Bytes written during compaction.
423 COMPACT_WRITE_BYTES((byte) 0x4D),
426 * Bytes written during flush.
428 FLUSH_WRITE_BYTES((byte) 0x4E),
431 * Number of table's properties loaded directly from file, without creating
432 * table reader object.
434 NUMBER_DIRECT_LOAD_TABLE_PROPERTIES((byte) 0x4F),
435 NUMBER_SUPERVERSION_ACQUIRES((byte) 0x50),
436 NUMBER_SUPERVERSION_RELEASES((byte) 0x51),
437 NUMBER_SUPERVERSION_CLEANUPS((byte) 0x52),
440 * # of compressions/decompressions executed
442 NUMBER_BLOCK_COMPRESSED((byte) 0x53),
443 NUMBER_BLOCK_DECOMPRESSED((byte) 0x54),
445 NUMBER_BLOCK_NOT_COMPRESSED((byte) 0x55),
446 MERGE_OPERATION_TOTAL_TIME((byte) 0x56),
447 FILTER_OPERATION_TOTAL_TIME((byte) 0x57),
452 ROW_CACHE_HIT((byte) 0x58),
453 ROW_CACHE_MISS((byte) 0x59),
456 * Read amplification statistics.
458 * Read amplification can be calculated using this formula
459 * (READ_AMP_TOTAL_READ_BYTES / READ_AMP_ESTIMATE_USEFUL_BYTES)
461 * REQUIRES: ReadOptions::read_amp_bytes_per_bit to be enabled
465 * Estimate of total bytes actually used.
467 READ_AMP_ESTIMATE_USEFUL_BYTES((byte) 0x5A),
470 * Total size of loaded data blocks.
472 READ_AMP_TOTAL_READ_BYTES((byte) 0x5B),
475 * Number of refill intervals where rate limiter's bytes are fully consumed.
477 NUMBER_RATE_LIMITER_DRAINS((byte) 0x5C),
480 * Number of internal skipped during iteration
482 NUMBER_ITER_SKIP((byte) 0x5D),
485 * Number of MultiGet keys found (vs number requested)
487 NUMBER_MULTIGET_KEYS_FOUND((byte) 0x5E),
489 // -0x01 to fixate the new value that incorrectly changed TICKER_ENUM_MAX
491 * Number of iterators created.
493 NO_ITERATOR_CREATED((byte) -0x01),
496 * Number of iterators deleted.
498 NO_ITERATOR_DELETED((byte) 0x60),
501 * Deletions obsoleted before bottom level due to file gap optimization.
503 COMPACTION_OPTIMIZED_DEL_DROP_OBSOLETE((byte) 0x61),
506 * If a compaction was cancelled in sfm to prevent ENOSPC
508 COMPACTION_CANCELLED((byte) 0x62),
511 * # of times bloom FullFilter has not avoided the reads.
513 BLOOM_FILTER_FULL_POSITIVE((byte) 0x63),
516 * # of times bloom FullFilter has not avoided the reads and data actually
519 BLOOM_FILTER_FULL_TRUE_POSITIVE((byte) 0x64),
522 * BlobDB specific stats
523 * # of Put/PutTTL/PutUntil to BlobDB.
525 BLOB_DB_NUM_PUT((byte) 0x65),
528 * # of Write to BlobDB.
530 BLOB_DB_NUM_WRITE((byte) 0x66),
533 * # of Get to BlobDB.
535 BLOB_DB_NUM_GET((byte) 0x67),
538 * # of MultiGet to BlobDB.
540 BLOB_DB_NUM_MULTIGET((byte) 0x68),
543 * # of Seek/SeekToFirst/SeekToLast/SeekForPrev to BlobDB iterator.
545 BLOB_DB_NUM_SEEK((byte) 0x69),
548 * # of Next to BlobDB iterator.
550 BLOB_DB_NUM_NEXT((byte) 0x6A),
553 * # of Prev to BlobDB iterator.
555 BLOB_DB_NUM_PREV((byte) 0x6B),
558 * # of keys written to BlobDB.
560 BLOB_DB_NUM_KEYS_WRITTEN((byte) 0x6C),
563 * # of keys read from BlobDB.
565 BLOB_DB_NUM_KEYS_READ((byte) 0x6D),
568 * # of bytes (key + value) written to BlobDB.
570 BLOB_DB_BYTES_WRITTEN((byte) 0x6E),
573 * # of bytes (keys + value) read from BlobDB.
575 BLOB_DB_BYTES_READ((byte) 0x6F),
578 * # of keys written by BlobDB as non-TTL inlined value.
580 BLOB_DB_WRITE_INLINED((byte) 0x70),
583 * # of keys written by BlobDB as TTL inlined value.
585 BLOB_DB_WRITE_INLINED_TTL((byte) 0x71),
588 * # of keys written by BlobDB as non-TTL blob value.
590 BLOB_DB_WRITE_BLOB((byte) 0x72),
593 * # of keys written by BlobDB as TTL blob value.
595 BLOB_DB_WRITE_BLOB_TTL((byte) 0x73),
598 * # of bytes written to blob file.
600 BLOB_DB_BLOB_FILE_BYTES_WRITTEN((byte) 0x74),
603 * # of bytes read from blob file.
605 BLOB_DB_BLOB_FILE_BYTES_READ((byte) 0x75),
608 * # of times a blob files being synced.
610 BLOB_DB_BLOB_FILE_SYNCED((byte) 0x76),
613 * # of blob index evicted from base DB by BlobDB compaction filter because
616 BLOB_DB_BLOB_INDEX_EXPIRED_COUNT((byte) 0x77),
619 * Size of blob index evicted from base DB by BlobDB compaction filter
620 * because of expiration.
622 BLOB_DB_BLOB_INDEX_EXPIRED_SIZE((byte) 0x78),
625 * # of blob index evicted from base DB by BlobDB compaction filter because
626 * of corresponding file deleted.
628 BLOB_DB_BLOB_INDEX_EVICTED_COUNT((byte) 0x79),
631 * Size of blob index evicted from base DB by BlobDB compaction filter
632 * because of corresponding file deleted.
634 BLOB_DB_BLOB_INDEX_EVICTED_SIZE((byte) 0x7A),
637 * # of blob files being garbage collected.
639 BLOB_DB_GC_NUM_FILES((byte) 0x7B),
642 * # of blob files generated by garbage collection.
644 BLOB_DB_GC_NUM_NEW_FILES((byte) 0x7C),
647 * # of BlobDB garbage collection failures.
649 BLOB_DB_GC_FAILURES((byte) 0x7D),
652 * # of keys drop by BlobDB garbage collection because they had been
655 BLOB_DB_GC_NUM_KEYS_OVERWRITTEN((byte) 0x7E),
658 * # of keys drop by BlobDB garbage collection because of expiration.
660 BLOB_DB_GC_NUM_KEYS_EXPIRED((byte) 0x7F),
663 * # of keys relocated to new blob file by garbage collection.
665 BLOB_DB_GC_NUM_KEYS_RELOCATED((byte) -0x02),
668 * # of bytes drop by BlobDB garbage collection because they had been
671 BLOB_DB_GC_BYTES_OVERWRITTEN((byte) -0x03),
674 * # of bytes drop by BlobDB garbage collection because of expiration.
676 BLOB_DB_GC_BYTES_EXPIRED((byte) -0x04),
679 * # of bytes relocated to new blob file by garbage collection.
681 BLOB_DB_GC_BYTES_RELOCATED((byte) -0x05),
684 * # of blob files evicted because of BlobDB is full.
686 BLOB_DB_FIFO_NUM_FILES_EVICTED((byte) -0x06),
689 * # of keys in the blob files evicted because of BlobDB is full.
691 BLOB_DB_FIFO_NUM_KEYS_EVICTED((byte) -0x07),
694 * # of bytes in the blob files evicted because of BlobDB is full.
696 BLOB_DB_FIFO_BYTES_EVICTED((byte) -0x08),
699 * These counters indicate a performance issue in WritePrepared transactions.
700 * We should not seem them ticking them much.
701 * # of times prepare_mutex_ is acquired in the fast path.
703 TXN_PREPARE_MUTEX_OVERHEAD((byte) -0x09),
706 * # of times old_commit_map_mutex_ is acquired in the fast path.
708 TXN_OLD_COMMIT_MAP_MUTEX_OVERHEAD((byte) -0x0A),
711 * # of times we checked a batch for duplicate keys.
713 TXN_DUPLICATE_KEY_OVERHEAD((byte) -0x0B),
716 * # of times snapshot_mutex_ is acquired in the fast path.
718 TXN_SNAPSHOT_MUTEX_OVERHEAD((byte) -0x0C),
721 * # of times ::Get returned TryAgain due to expired snapshot seq
723 TXN_GET_TRY_AGAIN((byte) -0x0D),
726 * # of files marked as trash by delete scheduler
728 FILES_MARKED_TRASH((byte) -0x0E),
731 * # of files deleted immediately by delete scheduler
733 FILES_DELETED_IMMEDIATELY((byte) -0x0f),
736 * Compaction read and write statistics broken down by CompactionReason
738 COMPACT_READ_BYTES_MARKED((byte) -0x10),
739 COMPACT_READ_BYTES_PERIODIC((byte) -0x11),
740 COMPACT_READ_BYTES_TTL((byte) -0x12),
741 COMPACT_WRITE_BYTES_MARKED((byte) -0x13),
742 COMPACT_WRITE_BYTES_PERIODIC((byte) -0x14),
743 COMPACT_WRITE_BYTES_TTL((byte) -0x15),
746 * DB error handler statistics
748 ERROR_HANDLER_BG_ERROR_COUNT((byte) -0x16),
749 ERROR_HANDLER_BG_IO_ERROR_COUNT((byte) -0x17),
750 ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT((byte) -0x18),
751 ERROR_HANDLER_AUTORESUME_COUNT((byte) -0x19),
752 ERROR_HANDLER_AUTORESUME_RETRY_TOTAL_COUNT((byte) -0x1A),
753 ERROR_HANDLER_AUTORESUME_SUCCESS_COUNT((byte) -0x1B),
756 * Bytes of raw data (payload) found on memtable at flush time.
757 * Contains the sum of garbage payload (bytes that are discarded
758 * at flush time) and useful payload (bytes of data that will
759 * eventually be written to SSTable).
761 MEMTABLE_PAYLOAD_BYTES_AT_FLUSH((byte) -0x1C),
763 * Outdated bytes of data present on memtable at flush time.
765 MEMTABLE_GARBAGE_BYTES_AT_FLUSH((byte) -0x1D),
768 * Number of secondary cache hits
770 SECONDARY_CACHE_HITS((byte) -0x1E),
773 * Bytes read by `VerifyChecksum()` and `VerifyFileChecksums()` APIs.
775 VERIFY_CHECKSUM_READ_BYTES((byte) -0x1F),
778 * Bytes read/written while creating backups
780 BACKUP_READ_BYTES((byte) -0x20),
781 BACKUP_WRITE_BYTES((byte) -0x21),
784 * Remote compaction read/write statistics
786 REMOTE_COMPACT_READ_BYTES((byte) -0x22),
787 REMOTE_COMPACT_WRITE_BYTES((byte) -0x23),
790 * Tiered storage related statistics
792 HOT_FILE_READ_BYTES((byte) -0x24),
793 WARM_FILE_READ_BYTES((byte) -0x25),
794 COLD_FILE_READ_BYTES((byte) -0x26),
795 HOT_FILE_READ_COUNT((byte) -0x27),
796 WARM_FILE_READ_COUNT((byte) -0x28),
797 COLD_FILE_READ_COUNT((byte) -0x29),
800 * (non-)last level read statistics
802 LAST_LEVEL_READ_BYTES((byte) -0x2A),
803 LAST_LEVEL_READ_COUNT((byte) -0x2B),
804 NON_LAST_LEVEL_READ_BYTES((byte) -0x2C),
805 NON_LAST_LEVEL_READ_COUNT((byte) -0x2D),
807 BLOCK_CHECKSUM_COMPUTE_COUNT((byte) -0x2E),
810 * # of times cache miss when accessing blob from blob cache.
812 BLOB_DB_CACHE_MISS((byte) -0x2F),
815 * # of times cache hit when accessing blob from blob cache.
817 BLOB_DB_CACHE_HIT((byte) -0x30),
820 * # of data blocks added to blob cache.
822 BLOB_DB_CACHE_ADD((byte) -0x31),
825 * # # of failures when adding blobs to blob cache.
827 BLOB_DB_CACHE_ADD_FAILURES((byte) -0x32),
830 * # of bytes read from blob cache.
832 BLOB_DB_CACHE_BYTES_READ((byte) -0x33),
835 * # of bytes written into blob cache.
837 BLOB_DB_CACHE_BYTES_WRITE((byte) -0x34),
839 TICKER_ENUM_MAX((byte) 0x5F);
841 private final byte value
;
843 TickerType(final byte value
) {
848 * Returns the byte value of the enumerations value
850 * @return byte representation
852 public byte getValue() {
857 * Get Ticker type by byte value.
859 * @param value byte representation of TickerType.
861 * @return {@link org.rocksdb.TickerType} instance.
862 * @throws java.lang.IllegalArgumentException if an invalid
865 public static TickerType
getTickerType(final byte value
) {
866 for (final TickerType tickerType
: TickerType
.values()) {
867 if (tickerType
.getValue() == value
) {
871 throw new IllegalArgumentException(
872 "Illegal value provided for TickerType.");