]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/util/compaction_job_stats_impl.cc
import quincy beta 17.1.0
[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_NAMESPACE {
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_full_compaction = false;
24 is_manual_compaction = false;
25
26 total_input_bytes = 0;
27 total_output_bytes = 0;
28
29 num_records_replaced = 0;
30
31 total_input_raw_key_bytes = 0;
32 total_input_raw_value_bytes = 0;
33
34 num_input_deletion_records = 0;
35 num_expired_deletion_records = 0;
36
37 num_corrupt_keys = 0;
38
39 file_write_nanos = 0;
40 file_range_sync_nanos = 0;
41 file_fsync_nanos = 0;
42 file_prepare_write_nanos = 0;
43
44 smallest_output_key_prefix.clear();
45 largest_output_key_prefix.clear();
46
47 num_single_del_fallthru = 0;
48 num_single_del_mismatch = 0;
49 }
50
51 void CompactionJobStats::Add(const CompactionJobStats& stats) {
52 elapsed_micros += stats.elapsed_micros;
53 cpu_micros += stats.cpu_micros;
54
55 num_input_records += stats.num_input_records;
56 num_input_files += stats.num_input_files;
57 num_input_files_at_output_level += stats.num_input_files_at_output_level;
58
59 num_output_records += stats.num_output_records;
60 num_output_files += stats.num_output_files;
61
62 total_input_bytes += stats.total_input_bytes;
63 total_output_bytes += stats.total_output_bytes;
64
65 num_records_replaced += stats.num_records_replaced;
66
67 total_input_raw_key_bytes += stats.total_input_raw_key_bytes;
68 total_input_raw_value_bytes += stats.total_input_raw_value_bytes;
69
70 num_input_deletion_records += stats.num_input_deletion_records;
71 num_expired_deletion_records += stats.num_expired_deletion_records;
72
73 num_corrupt_keys += stats.num_corrupt_keys;
74
75 file_write_nanos += stats.file_write_nanos;
76 file_range_sync_nanos += stats.file_range_sync_nanos;
77 file_fsync_nanos += stats.file_fsync_nanos;
78 file_prepare_write_nanos += stats.file_prepare_write_nanos;
79
80 num_single_del_fallthru += stats.num_single_del_fallthru;
81 num_single_del_mismatch += stats.num_single_del_mismatch;
82 }
83
84 #else
85
86 void CompactionJobStats::Reset() {}
87
88 void CompactionJobStats::Add(const CompactionJobStats& /*stats*/) {}
89
90 #endif // !ROCKSDB_LITE
91
92 } // namespace ROCKSDB_NAMESPACE