"""Model performans olcumu — gecikme, throughput, p95.

Kullanim:
    python 04_benchmark.py
"""

from evren_sdk import EvrenClient

client = EvrenClient(api_key="evren_xxxxx")

bench = client.benchmark(
    model="kullanici/smoke-detection",
    image="test.jpg",
    rounds=20,
    warmup_rounds=3,
    confidence=0.25,
    iou=0.45,
    image_size=640,
)

print("=" * 40)
print(f"  Model    : {bench.model}")
print(f"  Rounds   : {bench.rounds}")
print(f"  Avg      : {bench.avg_ms:>8.1f} ms")
print(f"  Min      : {bench.min_ms:>8.1f} ms")
print(f"  Max      : {bench.max_ms:>8.1f} ms")
print(f"  p95      : {bench.p95_ms:>8.1f} ms")
print(f"  FPS      : {bench.throughput_fps:>8.1f}")
print("=" * 40)
