<< " -> "
<< TierAgentState::get_flush_mode_name(flush_mode)
<< dendl;
- if (flush_mode == TierAgentState::FLUSH_MODE_HIGH)
+ if (flush_mode == TierAgentState::FLUSH_MODE_HIGH) {
osd->agent_inc_high_count();
- if (agent_state->flush_mode == TierAgentState::FLUSH_MODE_HIGH)
+ info.stats.stats.sum.num_flush_mode_high = 1;
+ } else if (flush_mode == TierAgentState::FLUSH_MODE_LOW) {
+ info.stats.stats.sum.num_flush_mode_low = 1;
+ }
+ if (agent_state->flush_mode == TierAgentState::FLUSH_MODE_HIGH) {
osd->agent_dec_high_count();
+ info.stats.stats.sum.num_flush_mode_high = 0;
+ } else if (agent_state->flush_mode == TierAgentState::FLUSH_MODE_LOW) {
+ info.stats.stats.sum.num_flush_mode_low = 0;
+ }
agent_state->flush_mode = flush_mode;
}
if (evict_mode != agent_state->evict_mode) {
requeue_ops(waiting_for_cache_not_full);
requeued = true;
}
+ if (evict_mode == TierAgentState::EVICT_MODE_SOME) {
+ info.stats.stats.sum.num_evict_mode_some = 1;
+ } else if (evict_mode == TierAgentState::EVICT_MODE_FULL) {
+ info.stats.stats.sum.num_evict_mode_full = 1;
+ }
+ if (agent_state->evict_mode == TierAgentState::EVICT_MODE_SOME) {
+ info.stats.stats.sum.num_evict_mode_some = 0;
+ } else if (agent_state->evict_mode == TierAgentState::EVICT_MODE_FULL) {
+ info.stats.stats.sum.num_evict_mode_full = 0;
+ }
agent_state->evict_mode = evict_mode;
}
uint64_t old_effort = agent_state->evict_effort;
f->dump_int("num_evict", num_evict);
f->dump_int("num_evict_kb", num_evict_kb);
f->dump_int("num_promote", num_promote);
+ f->dump_int("num_flush_mode_high", num_flush_mode_high);
+ f->dump_int("num_flush_mode_low", num_flush_mode_low);
+ f->dump_int("num_evict_mode_some", num_evict_mode_some);
+ f->dump_int("num_evict_mode_full", num_evict_mode_full);
}
void object_stat_sum_t::encode(bufferlist& bl) const
{
- ENCODE_START(12, 3, bl);
+ ENCODE_START(13, 3, bl);
::encode(num_bytes, bl);
::encode(num_objects, bl);
::encode(num_object_clones, bl);
::encode(num_evict, bl);
::encode(num_evict_kb, bl);
::encode(num_promote, bl);
+ ::encode(num_flush_mode_high, bl);
+ ::encode(num_flush_mode_low, bl);
+ ::encode(num_evict_mode_some, bl);
+ ::encode(num_evict_mode_full, bl);
ENCODE_FINISH(bl);
}
void object_stat_sum_t::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(12, 3, 3, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(13, 3, 3, bl);
::decode(num_bytes, bl);
if (struct_v < 3) {
uint64_t num_kb;
num_evict_kb = 0;
num_promote = 0;
}
+ if (struct_v >= 13) {
+ ::decode(num_flush_mode_high, bl);
+ ::decode(num_flush_mode_low, bl);
+ ::decode(num_evict_mode_some, bl);
+ ::decode(num_evict_mode_full, bl);
+ } else {
+ num_flush_mode_high = 0;
+ num_flush_mode_low = 0;
+ num_evict_mode_some = 0;
+ num_evict_mode_full = 0;
+ }
DECODE_FINISH(bl);
}
a.num_evict = 7;
a.num_evict_kb = 8;
a.num_promote = 9;
+ a.num_flush_mode_high = 0;
+ a.num_flush_mode_low = 1;
+ a.num_evict_mode_some = 1;
+ a.num_evict_mode_full = 0;
o.push_back(new object_stat_sum_t(a));
}
num_evict += o.num_evict;
num_evict_kb += o.num_evict_kb;
num_promote += o.num_promote;
+ num_flush_mode_high += o.num_flush_mode_high;
+ num_flush_mode_low += o.num_flush_mode_low;
+ num_evict_mode_some += o.num_evict_mode_some;
+ num_evict_mode_full += o.num_evict_mode_full;
}
void object_stat_sum_t::sub(const object_stat_sum_t& o)
num_evict -= o.num_evict;
num_evict_kb -= o.num_evict_kb;
num_promote -= o.num_promote;
+ num_flush_mode_high -= o.num_flush_mode_high;
+ num_flush_mode_low -= o.num_flush_mode_low;
+ num_evict_mode_some -= o.num_evict_mode_some;
+ num_evict_mode_full -= o.num_evict_mode_full;
}
bool operator==(const object_stat_sum_t& l, const object_stat_sum_t& r)
l.num_flush_kb == r.num_flush_kb &&
l.num_evict == r.num_evict &&
l.num_evict_kb == r.num_evict_kb &&
- l.num_promote == r.num_promote;
+ l.num_promote == r.num_promote &&
+ l.num_flush_mode_high == r.num_flush_mode_high &&
+ l.num_flush_mode_low == r.num_flush_mode_low &&
+ l.num_evict_mode_some == r.num_evict_mode_some &&
+ l.num_evict_mode_full == r.num_evict_mode_full;
}
// -- object_stat_collection_t --
int64_t num_evict;
int64_t num_evict_kb;
int64_t num_promote;
+ int32_t num_flush_mode_high; // 1 when in high flush mode, otherwise 0
+ int32_t num_flush_mode_low; // 1 when in low flush mode, otherwise 0
+ int32_t num_evict_mode_some; // 1 when in evict some mode, otherwise 0
+ int32_t num_evict_mode_full; // 1 when in evict full mode, otherwise 0
object_stat_sum_t()
: num_bytes(0),
num_flush_kb(0),
num_evict(0),
num_evict_kb(0),
- num_promote(0)
+ num_promote(0),
+ num_flush_mode_high(0), num_flush_mode_low(0),
+ num_evict_mode_some(0), num_evict_mode_full(0)
{}
void floor(int64_t f) {
FLOOR(num_evict);
FLOOR(num_evict_kb);
FLOOR(num_promote);
+ FLOOR(num_flush_mode_high);
+ FLOOR(num_flush_mode_low);
+ FLOOR(num_evict_mode_some);
+ FLOOR(num_evict_mode_full);
#undef FLOOR
}
SPLIT(num_evict);
SPLIT(num_evict_kb);
SPLIT(num_promote);
+ SPLIT(num_flush_mode_high);
+ SPLIT(num_flush_mode_low);
+ SPLIT(num_evict_mode_some);
+ SPLIT(num_evict_mode_full);
#undef SPLIT
}