forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.hh
113 lines (91 loc) · 2.8 KB
/
stats.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* Copyright (C) 2018 ScyllaDB
*/
/*
* This file is part of Scylla.
*
* Scylla is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Scylla is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Scylla. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
namespace sstables {
class sstables_stats {
static thread_local struct stats {
uint64_t partition_writes = 0;
uint64_t static_row_writes = 0;
uint64_t row_writes = 0;
uint64_t tombstone_writes = 0;
uint64_t range_tombstone_writes = 0;
uint64_t cell_writes = 0;
uint64_t cell_tombstone_writes = 0;
uint64_t single_partition_reads = 0;
uint64_t range_partition_reads = 0;
uint64_t sstable_partition_reads = 0;
uint64_t partition_reads = 0;
uint64_t partition_seeks = 0;
uint64_t row_reads = 0;
uint64_t capped_local_deletion_time = 0;
uint64_t capped_tombstone_deletion_time = 0;
} _shard_stats;
stats& _stats = _shard_stats;
public:
static const stats& get_shard_stats() {
return _shard_stats;
}
inline void on_partition_write() {
++_stats.partition_writes;
}
inline void on_static_row_write() {
++_stats.static_row_writes;
}
inline void on_row_write() {
++_stats.row_writes;
}
inline void on_tombstone_write() {
++_stats.tombstone_writes;
}
inline void on_range_tombstone_write() {
++_stats.range_tombstone_writes;
}
inline void on_cell_write() {
++_stats.cell_writes;
}
inline void on_cell_tombstone_write() {
++_stats.cell_tombstone_writes;
}
inline void on_single_partition_read() {
++_stats.single_partition_reads;
}
inline void on_range_partition_read() {
++_stats.range_partition_reads;
}
inline void on_sstable_partition_read() {
++_stats.sstable_partition_reads;
}
inline void on_partition_read() {
++_stats.partition_reads;
}
inline void on_partition_seek() {
++_stats.partition_seeks;
}
inline void on_row_read() {
++_stats.row_reads;
}
inline void on_capped_local_deletion_time() {
++_stats.capped_local_deletion_time;
}
inline void on_capped_tombstone_deletion_time() {
++_stats.capped_tombstone_deletion_time;
}
};
}