HighTechTalks DotNet Forums  

Q: System.Diagnostics.PerformanceCounter usage

Dotnet Framework (Performance) microsoft.public.dotnet.framework.performance


Discuss Q: System.Diagnostics.PerformanceCounter usage in the Dotnet Framework (Performance) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Enzo
 
Posts: n/a

Default Q: System.Diagnostics.PerformanceCounter usage - 04-24-2006 , 02:01 PM






I have a test app where I am using System.Diagnostics.PerformanceCounter.

In the VS.NET 2003 DESIGNER I choose:
CategoryName = 'Process'
CounterName = '% Processor Time'

I want to programmatically display a list to the user of "InstanceName"
values.

Is there anyway to get the "same" list of InstanceNames that are displayed
by the designer?

Thanks

Reply With Quote
  #2  
Old   
Enzo
 
Posts: n/a

Default RE: Q: System.Diagnostics.PerformanceCounter usage - 04-24-2006 , 06:13 PM






I think I figured it out on my own

System.Diagnostics.PerformanceCounterCategory mycat = new
System.Diagnostics.PerformanceCounterCategory("Pro cess");

string[] instanceNames;
instanceNames = mycat.GetInstanceNames();

for (int i = 0; i < instanceNames.Length; i++)
{
textBox1.AppendText(instanceNames[i] + "\r\n");
}


"Enzo" wrote:

Quote:
I have a test app where I am using System.Diagnostics.PerformanceCounter.

In the VS.NET 2003 DESIGNER I choose:
CategoryName = 'Process'
CounterName = '% Processor Time'

I want to programmatically display a list to the user of "InstanceName"
values.

Is there anyway to get the "same" list of InstanceNames that are displayed
by the designer?

Thanks

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.