以下面的计数器为例:
\LogicalDisk(*)\% 可用空间
哪里可以找到可以代替的东西*
?
我知道有时是_global_
,有时可能是_total_
。我不知道其中的区别(除了明显的猜测)。
还有什么可用内容?
对于不同的计数器我能使用什么/不能使用什么?
答案1
星号代表“所有实例”,其中包括 _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
答案2
答案是正确的。我想补充一点,可以使用parent*
所有实例。请参阅http://www.codeproject.com/Articles/369888/Diagnosing-applications-using-Performance-Counters
例如"\Thread(w3wp*)\Context Switches/sec"
列出 w3wp 进程中的所有线程
我没有在任何地方找到这个。PowerShell 也抱怨,但它可以工作...