Prettify verifier messages for error rates #147

View file

@ -49,30 +49,20 @@ class LoadVerifier:
if deleters and not delete_operations: if deleters and not delete_operations:
issues.append(f"No any delete operation was performed") issues.append(f"No any delete operation was performed")
if ( error_rate = self._get_error_rate(writers, write_operations, write_errors)
write_operations if error_rate > self.load_params.error_threshold:
and writers rate_str = self._get_rate_str(error_rate)
and write_errors / write_operations * 100 > self.load_params.error_threshold issues.append(f"Write errors exceeded threshold: {rate_str} > {self.load_params.error_threshold}%")
):
issues.append( error_rate = self._get_error_rate(readers, read_operations, read_errors)
f"Write error rate is greater than threshold: {write_errors / write_operations * 100} > {self.load_params.error_threshold}" if error_rate > self.load_params.error_threshold:
) rate_str = self._get_rate_str(error_rate)
if ( issues.append(f"Read errors exceeded threshold: {rate_str} > {self.load_params.error_threshold}%")
read_operations
and readers error_rate = self._get_error_rate(deleters, delete_operations, delete_errors)
and read_errors / read_operations * 100 > self.load_params.error_threshold if error_rate > self.load_params.error_threshold:
): rate_str = self._get_rate_str(error_rate)
issues.append( issues.append(f"Delete errors exceeded threshold: {rate_str} > {self.load_params.error_threshold}%")
f"Read error rate is greater than threshold: {read_errors / read_operations * 100} > {self.load_params.error_threshold}"
)
if (
delete_operations
and deleters
and delete_errors / delete_operations * 100 > self.load_params.error_threshold
):
issues.append(
f"Delete error rate is greater than threshold: {delete_errors / delete_operations * 100} > {self.load_params.error_threshold}"
)
return issues return issues
@ -89,9 +79,17 @@ class LoadVerifier:
) )
return verify_issues return verify_issues
def _collect_verify_issues_on_process( def _get_error_rate(self, vus: int, operations: int, errors: int) -> float:
self, label, load_summary, verification_summary if not operations or not vus:
) -> list[str]: return 0
error_rate = errors / operations * 100
return error_rate
def _get_rate_str(self, rate: float, minimal: float = 0.01) -> str:
return f"{rate:.2f}%" if rate >= minimal else f"~{minimal}%"
def _collect_verify_issues_on_process(self, label, load_summary, verification_summary) -> list[str]:
issues = [] issues = []
load_metrics = get_metrics_object(self.load_params.scenario, load_summary) load_metrics = get_metrics_object(self.load_params.scenario, load_summary)