xmlwindowsperfmon

How to get all instances of the same process in perfmon


In perfmon (performance monitor), same instances of a process are denoted by

processabc
processabc#1
processabc#2

Is there any way to call ALL instances of the same process in xml (template), without knowing how many instances there are?

Here's my xml template so far:

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

I want to select n instances or all instances of processabc in a single line.

I know that to select all processes on a computer, it's possible to use

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

I was wondering if I could do something similar to solve my problem.


Solution

  • Wild-Cards

    Yes, you can select all instances of a specific process.

    The asterix * is a wild-card character that specifies any sequence of characters of an unspecified length, including no length at all.

    So the counter you mentioned <Counter>\Process(*)\% Processor Time</Counter> simply selects any process whose name has zero or more characters.

    Wild-Cards Applied

    To apply this to your circumstance, simply prefix the wild-card with the process name. I performed a test using Chrome, the counter was specified as follows:

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

    This means:

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

    The resultant report is shown below.

    Note: If you log to a text-based format (comma/tab-separated values), perfmon will not select instances created after you started the collection. You should log to binary format, and later use relog.exe to convert back to csv if needed. Details in Windows performance monitor new instances

    enter image description here