Add benchmark detection script and related tests; refactor settings and update project scripts

This commit is contained in:
2026-06-01 11:01:53 +02:00
parent a89886186f
commit 9d8a8a8a45
6 changed files with 262 additions and 20 deletions
+19
View File
@@ -0,0 +1,19 @@
import pytest
from arbitrade.detection.benchmark import run_incremental_detection_benchmark
def test_incremental_detection_benchmark_returns_metrics() -> None:
result = run_incremental_detection_benchmark(iterations=500)
assert result.iterations == 500
assert result.total_ms > 0.0
assert result.avg_ms > 0.0
assert result.p50_ms > 0.0
assert result.p95_ms > 0.0
assert result.max_ms >= result.p95_ms
def test_incremental_detection_benchmark_rejects_invalid_iterations() -> None:
with pytest.raises(ValueError, match="iterations"):
run_incremental_detection_benchmark(iterations=0)