Typeperf
Updated: January 21, 2005
Syntax
Parameters
Remarks
- Counter path format
The general format for counter paths is as follows: [\\Computer]\Object[Parent/Instance#Index]\Counter] where the parent, instance, index, and counter components of the format may contain either a valid name or a wildcard character. The computer, parent, instance, and index components are not necessary for all counters.
You determine the counter paths to use based on the counter itself. For example, the LogicalDisk object has an instance Index, so you must provide the #Index or a wildcard. Therefore, you could use the following format:
\LogicalDisk(*/*#*)\*
In comparison, the Process object does not require an instance Index. Therefore, you could use the following format:
\Process(*)\ID Process
The following is a list of the possible formats:
- \\computer\object(parent/instance#index)\counter
- \\computer\object(parent/instance)\counter
- \\computer\object(instance#index)\counter
- \\computer\object(instance)\counter
- \\computer\object\counter
- \object(parent/instance#index)\counter
- \object(parent/instance)\counter
- \object(instance#index)\counter
- \object(instance)\counter
- \object\counter
If a wildcard character is specified in the parent name, all instances of the specified object that match the specified instance and counter fields will be returned.
If a wildcard character is specified in the instance name, all instances of the specified object and parent object will be returned if all instance names corresponding to the specified index match the wildcard character.
If a wildcard character is specified in the counter name, all counters of the specified object are returned.
Partial counter path string matches (for example, pro*) are not supported.
- Query formats
For counter path queries, type:
Typeperf [{-q | -qx [\\Computer\] [Object] [-o OutputFile}]
Use the following commands for complete queries:
Typeperf [\\Computer]\Object[Instance]\Counter]
Typeperf-cfInputFile
-
Using the -config option
The contents of the setting file used with the -config option should have the following format:
[CommandOption]
Value
where CommandOption is a command line option and Value specifies its value. For example:
[c]
\\Windows\mypath
[o]
report.csv
[s]
mysystem
- For more information about incorporating Typeperf into your Windows Management Instrumentation (WMI) scripts, see "Scripting WMI" at the Microsoft Windows Resource Kits Web site .
Examples
typeperf "\Memory\Available bytes" "\processor(_total)\% processor time"
To display Explorer process counters every three seconds in a CSV-output file format, type:
typeperf "\Process(Explorer)\Thread Count" -si 3 -o typeperf.csv
To display 50 samples of RAS counters on computer Server_name, type:
typeperf "\RAS port(LPT1)\Bytes Transmitted" -sc 50 -s Server_name
To display counter values for 50 samples of the counters listed in the file Input.txt, at sample intervals of 120 seconds, type:
typeperf -cf input.txt -si 120 -sc 50 -f TSV -o domain2.tsv
To query installed counters with instances, type the following command. Be aware that the -qx parameter will return a far greater number of performance counters than the -q parameter.
typeperf -qx
To query physical disk counters without instances on computer Server5 and write them to a file called Diskctrs.txt, type:
typeperf -q \\Server5\PhysicalDisk -o diskctrs.txt
Formatting legend
Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |