Results from a single benchmark run.
| 96 | |
| 97 | @dataclass |
| 98 | class BenchmarkResult: |
| 99 | """Results from a single benchmark run.""" |
| 100 | scenario: str |
| 101 | config: dict |
| 102 | total_requests: int = 0 |
| 103 | successful: int = 0 |
| 104 | failed: int = 0 |
| 105 | errors: list[str] = field(default_factory=list) |
| 106 | duration_sec: float = 0.0 |
| 107 | requests_per_sec: float = 0.0 |
| 108 | latency_ms: LatencyStats = field(default_factory=LatencyStats) |
| 109 | |
| 110 | def to_dict(self) -> dict: |
| 111 | """Convert to dictionary for JSON serialization.""" |
| 112 | d = asdict(self) |
| 113 | d['latency_ms'] = asdict(self.latency_ms) |
| 114 | return d |
| 115 | |
| 116 | |
| 117 | class MockConfig: |
no outgoing calls
no test coverage detected