Improve docs coverage and refresh profiling parser artifacts
Add domain-specific XML documentation across src server components to satisfy CommentChecker, and update dotTrace parsing outputs used for diagnostics.
This commit is contained in:
@@ -21,6 +21,29 @@ def parse_args() -> argparse.Namespace:
|
||||
parser.add_argument("snapshot", help="Path to the .dtp snapshot index file.")
|
||||
parser.add_argument("--out", help="Write JSON to this file.")
|
||||
parser.add_argument("--stdout", action="store_true", help="Write JSON to stdout.")
|
||||
parser.add_argument("--top", type=int, default=200, help="Maximum hotspot and path entries to emit.")
|
||||
parser.add_argument("--filter", dest="name_filter", help="Case-insensitive substring filter for node names.")
|
||||
parser.add_argument(
|
||||
"--flat",
|
||||
"--paths",
|
||||
dest="flat_paths",
|
||||
action="store_true",
|
||||
help="Include the top heaviest call paths as flat strings.",
|
||||
)
|
||||
idle_group = parser.add_mutually_exclusive_group()
|
||||
idle_group.add_argument(
|
||||
"--exclude-idle",
|
||||
dest="exclude_idle",
|
||||
action="store_true",
|
||||
default=True,
|
||||
help="Exclude idle and wait methods from hotspot and path rankings.",
|
||||
)
|
||||
idle_group.add_argument(
|
||||
"--include-idle",
|
||||
dest="exclude_idle",
|
||||
action="store_false",
|
||||
help="Keep idle and wait methods in hotspot and path rankings.",
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
@@ -51,8 +74,14 @@ def build_helper(dottrace_dir: Path) -> None:
|
||||
raise RuntimeError(result.stderr.strip() or result.stdout.strip() or "dotnet build failed")
|
||||
|
||||
|
||||
def run_helper(snapshot: Path, dottrace_dir: Path) -> dict:
|
||||
command = ["dotnet", str(HELPER_DLL), str(snapshot)]
|
||||
def run_helper(snapshot: Path, dottrace_dir: Path, args: argparse.Namespace) -> dict:
|
||||
command = ["dotnet", str(HELPER_DLL), str(snapshot), "--top", str(args.top)]
|
||||
if args.name_filter:
|
||||
command.extend(["--filter", args.name_filter])
|
||||
if args.flat_paths:
|
||||
command.append("--flat")
|
||||
if not args.exclude_idle:
|
||||
command.append("--include-idle")
|
||||
env = os.environ.copy()
|
||||
env["DOTTRACE_APP_DIR"] = str(dottrace_dir)
|
||||
result = subprocess.run(command, cwd=ROOT, capture_output=True, text=True, check=False, env=env)
|
||||
@@ -74,7 +103,7 @@ def main() -> int:
|
||||
try:
|
||||
dottrace_dir = find_dottrace_dir()
|
||||
build_helper(dottrace_dir)
|
||||
payload = run_helper(snapshot, dottrace_dir)
|
||||
payload = run_helper(snapshot, dottrace_dir, args)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
print(str(exc), file=sys.stderr)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user