Run warmup operations to stabilize connections.
(self)
| 592 | return (end - start) * 1000 # Convert to milliseconds |
| 593 | |
| 594 | async def warmup(self) -> None: |
| 595 | """Run warmup operations to stabilize connections.""" |
| 596 | print(f" Warming up for {self.config.warmup_seconds}s...") |
| 597 | end_time = time.monotonic() + self.config.warmup_seconds |
| 598 | while time.monotonic() < end_time: |
| 599 | await self._run_operation() |
| 600 | self.latencies.clear() |
| 601 | self.errors = 0 |
| 602 | self.first_error = None |
| 603 | self._key_counter = 0 |
| 604 | self._message_counter = 0 |
| 605 | |
| 606 | def _sample_resources(self) -> None: |
| 607 | """Sample current CPU and memory usage.""" |
no test coverage detected