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

Function run_iteration_async

benchmarks/otel_benchmark.py:1128–1150  ·  view source on GitHub ↗

Run a single async benchmark iteration using the AsyncComprehensiveLoadGenerator. Args: scenario: The scenario name config: Load generator configuration description: Description of the scenario Returns: BenchmarkResult from the async comprehensive load

(scenario: str, config: LoadGeneratorConfig, description: str)

Source from the content-addressed store, hash-verified

1126
1127
1128async def run_iteration_async(scenario: str, config: LoadGeneratorConfig, description: str) -> BenchmarkResult:
1129 """
1130 Run a single async benchmark iteration using the AsyncComprehensiveLoadGenerator.
1131
1132 Args:
1133 scenario: The scenario name
1134 config: Load generator configuration
1135 description: Description of the scenario
1136
1137 Returns:
1138 BenchmarkResult from the async comprehensive load generator
1139 """
1140 generator = AsyncComprehensiveLoadGenerator(config)
1141 await generator.setup()
1142 try:
1143 await generator.warmup()
1144 result = await generator.run()
1145 result.scenario = scenario
1146 result.metadata["description"] = description
1147 result.metadata["client_type"] = "async"
1148 return result
1149 finally:
1150 await generator.teardown()
1151
1152
1153def main() -> int:

Callers 1

_run_async_benchmarkFunction · 0.85

Calls 5

setupMethod · 0.95
warmupMethod · 0.95
runMethod · 0.95
teardownMethod · 0.95

Tested by

no test coverage detected