pub struct CompactionJobStats<'a> { /* private fields */ }Expand description
What one compaction job did, borrowed from the event that reported it.
Read from a compaction job info or a subcompaction job info. Counters that are not applicable to the compaction, or that RocksDB was not asked to collect, read back as 0.
Implementations§
Source§impl<'a> CompactionJobStats<'a>
impl<'a> CompactionJobStats<'a>
Sourcepub fn elapsed_micros(&self) -> u64
pub fn elapsed_micros(&self) -> u64
Wall clock time this compaction took, in microseconds.
Sourcepub fn cpu_micros(&self) -> u64
pub fn cpu_micros(&self) -> u64
CPU time this compaction took, in microseconds.
Sourcepub fn has_accurate_num_input_records(&self) -> bool
pub fn has_accurate_num_input_records(&self) -> bool
Whether Self::num_input_records is accurate across all subcompactions.
Sourcepub fn num_input_records(&self) -> u64
pub fn num_input_records(&self) -> u64
Number of compaction input records. Only trustworthy when
Self::has_accurate_num_input_records is true.
Sourcepub fn num_blobs_read(&self) -> u64
pub fn num_blobs_read(&self) -> u64
Number of blobs read from blob files.
Sourcepub fn num_input_files(&self) -> usize
pub fn num_input_files(&self) -> usize
Number of compaction input files, counting table files only.
Sourcepub fn num_input_files_at_output_level(&self) -> usize
pub fn num_input_files_at_output_level(&self) -> usize
Number of compaction input table files that were already at the output level.
Sourcepub fn num_filtered_input_files(&self) -> usize
pub fn num_filtered_input_files(&self) -> usize
Number of compaction input files filtered out by compaction optimizations.
Sourcepub fn num_filtered_input_files_at_output_level(&self) -> usize
pub fn num_filtered_input_files_at_output_level(&self) -> usize
Number of compaction input files at the output level that were filtered out by compaction optimizations.
Sourcepub fn num_output_records(&self) -> u64
pub fn num_output_records(&self) -> u64
Number of compaction output records.
Sourcepub fn num_output_files(&self) -> usize
pub fn num_output_files(&self) -> usize
Number of compaction output table files.
Sourcepub fn num_output_files_blob(&self) -> usize
pub fn num_output_files_blob(&self) -> usize
Number of compaction output blob files.
Sourcepub fn is_full_compaction(&self) -> bool
pub fn is_full_compaction(&self) -> bool
Whether this was a full compaction, meaning every live SST file was an input.
Sourcepub fn is_manual_compaction(&self) -> bool
pub fn is_manual_compaction(&self) -> bool
Whether this was a manual compaction.
Sourcepub fn is_remote_compaction(&self) -> bool
pub fn is_remote_compaction(&self) -> bool
Whether the compaction ran in a remote worker.
Only the compaction completed event carries the truth. On the compaction begin event
RocksDB sets this to true whenever a compaction_service is configured, before it
knows whether the job will really be scheduled remotely or fall back to local.
Sourcepub fn total_input_bytes(&self) -> u64
pub fn total_input_bytes(&self) -> u64
Total size of the table files in the compaction input.
Sourcepub fn total_skipped_input_bytes(&self) -> u64
pub fn total_skipped_input_bytes(&self) -> u64
Total size of the input table files that were skipped because compaction optimizations filtered them out.
Sourcepub fn total_blob_bytes_read(&self) -> u64
pub fn total_blob_bytes_read(&self) -> u64
Total size of the blobs read from blob files.
Sourcepub fn total_output_bytes(&self) -> u64
pub fn total_output_bytes(&self) -> u64
Total size of the table files in the compaction output.
Sourcepub fn total_output_bytes_blob(&self) -> u64
pub fn total_output_bytes_blob(&self) -> u64
Total size of the blob files in the compaction output.
Sourcepub fn num_input_files_trivially_moved(&self) -> usize
pub fn num_input_files_trivially_moved(&self) -> usize
Number of input files that were trivially moved rather than rewritten.
Sourcepub fn num_records_replaced(&self) -> u64
pub fn num_records_replaced(&self) -> u64
Number of records superseded by a newer record for the same key. Counts both updates and deletions.
Sourcepub fn total_input_raw_key_bytes(&self) -> u64
pub fn total_input_raw_key_bytes(&self) -> u64
Sum of the uncompressed input keys, in bytes.
Sourcepub fn total_input_raw_value_bytes(&self) -> u64
pub fn total_input_raw_value_bytes(&self) -> u64
Sum of the uncompressed input values, in bytes.
Sourcepub fn num_input_deletion_records(&self) -> u64
pub fn num_input_deletion_records(&self) -> u64
Number of deletion entries before the compaction. Deletion entries can disappear during compaction because they expired.
Sourcepub fn num_expired_deletion_records(&self) -> u64
pub fn num_expired_deletion_records(&self) -> u64
Number of deletion records dropped as obsolete because every deletion they could still cause has already happened.
Sourcepub fn num_corrupt_keys(&self) -> u64
pub fn num_corrupt_keys(&self) -> u64
Number of corrupt keys encountered and written out, meaning keys that failed to parse as internal keys.
Sourcepub fn file_write_nanos(&self) -> u64
pub fn file_write_nanos(&self) -> u64
Time spent in file Append calls, in nanoseconds.
Only populated when
report_bg_io_stats is on.
Sourcepub fn file_range_sync_nanos(&self) -> u64
pub fn file_range_sync_nanos(&self) -> u64
Time spent syncing file ranges, in nanoseconds.
Only populated when
report_bg_io_stats is on.
Sourcepub fn file_fsync_nanos(&self) -> u64
pub fn file_fsync_nanos(&self) -> u64
Time spent in file fsync, in nanoseconds.
Only populated when
report_bg_io_stats is on.
Sourcepub fn file_prepare_write_nanos(&self) -> u64
pub fn file_prepare_write_nanos(&self) -> u64
Time spent preparing file writes, such as fallocate, in nanoseconds.
Only populated when
report_bg_io_stats is on.
Sourcepub fn smallest_output_key_prefix(&self) -> &'a [u8] ⓘ
pub fn smallest_output_key_prefix(&self) -> &'a [u8] ⓘ
First 8 bytes of the smallest user key in the output, or fewer if the key is shorter.
Empty when the compaction wrote no table files.
Sourcepub fn largest_output_key_prefix(&self) -> &'a [u8] ⓘ
pub fn largest_output_key_prefix(&self) -> &'a [u8] ⓘ
First 8 bytes of the largest user key in the output, or fewer if the key is shorter.
Empty when the compaction wrote no table files.
Sourcepub fn num_single_del_fallthru(&self) -> u64
pub fn num_single_del_fallthru(&self) -> u64
Number of single deletes that did not meet a put.
Sourcepub fn num_single_del_mismatch(&self) -> u64
pub fn num_single_del_mismatch(&self) -> u64
Number of single deletes that met something other than a put.