ceph bench module hotfixes after client run
Related-PROD: PROD-37028
Change-Id: Ie281746adfedc8706c26d3a27347679d070c45bb
diff --git a/cfg_checker/modules/ceph/bench.py b/cfg_checker/modules/ceph/bench.py
index 95e39bf..f5af704 100644
--- a/cfg_checker/modules/ceph/bench.py
+++ b/cfg_checker/modules/ceph/bench.py
@@ -212,7 +212,8 @@
logger_cli.info("-> Done creating agents")
# TODO: Update after implementing pooled task sending
- self.scheduled_delay = self.agent_count * 10
+ # idea is to have time to schedule task to each agent every 5 sec max
+ self.scheduled_delay = self.agent_count * 5
logger_cli.info(
"-> Schedule delay set to {} sec".format(self.scheduled_delay)
)
@@ -400,7 +401,7 @@
_fcnt = len(finished)
_tcnt = len(_sts)
if _fcnt < _tcnt:
- tw.cl_inline(" {}/{}".format(_fcnt, _tcnt))
+ tw.cl_inline("; {}/{}".format(_fcnt, _tcnt))
else:
tw.cl_flush(newline=True)
logger_cli.info("-> All agents finished run")
@@ -739,13 +740,22 @@
_j = _d["jobs"][0]
_r_bw += _j["read"]["bw_bytes"]
_r_avglat += [_j["read"]["lat_ns"]["mean"]]
- _r_95clat += [_j["read"]["clat_ns"]["percentile"]["95.000000"]]
_r_iops += _j["read"]["iops"]
_w_bw += _j["write"]["bw_bytes"]
_w_avglat += [_j["write"]["lat_ns"]["mean"]]
- _w_95clat += \
- [_j["write"]["clat_ns"]["percentile"]["95.000000"]]
_w_iops += _j["write"]["iops"]
+ # check for percentiles
+ if "percentile" in _j["read"]["clat_ns"]:
+ _r_95clat += \
+ [_j["read"]["clat_ns"]["percentile"]["95.000000"]]
+ else:
+ _r_95clat += []
+ if "percentile" in _j["write"]["clat_ns"]:
+ _w_95clat += \
+ [_j["write"]["clat_ns"]["percentile"]["95.000000"]]
+ else:
+ _w_95clat += []
+
# Save storage class name
if "storage_class" not in _totals:
_totals["storage_class"] = \
diff --git a/cfg_checker/modules/ceph/info.py b/cfg_checker/modules/ceph/info.py
index 1fb9205..ce115ff 100644
--- a/cfg_checker/modules/ceph/info.py
+++ b/cfg_checker/modules/ceph/info.py
@@ -79,8 +79,9 @@
continue
else:
# TODO: Consider filtering out or prepare data for the table
- _osd = _d.pop("osd_name")
- _node_name = _d.pop("node_name")
+ _osd = _d.pop("osd_name") if "osd_name" in _d else "unknown"
+ _node_name = _d.pop("node_name") \
+ if "node_name" in _d else "unknown"
# Additional check for empty data
if not _d:
self.ceph_info['ceph_health']['latest'][_n] = {}
diff --git a/templates/ceph_bench_html.j2 b/templates/ceph_bench_html.j2
index 1a9e994..4e04560 100644
--- a/templates/ceph_bench_html.j2
+++ b/templates/ceph_bench_html.j2
@@ -605,10 +605,18 @@
<td class="col_bench">
<div class="bench_run_group">
<div class="item bench">{{ j["read"]["bw_bytes"] | to_mb }}</div>
+ {% if "percentile" in j["read"]["clat_ns"] %}
<div class="item bench">{{ "%0.2f" | format(j["read"]["lat_ns"]["mean"]|float / 1000) }} / {{ "%0.2f" | format(j["read"]["clat_ns"]["percentile"]["95.000000"]|float / 1000) }}</div>
+ {% else %}
+ <div class="item bench">{{ "%0.2f" | format(j["read"]["lat_ns"]["mean"]|float / 1000) }} / -</div>
+ {% endif %}
<div class="item bench">{{ "%0.2f" | format(j["read"]["iops"]|float) }}</div>
<div class="item bench">{{ j["write"]["bw_bytes"] | to_mb }}</div>
+ {% if "percentile" in j["write"]["clat_ns"] %}
<div class="item bench">{{ "%0.2f" | format(j["write"]["lat_ns"]["mean"]|float / 1000) }} / {{ "%0.2f" | format(j["write"]["clat_ns"]["percentile"]["95.000000"]|float / 1000) }}</div>
+ {% else %}
+ <div class="item bench">{{ "%0.2f" | format(j["write"]["lat_ns"]["mean"]|float / 1000) }} / -</div>
+ {% endif %}
<div class="item bench">{{ "%0.2f" | format(j["write"]["iops"]|float) }}</div>
</div>
</td>