title: Performance Counter by Process ID instead of name?
body: <p>I am tracking multiple instances of the same application and need to get the memory and cpu use of both processes. However, I cant seem to figure out a way to use the performance counter and know which result is for which process. I have seen that I can append #1 and such to the end of the name to get results for each, but that doesn't tell me which one is for which process. </p>
  
  <p>How can I determine the ProcessId or pass the process ID to the counter to get the result per each process with same name?</p>
  
  <pre><code>PerformanceCounterCPU.CategoryName = "Process";
  PerformanceCounterCPU.CounterName = "% Processor Time";
  PerformanceCounterCPU.InstanceName = proc.ProcessHandle.ProcessName;
  
  PerformanceCounterMemory.CategoryName = "Process";
  PerformanceCounterMemory.CounterName = "Working Set - Private";
  PerformanceCounterMemory.InstanceName = proc.ProcessHandle.ProcessName;
  </code></pre>