Coverage Report

Created: 2024-09-08 07:17

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