rust-rocksdb 0.54.0

Rust wrapper for Facebook's RocksDB embeddable database
Documentation
// **** DO NOT modify this file! ****
// This file is generated by cmd:
//   gen_perf_metrics.bash rocksdb/monitoring/perf_context.cc

/// Rust representation of the performance metrics from RocksDB's perf_context
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[repr(u32)]
// MSVC types an anonymous C enum as signed int where clang picks unsigned, so
// these constants are i32 on Windows and u32 everywhere else. The cast is
// needed on Windows and redundant on the platforms clippy runs on.
#[allow(clippy::unnecessary_cast)]
pub enum PerfMetric {
    UserKeyComparisonCount = ffi::rocksdb_user_key_comparison_count as u32,
    BlockCacheHitCount = ffi::rocksdb_block_cache_hit_count as u32,
    BlockReadCount = ffi::rocksdb_block_read_count as u32,
    BlockReadByte = ffi::rocksdb_block_read_byte as u32,
    BlockReadTime = ffi::rocksdb_block_read_time as u32,
    BlockChecksumTime = ffi::rocksdb_block_checksum_time as u32,
    BlockDecompressTime = ffi::rocksdb_block_decompress_time as u32,
    GetReadBytes = ffi::rocksdb_get_read_bytes as u32,
    MultigetReadBytes = ffi::rocksdb_multiget_read_bytes as u32,
    IterReadBytes = ffi::rocksdb_iter_read_bytes as u32,
    InternalKeySkippedCount = ffi::rocksdb_internal_key_skipped_count as u32,
    InternalDeleteSkippedCount = ffi::rocksdb_internal_delete_skipped_count as u32,
    InternalRecentSkippedCount = ffi::rocksdb_internal_recent_skipped_count as u32,
    InternalMergeCount = ffi::rocksdb_internal_merge_count as u32,
    GetSnapshotTime = ffi::rocksdb_get_snapshot_time as u32,
    GetFromMemtableTime = ffi::rocksdb_get_from_memtable_time as u32,
    GetFromMemtableCount = ffi::rocksdb_get_from_memtable_count as u32,
    GetPostProcessTime = ffi::rocksdb_get_post_process_time as u32,
    GetFromOutputFilesTime = ffi::rocksdb_get_from_output_files_time as u32,
    SeekOnMemtableTime = ffi::rocksdb_seek_on_memtable_time as u32,
    SeekOnMemtableCount = ffi::rocksdb_seek_on_memtable_count as u32,
    NextOnMemtableCount = ffi::rocksdb_next_on_memtable_count as u32,
    PrevOnMemtableCount = ffi::rocksdb_prev_on_memtable_count as u32,
    SeekChildSeekTime = ffi::rocksdb_seek_child_seek_time as u32,
    SeekChildSeekCount = ffi::rocksdb_seek_child_seek_count as u32,
    SeekMinHeapTime = ffi::rocksdb_seek_min_heap_time as u32,
    SeekMaxHeapTime = ffi::rocksdb_seek_max_heap_time as u32,
    SeekInternalSeekTime = ffi::rocksdb_seek_internal_seek_time as u32,
    FindNextUserEntryTime = ffi::rocksdb_find_next_user_entry_time as u32,
    WriteWalTime = ffi::rocksdb_write_wal_time as u32,
    WriteMemtableTime = ffi::rocksdb_write_memtable_time as u32,
    WriteDelayTime = ffi::rocksdb_write_delay_time as u32,
    WritePreAndPostProcessTime = ffi::rocksdb_write_pre_and_post_process_time as u32,
    DbMutexLockNanos = ffi::rocksdb_db_mutex_lock_nanos as u32,
    DbConditionWaitNanos = ffi::rocksdb_db_condition_wait_nanos as u32,
    MergeOperatorTimeNanos = ffi::rocksdb_merge_operator_time_nanos as u32,
    ReadIndexBlockNanos = ffi::rocksdb_read_index_block_nanos as u32,
    ReadFilterBlockNanos = ffi::rocksdb_read_filter_block_nanos as u32,
    NewTableBlockIterNanos = ffi::rocksdb_new_table_block_iter_nanos as u32,
    NewTableIteratorNanos = ffi::rocksdb_new_table_iterator_nanos as u32,
    BlockSeekNanos = ffi::rocksdb_block_seek_nanos as u32,
    FindTableNanos = ffi::rocksdb_find_table_nanos as u32,
    BloomMemtableHitCount = ffi::rocksdb_bloom_memtable_hit_count as u32,
    BloomMemtableMissCount = ffi::rocksdb_bloom_memtable_miss_count as u32,
    BloomSstHitCount = ffi::rocksdb_bloom_sst_hit_count as u32,
    BloomSstMissCount = ffi::rocksdb_bloom_sst_miss_count as u32,
    KeyLockWaitTime = ffi::rocksdb_key_lock_wait_time as u32,
    KeyLockWaitCount = ffi::rocksdb_key_lock_wait_count as u32,
    EnvNewSequentialFileNanos = ffi::rocksdb_env_new_sequential_file_nanos as u32,
    EnvNewRandomAccessFileNanos = ffi::rocksdb_env_new_random_access_file_nanos as u32,
    EnvNewWritableFileNanos = ffi::rocksdb_env_new_writable_file_nanos as u32,
    EnvReuseWritableFileNanos = ffi::rocksdb_env_reuse_writable_file_nanos as u32,
    EnvNewRandomRwFileNanos = ffi::rocksdb_env_new_random_rw_file_nanos as u32,
    EnvNewDirectoryNanos = ffi::rocksdb_env_new_directory_nanos as u32,
    EnvFileExistsNanos = ffi::rocksdb_env_file_exists_nanos as u32,
    EnvGetChildrenNanos = ffi::rocksdb_env_get_children_nanos as u32,
    EnvGetChildrenFileAttributesNanos = ffi::rocksdb_env_get_children_file_attributes_nanos as u32,
    EnvDeleteFileNanos = ffi::rocksdb_env_delete_file_nanos as u32,
    EnvCreateDirNanos = ffi::rocksdb_env_create_dir_nanos as u32,
    EnvCreateDirIfMissingNanos = ffi::rocksdb_env_create_dir_if_missing_nanos as u32,
    EnvDeleteDirNanos = ffi::rocksdb_env_delete_dir_nanos as u32,
    EnvGetFileSizeNanos = ffi::rocksdb_env_get_file_size_nanos as u32,
    EnvGetFileModificationTimeNanos = ffi::rocksdb_env_get_file_modification_time_nanos as u32,
    EnvRenameFileNanos = ffi::rocksdb_env_rename_file_nanos as u32,
    EnvLinkFileNanos = ffi::rocksdb_env_link_file_nanos as u32,
    EnvLockFileNanos = ffi::rocksdb_env_lock_file_nanos as u32,
    EnvUnlockFileNanos = ffi::rocksdb_env_unlock_file_nanos as u32,
    EnvNewLoggerNanos = ffi::rocksdb_env_new_logger_nanos as u32,
    NumberAsyncSeek = ffi::rocksdb_number_async_seek as u32,
    BlobCacheHitCount = ffi::rocksdb_blob_cache_hit_count as u32,
    BlobReadCount = ffi::rocksdb_blob_read_count as u32,
    BlobReadByte = ffi::rocksdb_blob_read_byte as u32,
    BlobReadTime = ffi::rocksdb_blob_read_time as u32,
    BlobChecksumTime = ffi::rocksdb_blob_checksum_time as u32,
    BlobDecompressTime = ffi::rocksdb_blob_decompress_time as u32,
    InternalRangeDelReseekCount = ffi::rocksdb_internal_range_del_reseek_count as u32,
    BlockReadCpuTime = ffi::rocksdb_block_read_cpu_time as u32,
    InternalMergePointLookupCount = ffi::rocksdb_internal_merge_point_lookup_count as u32,
    DataBlockReadByte = ffi::rocksdb_data_block_read_byte as u32,
    IndexBlockReadByte = ffi::rocksdb_index_block_read_byte as u32,
    FilterBlockReadByte = ffi::rocksdb_filter_block_read_byte as u32,
    CompressionDictBlockReadByte = ffi::rocksdb_compression_dict_block_read_byte as u32,
    MetadataBlockReadByte = ffi::rocksdb_metadata_block_read_byte as u32,
    BlobCacheReadByte = ffi::rocksdb_blob_cache_read_byte as u32,
    TotalMetricCount = ffi::rocksdb_total_metric_count as u32,
}

impl PerfMetric {
    /// Returns the name of this metric as it appears in RocksDB C++
    pub const fn name(&self) -> &'static str {
        match self {
            PerfMetric::BlobCacheHitCount => "blob_cache_hit_count",
            PerfMetric::BlobCacheReadByte => "blob_cache_read_byte",
            PerfMetric::BlobChecksumTime => "blob_checksum_time",
            PerfMetric::BlobDecompressTime => "blob_decompress_time",
            PerfMetric::BlobReadByte => "blob_read_byte",
            PerfMetric::BlobReadCount => "blob_read_count",
            PerfMetric::BlobReadTime => "blob_read_time",
            PerfMetric::BlockCacheHitCount => "block_cache_hit_count",
            PerfMetric::BlockChecksumTime => "block_checksum_time",
            PerfMetric::BlockDecompressTime => "block_decompress_time",
            PerfMetric::BlockReadByte => "block_read_byte",
            PerfMetric::BlockReadCount => "block_read_count",
            PerfMetric::BlockReadCpuTime => "block_read_cpu_time",
            PerfMetric::BlockReadTime => "block_read_time",
            PerfMetric::BlockSeekNanos => "block_seek_nanos",
            PerfMetric::BloomMemtableHitCount => "bloom_memtable_hit_count",
            PerfMetric::BloomMemtableMissCount => "bloom_memtable_miss_count",
            PerfMetric::BloomSstHitCount => "bloom_sst_hit_count",
            PerfMetric::BloomSstMissCount => "bloom_sst_miss_count",
            PerfMetric::CompressionDictBlockReadByte => "compression_dict_block_read_byte",
            PerfMetric::DataBlockReadByte => "data_block_read_byte",
            PerfMetric::DbConditionWaitNanos => "db_condition_wait_nanos",
            PerfMetric::DbMutexLockNanos => "db_mutex_lock_nanos",
            PerfMetric::EnvCreateDirIfMissingNanos => "env_create_dir_if_missing_nanos",
            PerfMetric::EnvCreateDirNanos => "env_create_dir_nanos",
            PerfMetric::EnvDeleteDirNanos => "env_delete_dir_nanos",
            PerfMetric::EnvDeleteFileNanos => "env_delete_file_nanos",
            PerfMetric::EnvFileExistsNanos => "env_file_exists_nanos",
            PerfMetric::EnvGetChildrenFileAttributesNanos => "env_get_children_file_attributes_nanos",
            PerfMetric::EnvGetChildrenNanos => "env_get_children_nanos",
            PerfMetric::EnvGetFileModificationTimeNanos => "env_get_file_modification_time_nanos",
            PerfMetric::EnvGetFileSizeNanos => "env_get_file_size_nanos",
            PerfMetric::EnvLinkFileNanos => "env_link_file_nanos",
            PerfMetric::EnvLockFileNanos => "env_lock_file_nanos",
            PerfMetric::EnvNewDirectoryNanos => "env_new_directory_nanos",
            PerfMetric::EnvNewLoggerNanos => "env_new_logger_nanos",
            PerfMetric::EnvNewRandomAccessFileNanos => "env_new_random_access_file_nanos",
            PerfMetric::EnvNewRandomRwFileNanos => "env_new_random_rw_file_nanos",
            PerfMetric::EnvNewSequentialFileNanos => "env_new_sequential_file_nanos",
            PerfMetric::EnvNewWritableFileNanos => "env_new_writable_file_nanos",
            PerfMetric::EnvRenameFileNanos => "env_rename_file_nanos",
            PerfMetric::EnvReuseWritableFileNanos => "env_reuse_writable_file_nanos",
            PerfMetric::EnvUnlockFileNanos => "env_unlock_file_nanos",
            PerfMetric::FilterBlockReadByte => "filter_block_read_byte",
            PerfMetric::FindNextUserEntryTime => "find_next_user_entry_time",
            PerfMetric::FindTableNanos => "find_table_nanos",
            PerfMetric::GetFromMemtableCount => "get_from_memtable_count",
            PerfMetric::GetFromMemtableTime => "get_from_memtable_time",
            PerfMetric::GetFromOutputFilesTime => "get_from_output_files_time",
            PerfMetric::GetPostProcessTime => "get_post_process_time",
            PerfMetric::GetReadBytes => "get_read_bytes",
            PerfMetric::GetSnapshotTime => "get_snapshot_time",
            PerfMetric::IndexBlockReadByte => "index_block_read_byte",
            PerfMetric::InternalDeleteSkippedCount => "internal_delete_skipped_count",
            PerfMetric::InternalKeySkippedCount => "internal_key_skipped_count",
            PerfMetric::InternalMergeCount => "internal_merge_count",
            PerfMetric::InternalMergePointLookupCount => "internal_merge_point_lookup_count",
            PerfMetric::InternalRangeDelReseekCount => "internal_range_del_reseek_count",
            PerfMetric::InternalRecentSkippedCount => "internal_recent_skipped_count",
            PerfMetric::IterReadBytes => "iter_read_bytes",
            PerfMetric::KeyLockWaitCount => "key_lock_wait_count",
            PerfMetric::KeyLockWaitTime => "key_lock_wait_time",
            PerfMetric::MergeOperatorTimeNanos => "merge_operator_time_nanos",
            PerfMetric::MetadataBlockReadByte => "metadata_block_read_byte",
            PerfMetric::MultigetReadBytes => "multiget_read_bytes",
            PerfMetric::NewTableBlockIterNanos => "new_table_block_iter_nanos",
            PerfMetric::NewTableIteratorNanos => "new_table_iterator_nanos",
            PerfMetric::NextOnMemtableCount => "next_on_memtable_count",
            PerfMetric::NumberAsyncSeek => "number_async_seek",
            PerfMetric::PrevOnMemtableCount => "prev_on_memtable_count",
            PerfMetric::ReadFilterBlockNanos => "read_filter_block_nanos",
            PerfMetric::ReadIndexBlockNanos => "read_index_block_nanos",
            PerfMetric::SeekChildSeekCount => "seek_child_seek_count",
            PerfMetric::SeekChildSeekTime => "seek_child_seek_time",
            PerfMetric::SeekInternalSeekTime => "seek_internal_seek_time",
            PerfMetric::SeekMaxHeapTime => "seek_max_heap_time",
            PerfMetric::SeekMinHeapTime => "seek_min_heap_time",
            PerfMetric::SeekOnMemtableCount => "seek_on_memtable_count",
            PerfMetric::SeekOnMemtableTime => "seek_on_memtable_time",
            PerfMetric::TotalMetricCount => "total_metric_count",
            PerfMetric::UserKeyComparisonCount => "user_key_comparison_count",
            PerfMetric::WriteDelayTime => "write_delay_time",
            PerfMetric::WriteMemtableTime => "write_memtable_time",
            PerfMetric::WritePreAndPostProcessTime => "write_pre_and_post_process_time",
            PerfMetric::WriteWalTime => "write_wal_time",
        }
    }
}