std::array<uint32_t,3> times;
std::array<uint32_t,3> min;
std::array<uint32_t,3> max;
+ uint32_t last;
bool operator<(const mgr_ping_time_t& rhs) const {
if (pingtime < rhs.pingtime)
item.max[0] = j.second.back_max[0];
item.max[1] = j.second.back_max[1];
item.max[2] = j.second.back_max[2];
+ item.last = j.second.back_last;
item.back = true;
sorted.emplace(item);
}
+ if (j.second.front_last == 0)
+ continue;
item.pingtime = std::max(j.second.front_pingtime[0], j.second.front_pingtime[1]);
item.pingtime = std::max(item.pingtime, j.second.front_pingtime[2]);
- if (item.pingtime == 0)
- continue;
if (!value || item.pingtime >= value) {
item.from = i.first;
item.to = j.first;
item.max[0] = j.second.front_max[0];
item.max[1] = j.second.front_max[1];
item.max[2] = j.second.front_max[2];
+ item.last = j.second.front_last;
item.back = false;
sorted.emplace(item);
}
f->dump_unsigned("5min", sitem.max[1]);
f->dump_unsigned("15min", sitem.max[2]);
f->close_section(); // max
+ f->dump_unsigned("last", sitem.last);
f->close_section(); // entry
}
f->close_section(); // entries
std::array<uint32_t,3> times;
std::array<uint32_t,3> min;
std::array<uint32_t,3> max;
+ uint32_t last;
bool operator<(const osd_ping_time_t& rhs) const {
if (pingtime < rhs.pingtime)
item.max[0] = j.second.back_max[0];
item.max[1] = j.second.back_max[1];
item.max[2] = j.second.back_max[2];
+ item.last = j.second.back_last;
item.back = true;
sorted.emplace(item);
}
- if (j.second.front_pingtime[0] == 0)
+ if (j.second.front_last == 0)
continue;
item.pingtime = std::max(j.second.front_pingtime[0], j.second.front_pingtime[1]);
item.pingtime = std::max(item.pingtime, j.second.front_pingtime[2]);
item.max[0] = j.second.front_max[0];
item.max[1] = j.second.front_max[1];
item.max[2] = j.second.front_max[2];
+ item.last = j.second.front_last;
item.back = false;
sorted.emplace(item);
}
f->dump_int("5min", sitem.max[1]);
f->dump_int("15min", sitem.max[2]);
f->close_section(); // max
+ f->dump_int("last", sitem.last);
f->close_section(); // entry
}
f->close_section(); // entries
if (i->second.hb_interval_start == utime_t())
i->second.hb_interval_start = now;
if (now - i->second.hb_interval_start >= utime_t(hb_avg, 0)) {
- uint32_t back_pingtime = i->second.hb_total_back / i->second.hb_average_count;
+ uint32_t back_avg = i->second.hb_total_back / i->second.hb_average_count;
uint32_t back_min = i->second.hb_min_back;
uint32_t back_max = i->second.hb_max_back;
- uint32_t front_pingtime = i->second.hb_total_front / i->second.hb_average_count;
+ uint32_t front_avg = i->second.hb_total_front / i->second.hb_average_count;
uint32_t front_min = i->second.hb_min_front;
uint32_t front_max = i->second.hb_max_front;
// Based on osd_heartbeat_interval ignoring that it is randomly short than this interval
if (i->second.hb_back_pingtime.size() < hb_vector_size) {
ceph_assert(i->second.hb_front_pingtime.size() == i->second.hb_back_pingtime.size());
- i->second.hb_back_pingtime.push_back(back_pingtime);
+ i->second.hb_back_pingtime.push_back(back_avg);
i->second.hb_back_min.push_back(back_min);
i->second.hb_back_max.push_back(back_max);
- i->second.hb_front_pingtime.push_back(front_pingtime);
+ i->second.hb_front_pingtime.push_back(front_avg);
i->second.hb_front_min.push_back(front_min);
i->second.hb_front_max.push_back(front_max);
} else {
int index = i->second.hb_index & (hb_vector_size - 1);
- i->second.hb_back_pingtime[index] = back_pingtime;
+ i->second.hb_back_pingtime[index] = back_avg;
i->second.hb_back_min[index] = back_min;
i->second.hb_back_max[index] = back_max;
- i->second.hb_front_pingtime[index] = front_pingtime;
+ i->second.hb_front_pingtime[index] = front_avg;
i->second.hb_front_min[index] = front_min;
i->second.hb_front_max[index] = front_max;
}
{
std::lock_guard l(service.stat_lock);
+ service.osd_stat.hb_pingtime[from].back_last = back_pingtime;
+
uint32_t total = 0;
uint32_t min = UINT_MAX;
uint32_t max = 0;
}
if (i->second.con_front != NULL) {
+ service.osd_stat.hb_pingtime[from].front_last = front_pingtime;
+
total = 0;
min = UINT_MAX;
max = 0;
}
}
}
+ } else {
+ std::lock_guard l(service.stat_lock);
+ service.osd_stat.hb_pingtime[from].back_last = back_pingtime;
+ if (i->second.con_front != NULL)
+ service.osd_stat.hb_pingtime[from].front_last = front_pingtime;
}
i->second.ping_history.erase(i->second.ping_history.begin(), ++acked);
}
f->dump_int("5min", i.second.back_max[1]);
f->dump_int("15min", i.second.back_max[2]);
f->close_section(); // max
+ f->dump_int("last", i.second.back_last);
f->close_section(); // interface
if (i.second.front_pingtime[0] != 0) {
f->dump_int("5min", i.second.front_max[1]);
f->dump_int("15min", i.second.front_max[2]);
f->close_section(); // max
+ f->dump_int("last", i.second.front_last);
f->close_section(); // interface
}
f->close_section(); // interfaces
encode(i.second.back_max[0], bl);
encode(i.second.back_max[1], bl);
encode(i.second.back_max[2], bl);
+ encode(i.second.back_last, bl);
encode(i.second.front_pingtime[0], bl);
encode(i.second.front_pingtime[1], bl);
encode(i.second.front_pingtime[2], bl);
encode(i.second.front_max[0], bl);
encode(i.second.front_max[1], bl);
encode(i.second.front_max[2], bl);
+ encode(i.second.front_last, bl);
}
ENCODE_FINISH(bl);
}
decode(ifs.back_max[0],bl);
decode(ifs.back_max[1], bl);
decode(ifs.back_max[2], bl);
+ decode(ifs.back_last, bl);
decode(ifs.front_pingtime[0], bl);
decode(ifs.front_pingtime[1], bl);
decode(ifs.front_pingtime[2], bl);
decode(ifs.front_max[0], bl);
decode(ifs.front_max[1], bl);
decode(ifs.front_max[2], bl);
+ decode(ifs.front_last, bl);
hb_pingtime[osd] = ifs;
}
}
o.back()->os_alerts[1].emplace(
"some alert2", "some alert2 details");
struct Interfaces gen_interfaces = {
- { 1000, 900, 800 }, { 990, 890, 790 }, { 1010, 910, 810 },
- { 1100, 1000, 900 }, { 1090, 990, 890 }, { 1110, 1010, 910 } };
+ { 1000, 900, 800 }, { 990, 890, 790 }, { 1010, 910, 810 }, 1001,
+ { 1100, 1000, 900 }, { 1090, 990, 890 }, { 1110, 1010, 910 }, 1101 };
o.back()->hb_pingtime[20] = gen_interfaces;
gen_interfaces = {
- { 100, 200, 300 }, { 90, 190, 290 }, { 110, 210, 310 } };
+ { 100, 200, 300 }, { 90, 190, 290 }, { 110, 210, 310 }, 101 };
o.back()->hb_pingtime[30] = gen_interfaces;
}
uint32_t back_pingtime[3];
uint32_t back_min[3];
uint32_t back_max[3];
+ uint32_t back_last;
uint32_t front_pingtime[3];
uint32_t front_min[3];
uint32_t front_max[3];
+ uint32_t front_last;
};
map<int, Interfaces> hb_pingtime; ///< map of osd id to Interfaces