Skip to content

Commit 1d99222

Browse files
committed
TrackedOp: Make history_slow_op_threshold a float
It's already the case that osd_op_history_slow_op_threshold as well as the computed op duration are floating-point, but we were losing this precision within OpHistory. Fixes: https://tracker.ceph.com/issues/62169 Signed-off-by: Joshua Baergen <[email protected]>
1 parent 86b36a1 commit 1d99222

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/common/TrackedOp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void OpHistory::dump_slow_ops(utime_t now, Formatter *f, set<string> filters)
204204
cleanup(now);
205205
f->open_object_section("OpHistory slow ops");
206206
f->dump_int("num to keep", history_slow_op_size.load());
207-
f->dump_int("threshold to keep", history_slow_op_threshold.load());
207+
f->dump_float("threshold to keep", history_slow_op_threshold.load());
208208
{
209209
f->open_array_section("Ops");
210210
for (set<pair<utime_t, TrackedOpRef> >::const_iterator i =

src/common/TrackedOp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class OpHistory {
6767
std::atomic_size_t history_size{0};
6868
std::atomic_uint32_t history_duration{0};
6969
std::atomic_size_t history_slow_op_size{0};
70-
std::atomic_uint32_t history_slow_op_threshold{0};
70+
std::atomic<float> history_slow_op_threshold{0};
7171
std::atomic_bool shutdown{false};
7272
OpHistoryServiceThread opsvc;
7373
friend class OpHistoryServiceThread;
@@ -110,7 +110,7 @@ class OpHistory {
110110
history_size = new_size;
111111
history_duration = new_duration;
112112
}
113-
void set_slow_op_size_and_threshold(size_t new_size, uint32_t new_threshold) {
113+
void set_slow_op_size_and_threshold(size_t new_size, float new_threshold) {
114114
history_slow_op_size = new_size;
115115
history_slow_op_threshold = new_threshold;
116116
}
@@ -139,7 +139,7 @@ class OpTracker {
139139
void set_history_size_and_duration(uint32_t new_size, uint32_t new_duration) {
140140
history.set_size_and_duration(new_size, new_duration);
141141
}
142-
void set_history_slow_op_size_and_threshold(uint32_t new_size, uint32_t new_threshold) {
142+
void set_history_slow_op_size_and_threshold(uint32_t new_size, float new_threshold) {
143143
history.set_slow_op_size_and_threshold(new_size, new_threshold);
144144
}
145145
bool is_tracking() const {

0 commit comments

Comments
 (0)