/Users/deen/code/yugabyte-db/src/yb/rocksdb/util/compaction_job_stats_impl.cc
Line | Count | Source |
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 | | // The following only applies to changes made to this file as part of YugaByte development. |
7 | | // |
8 | | // Portions Copyright (c) YugaByte, Inc. |
9 | | // |
10 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
11 | | // in compliance with the License. You may obtain a copy of the License at |
12 | | // |
13 | | // http://www.apache.org/licenses/LICENSE-2.0 |
14 | | // |
15 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
16 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
17 | | // or implied. See the License for the specific language governing permissions and limitations |
18 | | // under the License. |
19 | | // |
20 | | |
21 | | #include "yb/rocksdb/compaction_job_stats.h" |
22 | | |
23 | | namespace rocksdb { |
24 | | |
25 | | #ifndef ROCKSDB_LITE |
26 | | |
27 | 99.6k | void CompactionJobStats::Reset() { |
28 | 99.6k | elapsed_micros = 0; |
29 | | |
30 | 99.6k | num_input_records = 0; |
31 | 99.6k | num_input_files = 0; |
32 | 99.6k | num_input_files_at_output_level = 0; |
33 | | |
34 | 99.6k | num_output_records = 0; |
35 | 99.6k | num_output_files = 0; |
36 | | |
37 | 99.6k | is_manual_compaction = 0; |
38 | | |
39 | 99.6k | total_input_bytes = 0; |
40 | 99.6k | total_output_bytes = 0; |
41 | | |
42 | 99.6k | num_records_replaced = 0; |
43 | | |
44 | 99.6k | total_input_raw_key_bytes = 0; |
45 | 99.6k | total_input_raw_value_bytes = 0; |
46 | | |
47 | 99.6k | num_input_deletion_records = 0; |
48 | 99.6k | num_expired_deletion_records = 0; |
49 | | |
50 | 99.6k | num_corrupt_keys = 0; |
51 | | |
52 | 99.6k | file_write_nanos = 0; |
53 | 99.6k | file_range_sync_nanos = 0; |
54 | 99.6k | file_fsync_nanos = 0; |
55 | 99.6k | file_prepare_write_nanos = 0; |
56 | 99.6k | } |
57 | | |
58 | 10.6k | void CompactionJobStats::Add(const CompactionJobStats& stats) { |
59 | 10.6k | elapsed_micros += stats.elapsed_micros; |
60 | | |
61 | 10.6k | num_input_records += stats.num_input_records; |
62 | 10.6k | num_input_files += stats.num_input_files; |
63 | 10.6k | num_input_files_at_output_level += stats.num_input_files_at_output_level; |
64 | | |
65 | 10.6k | num_output_records += stats.num_output_records; |
66 | 10.6k | num_output_files += stats.num_output_files; |
67 | | |
68 | 10.6k | total_input_bytes += stats.total_input_bytes; |
69 | 10.6k | total_output_bytes += stats.total_output_bytes; |
70 | | |
71 | 10.6k | num_records_replaced += stats.num_records_replaced; |
72 | | |
73 | 10.6k | total_input_raw_key_bytes += stats.total_input_raw_key_bytes; |
74 | 10.6k | total_input_raw_value_bytes += stats.total_input_raw_value_bytes; |
75 | | |
76 | 10.6k | num_input_deletion_records += stats.num_input_deletion_records; |
77 | 10.6k | num_expired_deletion_records += stats.num_expired_deletion_records; |
78 | | |
79 | 10.6k | num_corrupt_keys += stats.num_corrupt_keys; |
80 | | |
81 | 10.6k | file_write_nanos += stats.file_write_nanos; |
82 | 10.6k | file_range_sync_nanos += stats.file_range_sync_nanos; |
83 | 10.6k | file_fsync_nanos += stats.file_fsync_nanos; |
84 | 10.6k | file_prepare_write_nanos += stats.file_prepare_write_nanos; |
85 | 10.6k | } |
86 | | |
87 | | #else |
88 | | |
89 | | void CompactionJobStats::Reset() {} |
90 | | |
91 | | void CompactionJobStats::Add(const CompactionJobStats& stats) {} |
92 | | |
93 | | #endif // !ROCKSDB_LITE |
94 | | |
95 | | } // namespace rocksdb |