Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

taskmgr: add headless PowerShell performance capture script - #1

Open
TheRainbowPhoenix wants to merge 1 commit into
masterfrom
codex/create-headless-taskmgr-in-powershell
Open

TheRainbowPhoenix wants to merge 1 commit into
masterfrom
codex/create-headless-taskmgr-in-powershell

Conversation

@TheRainbowPhoenix

Copy link
Copy Markdown
Owner

Motivation

  • Provide a headless way to capture the same Performance-tab style metrics Task Manager shows using APIs compatible with the TaskMgr implementation to avoid performance counter issues and allow timed captures.

Description

  • Add base/applications/taskmgr/taskmgr_headless.ps1, a headless PowerShell collector with parameters DurationSeconds, SampleIntervalMs, and OutputPath.
  • Use inline C# P/Invoke to call GetSystemTimes for CPU/user/kernel times and GetPerformanceInfo for commit/kernel/physical memory and totals to mirror Task Manager metrics.
  • Compute time deltas per sample to produce CPU usage and kernel CPU usage percentages, convert page counts to KB, round values, and record per-sample metrics.
  • Emit a small header plus a human-readable table of samples and write the output to the configured OutputPath.

Testing

  • Verified the new file base/applications/taskmgr/taskmgr_headless.ps1 was added to the tree and inspected its contents.
  • Attempted to run pwsh and powershell in this environment but both are unavailable here, so runtime execution/validation could not be performed.
  • No unit tests were added; only static inspection and basic environment checks were performed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant