Performance Counters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Payne

    #1

    Performance Counters

    I am using the PerformanceCoun ter and
    PerformanceCoun terCategory 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 GetInstanceName s or GetCounters
    methods from the PerformanceCoun terCategory object, using
    either of the above categories, I get -

    "System.Invalid OperationExcept ion: 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 GetInstanceName s
    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

  • phreaker

    #2
    Re: Performance Counters

    "Martin Payne" <mcpayne@qualte ch-int.com.au> wrote in message news:<12bb01c38 70b$93fc4780$a4 01280a@phx.gbl> ...[color=blue]
    > I am using the PerformanceCoun ter and
    > PerformanceCoun terCategory 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 GetInstanceName s or GetCounters
    > methods from the PerformanceCoun terCategory object, using
    > either of the above categories, I get -
    >
    > "System.Invalid OperationExcept ion: 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 GetInstanceName s
    > 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[/color]

    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

    Comment

    Working...