add latency report
This commit is contained in:
parent
e14896400f
commit
f2d34dbf2e
2 changed files with 47 additions and 2 deletions
|
@ -2,6 +2,7 @@ from datetime import datetime
|
|||
from typing import Optional
|
||||
|
||||
import yaml
|
||||
import os
|
||||
|
||||
from frostfs_testlib.load.load_config import K6ProcessAllocationStrategy, LoadParams, LoadScenario
|
||||
from frostfs_testlib.load.load_metrics import get_metrics_object
|
||||
|
@ -109,6 +110,7 @@ class LoadReport:
|
|||
total_rate: float,
|
||||
throughput: float,
|
||||
errors: dict[str, int],
|
||||
latency: dict[str, dict],
|
||||
):
|
||||
throughput_html = ""
|
||||
if throughput > 0:
|
||||
|
@ -127,6 +129,15 @@ class LoadReport:
|
|||
):
|
||||
per_node_errors_html += self._row(f"At {node_key}", errors)
|
||||
|
||||
latency_html = ""
|
||||
if latency:
|
||||
for node_key, param_dict in latency.items():
|
||||
latency_values = ""
|
||||
for param_name, param_val in param_dict.items():
|
||||
latency_values += f"{param_name}={param_val:.2f}ms "
|
||||
|
||||
latency_html += self._row(f"Put latency {node_key.split(':')[0]}", latency_values)
|
||||
|
||||
object_size, object_size_unit = calc_unit(self.load_params.object_size, 1)
|
||||
duration = self._seconds_to_formatted_duration(self.load_params.load_time)
|
||||
model = self._get_model_string()
|
||||
|
@ -135,6 +146,7 @@ class LoadReport:
|
|||
errors_percent = 0
|
||||
if total_operations:
|
||||
errors_percent = total_errors/total_operations*100.0
|
||||
|
||||
html = f"""
|
||||
<table border="1" cellpadding="5px"><tbody>
|
||||
<tr><th colspan="2" bgcolor="gainsboro">{short_summary}</th></tr>
|
||||
|
@ -142,7 +154,7 @@ class LoadReport:
|
|||
{self._row("Total operations", total_operations)}
|
||||
{self._row("OP/sec", f"{total_rate:.2f}")}
|
||||
{throughput_html}
|
||||
|
||||
{latency_html}
|
||||
<tr><th colspan="2" bgcolor="gainsboro">Errors</th></tr>
|
||||
{per_node_errors_html}
|
||||
{self._row("Total", f"{total_errors} ({errors_percent:.2f}%)")}
|
||||
|
@ -160,6 +172,7 @@ class LoadReport:
|
|||
write_operations = 0
|
||||
write_op_sec = 0
|
||||
write_throughput = 0
|
||||
write_latency = {}
|
||||
write_errors = {}
|
||||
requested_write_rate = self.load_params.write_rate
|
||||
requested_write_rate_str = (
|
||||
|
@ -169,12 +182,14 @@ class LoadReport:
|
|||
read_operations = 0
|
||||
read_op_sec = 0
|
||||
read_throughput = 0
|
||||
read_latency = {}
|
||||
read_errors = {}
|
||||
requested_read_rate = self.load_params.read_rate
|
||||
requested_read_rate_str = f"{requested_read_rate}op/sec" if requested_read_rate else ""
|
||||
|
||||
delete_operations = 0
|
||||
delete_op_sec = 0
|
||||
delete_latency = {}
|
||||
delete_errors = {}
|
||||
requested_delete_rate = self.load_params.delete_rate
|
||||
requested_delete_rate_str = (
|
||||
|
@ -210,6 +225,7 @@ class LoadReport:
|
|||
if write_operations:
|
||||
write_section_required = True
|
||||
write_op_sec += metrics.write_rate
|
||||
write_latency[node_key] = metrics.write_latency
|
||||
write_throughput += metrics.write_throughput
|
||||
if metrics.write_failed_iterations:
|
||||
write_errors[node_key] = metrics.write_failed_iterations
|
||||
|
@ -219,6 +235,7 @@ class LoadReport:
|
|||
read_section_required = True
|
||||
read_op_sec += metrics.read_rate
|
||||
read_throughput += metrics.read_throughput
|
||||
read_latency[node_key] = metrics.read_latency
|
||||
if metrics.read_failed_iterations:
|
||||
read_errors[node_key] = metrics.read_failed_iterations
|
||||
|
||||
|
@ -226,6 +243,7 @@ class LoadReport:
|
|||
if delete_operations:
|
||||
delete_section_required = True
|
||||
delete_op_sec += metrics.delete_rate
|
||||
delete_latency[node_key] = metrics.delete_latency
|
||||
if metrics.delete_failed_iterations:
|
||||
delete_errors[node_key] = metrics.delete_failed_iterations
|
||||
|
||||
|
@ -238,6 +256,7 @@ class LoadReport:
|
|||
write_op_sec,
|
||||
write_throughput,
|
||||
write_errors,
|
||||
write_latency,
|
||||
)
|
||||
|
||||
if read_section_required:
|
||||
|
@ -249,6 +268,7 @@ class LoadReport:
|
|||
read_op_sec,
|
||||
read_throughput,
|
||||
read_errors,
|
||||
read_latency,
|
||||
)
|
||||
|
||||
if delete_section_required:
|
||||
|
@ -260,6 +280,7 @@ class LoadReport:
|
|||
delete_op_sec,
|
||||
0,
|
||||
delete_errors,
|
||||
delete_latency,
|
||||
)
|
||||
|
||||
return html
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue