如何在perfmon中获取同一进程的所有实例

How to get all instances of the same process in perfmon

在 perfmon(性能监视器)中,进程的相同实例表示为

processabc
processabc#1
processabc#2

有没有办法在不知道有多少个实例的情况下调用 xml(模板)中同一进程的所有实例?

这是我目前的 xml 模板:

<Counter>\Process(Processabc)\% Processor Time</Counter>
<Counter>\Process(Processabc#1)\% Processor Time</Counter>

我想在一行中 select n 个或所有 processabc 实例。

我知道要 select 计算机上的所有进程,可以使用

<Counter>\Process(*)\% Processor Time</Counter>

我想知道我是否可以做类似的事情来解决我的问题。

通配符

是的,您可以 select 特定进程的所有实例。

星号 * 是一个通配符,它​​指定 任何未指定长度的字符序列,包括完全没有长度

因此,您提到的计数器 <Counter>\Process(*)\% Processor Time</Counter> 只是 selects 名称包含零个或多个字符的任何进程

已应用通配符

要将此应用于您的情况,只需在通配符前加上进程名称即可。我使用 Chrome 进行了测试,计数器指定如下:

<Counter>\Process(chrome*)\% Processor Time</Counter>

这意味着:

select any process with the name chrome followed by zero or more characters.

生成的报告如下所示。