473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.

PerformanceCounterCategory.Create(m_CategoryName, "",
PerformanceCounterCategoryType.MultiInstance, m_CounterName, "");

PerformanceCounter counter = new PerformanceCounter(m_CategoryName,
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
Apr 1 '08 #1
0 3068

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: william | last post by:
Hi, I'm playing windows service using vb.net. I added a performance counter to my windows service, but I couldn't set MachineName property of the performance counter to blank. After I set it to...
0
by: Val Mazur (MVP) | last post by:
Hi guys, My application creates custom performance counter and it works fine. Now I am creating multiple instances of the same counter and increment value for each instance. This part work fine...
3
by: Dirk Reske | last post by:
Hello, I have following code:
1
by: Jim Heavey | last post by:
I am messing around with performance counters to try to learn how to work with them. In VS.Net, I can see that there exist a Performance Counter with a "CategoryName" of "Browser". My...
0
by: Christopher Attard | last post by:
Hi, I want to make use of the Performance Counter "Connections active" which falls under the "TCP" Performance object. I'm using the following code (in C#) to get the performance counter: ...
0
by: jimiz | last post by:
I have a question on how the performance counter instance returns values. I have an app that uses the performance counter for Category name = "Web Service" Counter name = "Current Connections"...
1
by: socal | last post by:
I've added the performance counter object to my app... Within the class there's the PerformanceCounter.CategoryName property that allows you to set what category you want to monitor. For instance,...
37
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
1
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.