YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/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
119k
void CompactionJobStats::Reset() {
28
119k
  elapsed_micros = 0;
29
30
119k
  num_input_records = 0;
31
119k
  num_input_files = 0;
32
119k
  num_input_files_at_output_level = 0;
33
34
119k
  num_output_records = 0;
35
119k
  num_output_files = 0;
36
37
119k
  is_manual_compaction = 0;
38
39
119k
  total_input_bytes = 0;
40
119k
  total_output_bytes = 0;
41
42
119k
  num_records_replaced = 0;
43
44
119k
  total_input_raw_key_bytes = 0;
45
119k
  total_input_raw_value_bytes = 0;
46
47
119k
  num_input_deletion_records = 0;
48
119k
  num_expired_deletion_records = 0;
49
50
119k
  num_corrupt_keys = 0;
51
52
119k
  file_write_nanos = 0;
53
119k
  file_range_sync_nanos = 0;
54
119k
  file_fsync_nanos = 0;
55
119k
  file_prepare_write_nanos = 0;
56
119k
}
57
58
11.3k
void CompactionJobStats::Add(const CompactionJobStats& stats) {
59
11.3k
  elapsed_micros += stats.elapsed_micros;
60
61
11.3k
  num_input_records += stats.num_input_records;
62
11.3k
  num_input_files += stats.num_input_files;
63
11.3k
  num_input_files_at_output_level += stats.num_input_files_at_output_level;
64
65
11.3k
  num_output_records += stats.num_output_records;
66
11.3k
  num_output_files += stats.num_output_files;
67
68
11.3k
  total_input_bytes += stats.total_input_bytes;
69
11.3k
  total_output_bytes += stats.total_output_bytes;
70
71
11.3k
  num_records_replaced += stats.num_records_replaced;
72
73
11.3k
  total_input_raw_key_bytes += stats.total_input_raw_key_bytes;
74
11.3k
  total_input_raw_value_bytes += stats.total_input_raw_value_bytes;
75
76
11.3k
  num_input_deletion_records += stats.num_input_deletion_records;
77
11.3k
  num_expired_deletion_records += stats.num_expired_deletion_records;
78
79
11.3k
  num_corrupt_keys += stats.num_corrupt_keys;
80
81
11.3k
  file_write_nanos += stats.file_write_nanos;
82
11.3k
  file_range_sync_nanos += stats.file_range_sync_nanos;
83
11.3k
  file_fsync_nanos += stats.file_fsync_nanos;
84
11.3k
  file_prepare_write_nanos += stats.file_prepare_write_nanos;
85
11.3k
}
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