Pcornel
Windows · Performance Monitoring

Performance Counters

Cheat sheet · https://pcornel.dk/topic.php?topic=3140

Back to the Topic

Answer

Performance counters are named metrics exposed by Windows and applications, like \Processor(_Total)\% Processor Time. Read them in Performance Monitor or with Get-Counter and typeperf.

Remember

  • Counters have objects, instances and names.
  • Get-Counter reads them from PowerShell.
  • typeperf logs them from cmd.

First checks

  • Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 2 -MaxSamples 5 — CPU
  • Get-Counter '\Memory\Available MBytes','\Memory\Pages/sec' — memory
  • Get-Counter '\PhysicalDisk(*)\Avg. Disk sec/Transfer','\PhysicalDisk(*)\Current Disk Queue Length' — disk latency/queue
  • Get-Counter '\Network Interface(*)\Bytes Total/sec' — network
  • resmon — Resource Monitor

Verify in this order

counters exposed by providers → sampled

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3140

Confirmation

Confirm action

Continue?