Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PerformanceCounter: The Counter layout for the Category specified is invalid

90 views
Skip to first unread message

Joe

unread,
Mar 25, 2003, 11:21:43 AM3/25/03
to
Anyone have any idea what this exception means?

System.InvalidOperationException : The Counter layout for the Category
specified is invalid, a counter of the type: AverageCount64,
AverageTimer32, CounterMultiTimer, CounterMultiTimerInverse,
CounterMultiTimer100Ns, CounterMultiTimer100NsInverse, RawFraction,
SampleFraction or SampleCounter has to be immediately followed by any of
the base counter types : AverageBase, MultiBase, RawBase or SampleBase.
at
System.Diagnostics.CategorySample.GetCounterDefinitionSample(String
counter)

at System.Diagnostics.PerformanceCounter.NextSample()

at System.Diagnostics.PerformanceCounter.NextValue()


When I get this exception from a specific server, .Net will no longer
collect data from it until the application is restarted. My only guess is
that there is some caching of resources done in .Net that do not get freed
when I call PerformanceCounter.Close(). The server in question is a SQL
Server cluster that has failed over.

My next step is to try to global static method
PerformanceCounter.CloseSharedResources(). I should know shortly if this
makes the problem go away. While I hope it does, it is still not an ideal
solution since: 1) there is no documentation of what CloseSharedResources()
does and does not do, 2) at the time I make this call, my application can
have up to 25 threads fetching performance counter data (and I really want
to free resources for one server - not up to 25).

Any thoughts/advice would be appreciated.

Joe


Kevin Dwyer

unread,
Mar 25, 2003, 11:43:02 AM3/25/03
to
You're trying to perform an operation on a groups counters that is not valid
because the second counter in the group is not the correct counter type for
operation. What are you trying to do?

Kevin Dwyer

"Joe" <j...@nospamplease.com> wrote in message
news:O8KZwnu8...@TK2MSFTNGP10.phx.gbl...

Joe

unread,
Mar 25, 2003, 12:31:57 PM3/25/03
to
I'm fetching some data from SQL Server: Access Methods. It works fine until
for several days and then I get the below. If I restart my application, it
always works.

Any ideas?

Joe


Joe

unread,
Mar 25, 2003, 12:59:32 PM3/25/03
to
As another note, I can reduce it to simple sample code. However, it only
fails on this specific server.


0 new messages