Add benchmark detection script and related tests; refactor settings and update project scripts
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user