以下面的计数器为例:
\ LogicalDisk(*)\%可用空间
我在哪里可以find什么可以插入代替* ?
我知道有时它是_global_ ,其他时候可以是_total_ 。 我不知道差别(除了明显的猜测)。
还有什么可用的?
什么可以/不可以用于不同的柜台?
星号代表“所有实例”,其中包括_Total(如果适用)。
Perfmon可能是查看计数器并查看系统上可用的最简单的地方。
从typeperf的文档 :
•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: ◦ \\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
编辑:噢,不要忘了在Powershell中检查Get-Counter:
PS C:\> (Get-Counter -ListSet Memory).Paths \Memory\Page Faults/sec \Memory\Available Bytes \Memory\Committed Bytes \Memory\Commit Limit \Memory\Write Copies/sec \Memory\Transition Faults/sec \Memory\Cache Faults/sec \Memory\Demand Zero Faults/sec \Memory\Pages/sec \Memory\Pages Input/sec ... The second command gets the path names that include "cache". PS C:\> (Get-Counter -ListSet Memory).Paths | Where {$_ -like "*Cache*"} \Memory\Cache Faults/sec \Memory\Cache Bytes \Memory\Cache Bytes Peak \Memory\System Cache Resident Bytes \Memory\Standby Cache Reserve Bytes \Memory\Standby Cache Normal Priority Bytes \Memory\Standby Cache Core Bytes
答案是对的。 我想补充一点,可以使用parent*来使用所有的实例。 见http://www.codeproject.com/Articles/369888/Diagnosing-applications-using-Performance-Counters
例如"\Thread(w3wp*)\Context Switches/sec"列出了w3wp进程中的所有线程
我没有发现任何地方列出。 另外PowerShell抱怨,但它的工作原理…