Skip to content

Commit

Permalink
improvement(perf_simple_query): add validation rules for Argus
Browse files Browse the repository at this point in the history
When sending perf_simple_query benchmark results, Argus will validate
numbers based on all history (submitted to Argus). Current approach
validates only 10 last results.

closes: #9578
  • Loading branch information
soyacz authored and fruch committed Jan 11, 2025
1 parent 6355082 commit 5fe7ebd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
8 changes: 2 additions & 6 deletions microbenchmarking_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,14 @@ def test_perf_simple_query(self):
result = self.db_cluster.nodes[0].remoter.run(
"scylla perf-simple-query --json-result=perf-simple-query-result.txt --smp 1 -m 1G")
if result.ok:
regression_report = {}
output = self.db_cluster.nodes[0].remoter.run("cat perf-simple-query-result.txt").stdout
results = json.loads(output)
self.create_test_stats(
specific_tested_stats={"perf_simple_query_result": results},
doc_id_with_timestamp=True)
if self.create_stats:
is_gce = self.params.get('cluster_backend') == 'gce'
regression_report = PerfSimpleQueryAnalyzer(self._test_index, self._es_doc_type).check_regression(
PerfSimpleQueryAnalyzer(self._test_index, self._es_doc_type).check_regression(
self._test_id, is_gce=is_gce,
extra_jobs_to_compare=self.params.get('perf_extra_jobs_to_compare'))
send_perf_simple_query_result_to_argus(self.test_config.argus_client(),
results,
regression_report.get("scylla_date_results_table", [])
)
send_perf_simple_query_result_to_argus(self.test_config.argus_client(), results)
16 changes: 7 additions & 9 deletions sdcm/argus_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def send_result_to_argus(argus_client: ArgusClient, workload: str, name: str, de
submit_results_to_argus(argus_client, result_table)


def send_perf_simple_query_result_to_argus(argus_client: ArgusClient, result: dict, previous_results: list = None):
def send_perf_simple_query_result_to_argus(argus_client: ArgusClient, result: dict):
stats = result["stats"]
workload = result["test_properties"]["type"]
parameters = result["parameters"]
Expand All @@ -234,17 +234,15 @@ class Meta:
ColumnMetadata(name="tasks_per_op", unit="", type=ResultType.FLOAT, higher_is_better=False),
]

def _get_status_based_on_previous_results(metric: str):
if previous_results is None:
return Status.PASS
if all((result.get(f"is_{metric}_within_limits", True) for result in previous_results)):
return Status.PASS
else:
return Status.ERROR
ValidationRules = {
"allocs_per_op": ValidationRule(best_pct=5),
"cpu_cycles_per_op": ValidationRule(best_pct=5),
"instructions_per_op": ValidationRule(best_pct=5),
}

result_table = PerfSimpleQueryResult()
for key, value in stats.items():
result_table.add_result(column=key, row="#1", value=value, status=_get_status_based_on_previous_results(key))
result_table.add_result(column=key, row="#1", value=value, status=Status.UNSET)
submit_results_to_argus(argus_client, result_table)


Expand Down

0 comments on commit 5fe7ebd

Please sign in to comment.