TypePerf.exe is a command-line tool that includes outputting performance counter data from the Windows operating system to a command window or writing to a log file format that supports that feature.
Get counter information with the following two parameters:
-Q [Object] lists the installed counters (no examples). : Typeperf–q All counters
-QX [Object] lists the installed counters (with examples). : Typeperf–qx All counter information with examples.
Example 1: view the relevant counters for the Sqlserver:buffer Manager object: Typeperf-q "Sqlserver:buffer Manager"
Example 2: View checkpoint counter: typeperf-q "Sqlserver:buffer Manager" | Find "Checkpoint"
Example 3: View a list of all counters for this DB instance in tempdb: Typeperf-qx "sqlserver:databases" | FIND "tempdb"
Example 4: output a selected counter and generate a file: Typeperf-qx "sqlserver:databases" | FIND "tempdb" >>mycounters.txt
Other parameters:
-? Displays help that is relevant to the context.
-F Output file format. The default value is CSV.
-CF < file name > a counter line containing the monitored performance counters.
-si the time between the <[[hh:]mm:]ss> samples. The default value is 1 seconds.
-o < file name > path to output file or SQL database. The default value is STDOUT.
-SC the number of samples to collect. The default value is to sample before Ctrl + C.
-config < filename > settings file containing command options.
-S the server to be monitored without specifying a server in the counter path.
-Y do not prompt to answer yes to all questions.
Example 5: read counter information from the MyCounters.txt text file, write the technical value into the Mycounter.csv file, execute once every 15 seconds, execute 60 times (15 minutes after execution): Typeperf-f CSV- o mycounters.csv-si 15-cf MYCOUNTERS.TXT-SC 60
TypePerf.exe using commands to find counters