Create a performance counter with an instance name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?S2FpIFdhbmc=?=

    #1

    Create a performance counter with an instance name

    I use the following two lines of code to create a performance counter with an
    instance name.

    PerformanceCoun terCategory.Cre ate(m_CategoryN ame, "",
    PerformanceCoun terCategoryType .MultiInstance, m_CounterName, "");

    PerformanceCoun ter counter = new PerformanceCoun ter(m_CategoryN ame,
    m_CounterName, "test", false);

    But I get this exception:
    "Category 'cat' is marked as single-instance. Performance counters in this
    category can only be created without instance names."

    Any idea?

    Thanks.

    Kai
Working...