MCPcopy
hub / github.com/redis/redis-py / warmup

Method warmup

benchmarks/otel_benchmark.py:594–604  ·  view source on GitHub ↗

Run warmup operations to stabilize connections.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers 2

run_iteration_asyncFunction · 0.95

Calls 3

_run_operationMethod · 0.95
monotonicMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected