MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / profiler_status

Function profiler_status

unity_cli/cli/commands/profiler.py:34–53  ·  view source on GitHub ↗

Show whether profiling is currently enabled and the captured frame range.

(
    ctx: typer.Context,
    json_flag: Annotated[
        bool,
        typer.Option("--json", help="Output as JSON"),
    ] = False,
)

Source from the content-addressed store, hash-verified

32
33@profiler_app.command("status")
34def profiler_status(
35 ctx: typer.Context,
36 json_flag: Annotated[
37 bool,
38 typer.Option("--json", help="Output as JSON"),
39 ] = False,
40) -> None:
41 """Show whether profiling is currently enabled and the captured frame range."""
42 context: CLIContext = ctx.obj
43 try:
44 result = context.client.profiler.status()
45 if _should_json(context, json_flag):
46 print_json(result)
47 else:
48 enabled = result.get("enabled", False)
49 status_text = "[green]running[/green]" if enabled else "[dim]stopped[/dim]"
50 print_line(f"Profiler: {status_text}")
51 print_line(f"Frame range: {result.get('firstFrameIndex', -1)} - {result.get('lastFrameIndex', -1)}")
52 except UnityCLIError as e:
53 _handle_error(e)
54
55
56@profiler_app.command("start")

Callers

nothing calls this directly

Calls 6

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
print_lineFunction · 0.90
_handle_errorFunction · 0.90
statusMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected