Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bench-orchestrator/bench_orchestrator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def run(
iterations: Annotated[int, typer.Option("--iterations", "-i", help="Iterations per query")] = 5,
label: Annotated[str | None, typer.Option("--label", "-l", help="Label for this run")] = None,
track_memory: Annotated[bool, typer.Option("--track-memory", help="Track memory usage")] = False,
samply: Annotated[bool, typer.Option("--samply", help="Record a profile using samply")] = False,
build: Annotated[bool, typer.Option("--build/--no-build", help="Build binaries before running")] = True,
verbose: Annotated[bool, typer.Option("--verbose", "-v", help="Log underlying commands")] = False,
options: Annotated[list[str] | None, typer.Option("--opt", help="Engine or benchmark specific options")] = None,
Expand Down Expand Up @@ -150,6 +151,7 @@ def run(
iterations=iterations,
options=options,
track_memory=track_memory,
samply=samply,
on_result=ctx.write_raw_json,
)
console.print(f"[green]{eng.value}: {len(results)} results[/green]")
Expand Down
4 changes: 4 additions & 0 deletions bench-orchestrator/bench_orchestrator/runner/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def run(
iterations: int = 5,
options: dict[str, str] | None = None,
track_memory: bool = False,
samply: bool = False,
on_result: Callable[[str], None] | None = None,
) -> list[str]:
"""
Expand Down Expand Up @@ -74,6 +75,9 @@ def run(
for k, v in options.items():
cmd.extend(["--opt", f"{k}={v}"])

if samply:
cmd = ["samply", "record", "--"] + cmd

if self.verbose:
console.print(f"[dim]$ {' '.join(cmd)}[/dim]")

Expand Down
Loading