TypePerf.exe: Performance Data in the Command Window | Previous | Next
The following examples show how to format TypePerf queries based on information from the Add to Chart dialog box in System Monitor.
The simplest query has the form:
typeperf update-interval "\performance-object\counter"
The following query directs TypePerf to display the Memory: Available Bytes counter on the local computer every 30 seconds.
typeperf 30 "\Memory\Available bytes"
This query is based on the Available Bytes counter shown in the System Monitor Add to Chart dialog box.
If the counter you are monitoring belongs to an instance of the performance object, specify the instance in parentheses, as shown in the following query format:
typeperf update-interval "\performance-object(instance)\counter"
The following query directs TypePerf to display the Processor: % Processor Time counter on the local computer every three seconds. Please note that even though this computer has only one processor, you must include the instance number (0) in the query because the Processor performance object can have instances.
typeperf 3 "\Processor(0)\% processor time"
This query is based upon the % Processor Time counter shown in the System Monitor Add to Chart dialog box.
If the instance is an instance of a parent object, specify the parent object before the instance, preceded by a forward slash, as shown in the following query format:
typeperf update-interval "\performance-object(parent-object/instance)\counter"
The following query directs TypePerf to display the LogicalDisk: % Disk Time counter for the E: logical drive. The E: drive is on the computer's second physical disk, designated disk 1. Because the logical disk is a child of the physical disk, you must specify the parent object, the child object, and the instance in the counter path.
typeperf 10 "\LogicalDisk(1/E:)\% Disk Time"
This query is based upon the % Disk Time counter shown in the System Monitor Add to Chart dialog box.
To monitor a counter on another computer, specify the computer name before the instance, preceded by two backslashes, as shown in the following query format:
typeperf update-interval "\\computer\performance-object(instance)\counter"
The following query directs TypePerf to display the Process: Thread Count counter for the Windows Explorer process on another computer every 10 seconds.
typeperf 10 "\\Compu12\Process(Explorer)\Thread Count"
This query is based upon the Thread Count counter shown in the System Monitor Add to Chart dialog box.
This compound query has the following format:
typeperf update-interval "\object(instance)\counter" "\object\counter"
The following compound query directs TypePerf to display the PhysicalDisk: % Disk Time and Cache: Read Ahead counters every five seconds.
typeperf 5 "\PhysicalDisk(1)\% Disk Time" "\Cache\Read Aheads/sec"
Note
Each counter path is enclosed in quotation marks and the two counter paths are separated from each other by a space.
This compound query is based on the % Disk Time and Read Ahead/sec counters shown in the System Monitor Add to Chart dialog box.
You can direct TypePerf to write the response to your query to a text file (.txt) or to a comma-separated, variable-length format file (.csv). You can then view the TypePerf response in a text editor or spreadsheet program.
Note
Don't forget to press a key to stop TypePerf. This data can accumulate quickly.
To direct TypePerf output to a file, append the DOS redirection character ">" and the file name to your TypePerf query. If the file you specify doesn't exist, TypePerf creates it for you. If the file already exists, TypePerf deletes the previous contents of the file and writes the new data to it.
This query has the following format:
typeperf update-interval "counter-path" > filename
The following query directs TypePerf to write its response to a simple query to the Typeperf.csv file:
typeperf 1 "\Processor(0)\% Processor Time" > typeperf.csv
After TypePerf stops, you can view the resulting file in a text editor or spreadsheet program.