大网数据广告活动
Windows排障命令

typeperf

· 52CE 我爱测

Reference article for the typeperf command, which writes performance data to the command window or to a log file.

The typeperf command writes performance data to the command window or to a log file. To stop typeperf, press CTRL+C.

Syntax

typeperf <counter [counter ...]> [options]
typeperf -cf <filename> [options]
typeperf -q [object] [options]
typeperf -qx [object] [options]

Parameters

Parameter Description
<counter [counter [...]]> Specifies performance counters to monitor. The <counter> parameter is the full name of a performance counter in \Computer\Object(Instance)\Counter format, such as \\Server1\Processor(0)\% User Time.
Options
Option Description
-f `<CSV TSV
-cf <filename> Specifies a file containing a list of performance counters to monitor, with one counter per line.
-si <[[hh:]mm:]ss> Specifies the sample interval. The default is one second.
-o <filename> Specifies the path for the output file, or the SQL database. The default is STDOUT (written to the command window).
-q [object] Display a list of installed counters (no instances). To list counters for one object, include the object name.
-qx [object] Display a list of installed counters with instances. To list counters for one object, include the object name.
-sc <samples> Specifies the number of samples to collect. The default is to collect data until CTRL+C is pressed.
-config <filename> Specifies a settings file containing command options.
-s <computer_name> Specifies a remote computer to monitor if no computer is specified in the counter path.
-y Answer yes to all questions without prompting.
/? Displays help at the command prompt.

Examples

To write the values for the local computer's performance counter \Processor(_Total)\% Processor Time to the command window at a default sample interval of 1 second until CTRL+C is pressed, type:

typeperf \Processor(_Total)\% Processor Time

To write the values for the list of counters in the file counters.txt to the tab-delimited file domain2.tsv at a sample interval of 5 seconds until 50 samples have been collected, type:

typeperf -cf counters.txt -si 5 -sc 50 -f TSV -o domain2.tsv

To query installed counters with instances for the counter object PhysicalDisk and writes the resulting list to the file counters.txt, type:

typeperf -qx PhysicalDisk -o counters.txt

Related links

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 06/15/2023
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。