Computer and Software Support


Typeperf

This page is from Microsoft

Updated: January 21, 2005

Writes performance counter data to the command window, or to a supported log file format. To stop Typeperf, press CTRL+C.
 
 
Syntax
Typeperf [Path [Path ...]] [-cf FileName][-f {csv | tsv | bin}][-si [MM:]SS][-o FileName][-q [Object]][-qx [Object]][-sc Samples][-config FileName][-s ComputerName] [-y]
Parameters
-c {Path[ Path ...] | -cfFileName}
Specifies the performance counter path to log. To list multiple counter paths, separate each command path by a space.
-cfFileName
Specifies the file name of the file that contains the counter paths that you want to monitor, one per line.
-f {csv| tsv| bin}
Specifies the output file format. File formats are csv (comma-delimited), tsv (tab-delimited), and bin (binary). Default format is csv.
-si [MM:]SS
Specifies the time between samples, in the [MM:]SS format. Default is one second.
-oFileName
Specifies the pathname of the output file. Defaults to Stdout.
-q [Object]
Displays and queries available counters without instances. To display counters for one object, include the object name.
-qx [Object]
Displays and queries all available counters with instances. To display counters for one object, include the object name.
-scSamples
Specifies the number of samples to collect. Default is to sample until you press CTRL+C.
-configFileName
Specifies the pathname of the settings file that contains command line parameters.
-sComputerName
Specifies the system to monitor if no server is specified in the counter path.
-y
Use this option to answer yes to all questions without prompting.
/?
Displays help at the command prompt.
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
To display processor and memory counters, type:

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