Knighthawk
Knighthawk

Reputation:

How to get CPU Utilization metrics in Windows Xp?

I need to get CPU utilization metrics of all the process.

Operating system = Windows Xp programming language = Java requirements = need to take samples every few seconds indefinitely, not just for one snapshot in time.

Upvotes: 1

Views: 1004

Answers (2)

using typeperf we can get process based metrics in windows

syntax :

typeperf "\Process(processname)\% Processor Time" "\Process(processname)\%ID Process"

example :

typeperf "\Process(svchost)\% Processor Time" "\Process(svchost)\%ID Process"

Note : Process will have several counters . so we can mention those metrics also.

use perfmon tool in windows to get those counters.

use perfmon command in run to use perfmon tool.

Counters will be depended on type of metrics like Processor, Memory , Process etc

Upvotes: 0

paxdiablo
paxdiablo

Reputation: 882626

WMI is the tool of choice for all Windows measurement stuff. I've written VB Script code that will periodically query the WMI interface to retrieve CPU information, disk information and all sorts of other things.

The Win32_Process class is the one you're looking for, and this page details how to do it in Java using a free tool called JACOB (Java COM Bridge).

Upvotes: 1

Related Questions