5. Tracking Performance with the TypePerf Utility
You don't have to
use the graphical interface to view performance data in real time. The
TypePerf utility provides continuously updated performance data in a
command window in text format. The display updates at the specified rate
until you press Ctrl+C to stop it. This utility uses the following
syntax:
TypePerf <counter [counter ...]> [options]
TypePerf -cf <filename> [options]
TypePerf -q [object] [options]
TypePerf -qx [object] [options]
The following list describes each of the command line arguments.
counter
Specifies one
or more performance counters to display. Each performance counter has a
path that begins with the counter object, specific counter, and finally
the instance. Consequently, the \Process(_Total)\% Processor Time counter path would collect the _Total instance of the % Processor Time
counter found in the Processor object. Make sure you place each counter
path in double quotes. The counter path can include wildcard
characters. Here's a list of acceptable counter path formats.
\\machine\object(parent/instance#index)\counter
\\machine\object(parent/instance)\counter
\\machine\object(instance#index)\counter
\\machine\object(instance)\counter
\\machine\object\counter
\object(parent/instance#index)\counter
\object(parent/instance)\counter
\object(instance#index)\counter
\object(instance)\counter
\object\counter
-f { Bin | Bincirc | CSV | TSV | SQL }
Defines the log format for the output. You can choose between binary, circular binary, CSV, TSV, and SQL.
-cf
Filename
Specifies a file
containing a list of performance counters to collect. Each counter path
must appear on a separate line. The default for the TypePerf utility is
CSV.
-si
[[hh:]mm:]ss
Defines the sample interval (how often the system samples the counter) for the collection. The default is 1 second.
-o { Filename | DSN!Log }
Specifies
the output information for the collection. You can use an output file by
specifying a path and filename. As an alternative, you can specify a
SQL database (for any vendor that supports SQL) by including the ODBC
DSN and the log set name within the SQL database. The default
setting is to use a file with the same name as the performance
collection and a BLG extension for counters or an ETL extension for
traces. The default output is STDOUT (the display).
-q
[object]
Lists the installed
counters. If you want to see the counters for a specific object, include
the object name (such as Process). This command line switch doesn't
list counter instances.
-qx
[object]
Lists the
installed counters with instances. If you want to see the counters for a
specific object, include the object name (such as Process).
-sc
samples
Defines the number of samples to collect. The default setting collects samples until you press Ctrl+C.
-config
Filename
Specifies a configuration filename that contains all of the command line options.
-s
computer
Performs the task on a remote system. The default setting uses the local system.
-y
Answers
yes to all questions without prompting. This feature lets you set up
counters and traces within a batch file without worrying about
interruptions.
6. Removing Performance Counters with the UnlodCtr Utility
The UnlodCtr utility unloads counters from memory. This utility uses the following syntax:
UNLODCTR [\\computername] driver
The following list describes each of the command line arguments.
computername
Specifies the name of a
remote computer. You must have access to the computer through Windows.
This utility doesn't provide any means of specifying a username or
password for the remote computer.
driver
Defines the name of the driver that you want to unload. Unloading a driver removes all its entries from the registry.