]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/include/rocksdb/compaction_job_stats.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / include / rocksdb / compaction_job_stats.h
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).
5
6 #pragma once
7 #include <stddef.h>
8 #include <stdint.h>
9
10 #include <string>
11
12 #include "rocksdb/rocksdb_namespace.h"
13
14 namespace ROCKSDB_NAMESPACE {
15 struct CompactionJobStats {
16 CompactionJobStats() { Reset(); }
17 void Reset();
18 // Aggregate the CompactionJobStats from another instance with this one
19 void Add(const CompactionJobStats& stats);
20
21 // the elapsed time of this compaction in microseconds.
22 uint64_t elapsed_micros;
23
24 // the elapsed CPU time of this compaction in microseconds.
25 uint64_t cpu_micros;
26
27 // the number of compaction input records.
28 uint64_t num_input_records;
29 // the number of blobs read from blob files
30 uint64_t num_blobs_read;
31 // the number of compaction input files (table files)
32 size_t num_input_files;
33 // the number of compaction input files at the output level (table files)
34 size_t num_input_files_at_output_level;
35
36 // the number of compaction output records.
37 uint64_t num_output_records;
38 // the number of compaction output files (table files)
39 size_t num_output_files;
40 // the number of compaction output files (blob files)
41 size_t num_output_files_blob;
42
43 // true if the compaction is a full compaction (all live SST files input)
44 bool is_full_compaction;
45 // true if the compaction is a manual compaction
46 bool is_manual_compaction;
47
48 // the total size of table files in the compaction input
49 uint64_t total_input_bytes;
50 // the total size of blobs read from blob files
51 uint64_t total_blob_bytes_read;
52 // the total size of table files in the compaction output
53 uint64_t total_output_bytes;
54 // the total size of blob files in the compaction output
55 uint64_t total_output_bytes_blob;
56
57 // number of records being replaced by newer record associated with same key.
58 // this could be a new value or a deletion entry for that key so this field
59 // sums up all updated and deleted keys
60 uint64_t num_records_replaced;
61
62 // the sum of the uncompressed input keys in bytes.
63 uint64_t total_input_raw_key_bytes;
64 // the sum of the uncompressed input values in bytes.
65 uint64_t total_input_raw_value_bytes;
66
67 // the number of deletion entries before compaction. Deletion entries
68 // can disappear after compaction because they expired
69 uint64_t num_input_deletion_records;
70 // number of deletion records that were found obsolete and discarded
71 // because it is not possible to delete any more keys with this entry
72 // (i.e. all possible deletions resulting from it have been completed)
73 uint64_t num_expired_deletion_records;
74
75 // number of corrupt keys (ParseInternalKey returned false when applied to
76 // the key) encountered and written out.
77 uint64_t num_corrupt_keys;
78
79 // Following counters are only populated if
80 // options.report_bg_io_stats = true;
81
82 // Time spent on file's Append() call.
83 uint64_t file_write_nanos;
84
85 // Time spent on sync file range.
86 uint64_t file_range_sync_nanos;
87
88 // Time spent on file fsync.
89 uint64_t file_fsync_nanos;
90
91 // Time spent on preparing file write (fallocate, etc)
92 uint64_t file_prepare_write_nanos;
93
94 // 0-terminated strings storing the first 8 bytes of the smallest and
95 // largest key in the output.
96 static const size_t kMaxPrefixLength = 8;
97
98 std::string smallest_output_key_prefix;
99 std::string largest_output_key_prefix;
100
101 // number of single-deletes which do not meet a put
102 uint64_t num_single_del_fallthru;
103
104 // number of single-deletes which meet something other than a put
105 uint64_t num_single_del_mismatch;
106
107 // TODO: Add output_to_penultimate_level output information
108 };
109 } // namespace ROCKSDB_NAMESPACE