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