'MCP port of the running trace server. Defaults to 5748.'
).argParser(parseValidPositiveInteger)
)
.addOption(
newOption(
'--tool <tool>',
'Tool to call: "query_spans" (default) lists spans, "flat_profile" sums time and allocations by name across a subtree, "memory_timeline" shows committed memory and RSS over time with phase markers.'
'Span ID to enumerate children of. Omit for root level.'
'Span ID to enumerate children of (or, for flat_profile and memory_timeline, to scope to). Omit for root level.'
)
)
.addOption(
...
...
@@ -833,8 +839,18 @@ internal
.addOption(
newOption(
'--sort <mode>',
'Sort mode: "value" for corrected duration descending, "name" for alphabetical, "allocations" for total allocated bytes descending, "persistent-allocations" for persistentAllocations descending.'
'Sort mode. query_spans: "value" for corrected duration descending, "name" for alphabetical, "allocations" for total allocated bytes descending, "persistent-allocations" for persistentAllocations descending. flat_profile: "self" (default), "total", "self-allocations", "self-persistent-allocations" or "count".'
).choices([
'value',
'name',
'allocations',
'persistent-allocations',
'self',
'total',
'self-allocations',
'self-persistent-allocations',
'count',
])
)
.addOption(
newOption(
...
...
@@ -842,19 +858,55 @@ internal
'Substring filter on span name/category. Searches the whole subtree below --parent.'
)
)
.addOption(
newOption(
'--recursive',
'List every span in the subtree below --parent, as if --search matched everything.'
)
)
.addOption(
newOption(
'--max-depth <depth>',
'Levels to descend for --search and --depth (default 32, also the cap).'
'Levels to descend for --search and --recursive (default unlimited).'
).argParser(parseValidPositiveInteger)
)
.addOption(
newOption(
'--depth <depth>',
'Levels of descendants to nest inline under each span (default 1).'
'Levels of descendants to nest inline under each span (default 1, max 32).'
).argParser(parseValidPositiveInteger)
)
.addOption(
newOption(
'--start <ticks>',
'memory_timeline: absolute start in ticks (10 ns), overriding --parent.'
).argParser(parseValidPositiveInteger)
)
.addOption(
newOption(
'--end <ticks>',
'memory_timeline: absolute end in ticks (10 ns), overriding --parent.'
).argParser(parseValidPositiveInteger)
)
.addOption(
newOption(
'--max-samples <count>',
'memory_timeline: samples to downsample to (default 100, max 2000).'
).argParser(parseValidPositiveInteger)
)
.addOption(
newOption(
'--max-phases <count>',
'memory_timeline: phases to list (default 20, max 200).'
).argParser(parseValidPositiveInteger)
)
.addOption(newOption('--json','Output as JSON instead of markdown.'))
.addOption(
newOption(
'--fields <fields>',
'query_spans: comma-separated span fields to return (plus id), e.g. "name,args". Implies --json and allows --page-size up to 10000.'
)
)
.addOption(
newOption('--page <page>','Page number (1-based, default 1).').argParser(
parseValidPositiveInteger
...
...
@@ -863,12 +915,16 @@ internal
.addOption(
newOption(
'--page-size <size>',
'Spans per page (default 20, max 500).'
'Spans per page (default 20, max 500, or 10000 with --fields).'