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