Performance Counters

  • Thread starter Thread starter Martin Payne
  • Start date Start date
M

Martin Payne

I am using the PerformanceCounter and
PerformanceCounterCategory classes to build my own version
of perfmon.

The problem is that my computer has categories
called "Indexing Service" and "Indexing Service Filter" (I
assume that they were put there when I installed MSDE or
MS Access). The thing is that perfmon shows that they
have no instances ("<no instances>" appears in the
Instances listbox) but still manages to show that there
are a couple of counters available.

When I use either the GetInstanceNames or GetCounters
methods from the PerformanceCounterCategory object, using
either of the above categories, I get -

"System.InvalidOperationException: The Indexing Service
category doesn't provide any instance information, no
accurate data can be returned."

Now, I can use a try/catch block for the GetInstanceNames
method, but I would still like to see the counters so what
do I with the GetCounters method to make it work?

Thanks in advance,
Martin
 
Martin Payne said:
I am using the PerformanceCounter and
PerformanceCounterCategory classes to build my own version
of perfmon.

The problem is that my computer has categories
called "Indexing Service" and "Indexing Service Filter" (I
assume that they were put there when I installed MSDE or
MS Access). The thing is that perfmon shows that they
have no instances ("<no instances>" appears in the
Instances listbox) but still manages to show that there
are a couple of counters available.

When I use either the GetInstanceNames or GetCounters
methods from the PerformanceCounterCategory object, using
either of the above categories, I get -

"System.InvalidOperationException: The Indexing Service
category doesn't provide any instance information, no
accurate data can be returned."

Now, I can use a try/catch block for the GetInstanceNames
method, but I would still like to see the counters so what
do I with the GetCounters method to make it work?

Thanks in advance,
Martin

I am having the exact same problem as you.
My way around it is to use try/catch statements, and also, use
GetCounters with an empty string.

GetCounters ("")

That seems to work for me.


HTH

David
 
Back
Top