HighTechTalks DotNet Forums  

Performance counters read very slow for large number of instances

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


Discuss Performance counters read very slow for large number of instances in the Dotnet Framework (Performance) forum.



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

Default Performance counters read very slow for large number of instances - 02-22-2006 , 08:50 AM






I am working with an application, which creates a single performance category
containing a small number of counters, but adds a huge number of instances to
each counter.

As far as I can see, the time taken to read a single instance grows as more
instances are added. (I am guessing that the read is having to search a
collection of instances for the one it wants.)

I curently have around 2000 instances in each of the counters, and it is
taking me over one and a half seconds per instance to read the RawValue. (It
took millisecnds when I had ten instances per counter.)

Are there any more effiecient ways of readign values than using
System.Diagnostics.PerformanceCounter?

My code is pretty straight forward:

Private m_PerfCtrNumSkip As System.Diagnostics.PerformanceCounter

....

Me.m_PerfCtrNumSkip = New System.Diagnostics.PerformanceCounter
Me.m_PerfCtrNumSkip.CategoryName = "PI Advanced Computing Engine"
Me.m_PerfCtrNumSkip.MachineName = "."
Me.m_PerfCtrNumSkip.CounterName = "Number of skipped calculations"
Me.m_PerfCtrNumSkip.InstanceName = Me.m_PerfCtrName

....

Public ReadOnly Property NumSkipped() As Long
Get
Try
Return CLng(m_PerfCtrNumSkip.RawValue)
Catch ex As Exception
Throw New Exception(mc_ModuleName & ".NumExec.Get: Error reading
Performance Counter: ", ex)
End Try
End Get
End Property

--
Thanks,


Mike Reid

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.