]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/util/compaction_job_stats_impl.cc
bump version to 15.2.11-pve1
[ceph.git] / ceph / src / rocksdb / util / compaction_job_stats_impl.cc
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 #include "rocksdb/compaction_job_stats.h"
7
8 namespace rocksdb {
9
10 #ifndef ROCKSDB_LITE
11
12 void CompactionJobStats::Reset() {
13 elapsed_micros = 0;
14 cpu_micros = 0;
15
16 num_input_records = 0;
17 num_input_files = 0;
18 num_input_files_at_output_level = 0;
19
20 num_output_records = 0;
21 num_output_files = 0;
22
23 is_manual_compaction = 0;
24
25 total_input_bytes = 0;
26 total_output_bytes = 0;
27
28 num_records_replaced = 0;
29
30 total_input_raw_key_bytes = 0;
31 total_input_raw_value_bytes = 0;
32
33 num_input_deletion_records = 0;
34 num_expired_deletion_records = 0;
35
36 num_corrupt_keys = 0;
37
38 file_write_nanos = 0;
39 file_range_sync_nanos = 0;
40 file_fsync_nanos = 0;
41 file_prepare_write_nanos = 0;
42
43 num_single_del_fallthru = 0;
44 num_single_del_mismatch = 0;
45 }
46
47 void CompactionJobStats::Add(const CompactionJobStats& stats) {
48 elapsed_micros += stats.elapsed_micros;
49 cpu_micros += stats.cpu_micros;
50
51 num_input_records += stats.num_input_records;
52 num_input_files += stats.num_input_files;
53 num_input_files_at_output_level += stats.num_input_files_at_output_level;
54
55 num_output_records += stats.num_output_records;
56 num_output_files += stats.num_output_files;
57
58 total_input_bytes += stats.total_input_bytes;
59 total_output_bytes += stats.total_output_bytes;
60
61 num_records_replaced += stats.num_records_replaced;
62
63 total_input_raw_key_bytes += stats.total_input_raw_key_bytes;
64 total_input_raw_value_bytes += stats.total_input_raw_value_bytes;
65
66 num_input_deletion_records += stats.num_input_deletion_records;
67 num_expired_deletion_records += stats.num_expired_deletion_records;
68
69 num_corrupt_keys += stats.num_corrupt_keys;
70
71 file_write_nanos += stats.file_write_nanos;
72 file_range_sync_nanos += stats.file_range_sync_nanos;
73 file_fsync_nanos += stats.file_fsync_nanos;
74 file_prepare_write_nanos += stats.file_prepare_write_nanos;
75
76 num_single_del_fallthru += stats.num_single_del_fallthru;
77 num_single_del_mismatch += stats.num_single_del_mismatch;
78 }
79
80 #else
81
82 void CompactionJobStats::Reset() {}
83
84 void CompactionJobStats::Add(const CompactionJobStats& /*stats*/) {}
85
86 #endif // !ROCKSDB_LITE
87
88 } // namespace rocksdb