MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / execute_benchmark

Function execute_benchmark

benchmarks/src/executor/local_executor.py:17–31  ·  view source on GitHub ↗
(descriptor: BenchmarkDescriptor, ctx: BenchmarkContext)

Source from the content-addressed store, hash-verified

15
16
17def execute_benchmark(descriptor: BenchmarkDescriptor, ctx: BenchmarkContext) -> BenchmarkResult:
18 env = descriptor.env_descriptor.create_environment(ctx.workdir)
19 workload = descriptor.workload
20
21 def run() -> WorkloadExecutionResult:
22 return workload.execute(env)
23
24 try:
25 with env:
26 result = with_timeout(run, timeout_s=ctx.timeout_s)
27 return Success(duration=result.duration)
28 except TimeoutException:
29 return Timeout(ctx.timeout_s)
30 except BaseException:
31 return Failure(traceback.format_exc())

Callers 2

executor_script.pyFile · 0.85
executeMethod · 0.85

Calls 5

with_timeoutFunction · 0.85
SuccessClass · 0.85
TimeoutClass · 0.85
FailureClass · 0.85
create_environmentMethod · 0.45

Tested by

no test coverage detected