Skip to content

Commit 37fa87a

Browse files
Report perf sampler failure dimensions
1 parent c816c7a commit 37fa87a

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

scripts/perf/server_soak.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ def sample_health(samples: list[dict[str, Any]], compose_project: str) -> dict[s
531531
return {
532532
"required": False,
533533
"unhealthy_samples": 0,
534+
"unhealthy_field_counts": {},
534535
"unhealthy_final_sample": False,
535536
}
536537

@@ -539,6 +540,10 @@ def sample_health(samples: list[dict[str, Any]], compose_project: str) -> dict[s
539540
"redis_sample_ok",
540541
"mysql_sample_ok",
541542
)
543+
unhealthy_field_counts = {
544+
field: sum(1 for row in samples if int(row.get(field) or 0) != 1)
545+
for field in required_ok_fields
546+
}
542547
unhealthy_indexes = [
543548
index
544549
for index, row in enumerate(samples)
@@ -549,6 +554,7 @@ def sample_health(samples: list[dict[str, Any]], compose_project: str) -> dict[s
549554
"required": True,
550555
"required_ok_fields": list(required_ok_fields),
551556
"unhealthy_samples": len(unhealthy_indexes),
557+
"unhealthy_field_counts": unhealthy_field_counts,
552558
"unhealthy_sample_indexes": unhealthy_indexes[:20],
553559
"unhealthy_final_sample": bool(unhealthy_indexes and unhealthy_indexes[-1] == len(samples) - 1),
554560
}
@@ -808,7 +814,8 @@ def main() -> int:
808814
if int(sampling_health.get("unhealthy_samples") or 0) > 0:
809815
failures.append(
810816
"resource sampling failed for "
811-
f"{sampling_health['unhealthy_samples']} compose-backed samples"
817+
f"{sampling_health['unhealthy_samples']} compose-backed samples "
818+
f"(field failures: {sampling_health.get('unhealthy_field_counts')})"
812819
)
813820
if max_server_memory_bytes > args.max_server_memory_mb * 1024 * 1024:
814821
failures.append(

tests/Unit/ServerPerfHarnessContractTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public function test_soak_summary_records_trusted_evidence_fields(): void
2727
'final_server_cache_keys_by_policy',
2828
'sampling_health',
2929
'resource sampling failed',
30+
'unhealthy_field_counts',
31+
'field failures:',
3032
'docker_stats_ok',
3133
'redis_sample_ok',
3234
'mysql_sample_ok',

0 commit comments

Comments
 (0)