/src/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 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 | 9.78k | void CompactionJobStats::Reset() { |
11 | 9.78k | elapsed_micros = 0; |
12 | 9.78k | cpu_micros = 0; |
13 | | |
14 | 9.78k | has_accurate_num_input_records = true; |
15 | 9.78k | num_input_records = 0; |
16 | 9.78k | num_blobs_read = 0; |
17 | 9.78k | num_input_files = 0; |
18 | 9.78k | num_input_files_at_output_level = 0; |
19 | 9.78k | num_filtered_input_files = 0; |
20 | 9.78k | num_filtered_input_files_at_output_level = 0; |
21 | | |
22 | 9.78k | num_output_records = 0; |
23 | 9.78k | num_output_files = 0; |
24 | 9.78k | num_output_files_blob = 0; |
25 | | |
26 | 9.78k | is_full_compaction = false; |
27 | 9.78k | is_manual_compaction = false; |
28 | 9.78k | is_remote_compaction = false; |
29 | | |
30 | 9.78k | total_input_bytes = 0; |
31 | 9.78k | total_blob_bytes_read = 0; |
32 | 9.78k | total_output_bytes = 0; |
33 | 9.78k | total_output_bytes_blob = 0; |
34 | 9.78k | total_skipped_input_bytes = 0; |
35 | | |
36 | 9.78k | num_records_replaced = 0; |
37 | | |
38 | 9.78k | total_input_raw_key_bytes = 0; |
39 | 9.78k | total_input_raw_value_bytes = 0; |
40 | | |
41 | 9.78k | num_input_deletion_records = 0; |
42 | 9.78k | num_expired_deletion_records = 0; |
43 | | |
44 | 9.78k | num_corrupt_keys = 0; |
45 | | |
46 | 9.78k | file_write_nanos = 0; |
47 | 9.78k | file_range_sync_nanos = 0; |
48 | 9.78k | file_fsync_nanos = 0; |
49 | 9.78k | file_prepare_write_nanos = 0; |
50 | | |
51 | 9.78k | smallest_output_key_prefix.clear(); |
52 | 9.78k | largest_output_key_prefix.clear(); |
53 | | |
54 | 9.78k | num_single_del_fallthru = 0; |
55 | 9.78k | num_single_del_mismatch = 0; |
56 | 9.78k | } |
57 | | |
58 | 3.42k | void CompactionJobStats::Add(const CompactionJobStats& stats) { |
59 | 3.42k | elapsed_micros += stats.elapsed_micros; |
60 | 3.42k | cpu_micros += stats.cpu_micros; |
61 | | |
62 | 3.42k | has_accurate_num_input_records &= stats.has_accurate_num_input_records; |
63 | 3.42k | num_input_records += stats.num_input_records; |
64 | 3.42k | num_blobs_read += stats.num_blobs_read; |
65 | 3.42k | num_input_files += stats.num_input_files; |
66 | 3.42k | num_input_files_at_output_level += stats.num_input_files_at_output_level; |
67 | 3.42k | num_filtered_input_files += stats.num_filtered_input_files; |
68 | 3.42k | num_filtered_input_files_at_output_level += |
69 | 3.42k | stats.num_filtered_input_files_at_output_level; |
70 | | |
71 | 3.42k | num_output_records += stats.num_output_records; |
72 | 3.42k | num_output_files += stats.num_output_files; |
73 | 3.42k | num_output_files_blob += stats.num_output_files_blob; |
74 | | |
75 | 3.42k | total_input_bytes += stats.total_input_bytes; |
76 | 3.42k | total_blob_bytes_read += stats.total_blob_bytes_read; |
77 | 3.42k | total_output_bytes += stats.total_output_bytes; |
78 | 3.42k | total_output_bytes_blob += stats.total_output_bytes_blob; |
79 | 3.42k | total_skipped_input_bytes += stats.total_skipped_input_bytes; |
80 | | |
81 | 3.42k | num_records_replaced += stats.num_records_replaced; |
82 | | |
83 | 3.42k | total_input_raw_key_bytes += stats.total_input_raw_key_bytes; |
84 | 3.42k | total_input_raw_value_bytes += stats.total_input_raw_value_bytes; |
85 | | |
86 | 3.42k | num_input_deletion_records += stats.num_input_deletion_records; |
87 | 3.42k | num_expired_deletion_records += stats.num_expired_deletion_records; |
88 | | |
89 | 3.42k | num_corrupt_keys += stats.num_corrupt_keys; |
90 | | |
91 | 3.42k | file_write_nanos += stats.file_write_nanos; |
92 | 3.42k | file_range_sync_nanos += stats.file_range_sync_nanos; |
93 | 3.42k | file_fsync_nanos += stats.file_fsync_nanos; |
94 | 3.42k | file_prepare_write_nanos += stats.file_prepare_write_nanos; |
95 | | |
96 | 3.42k | num_single_del_fallthru += stats.num_single_del_fallthru; |
97 | 3.42k | num_single_del_mismatch += stats.num_single_del_mismatch; |
98 | | |
99 | 3.42k | is_remote_compaction |= stats.is_remote_compaction; |
100 | 3.42k | } |
101 | | |
102 | | } // namespace ROCKSDB_NAMESPACE |