473,396 Members | 1,893 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,396 software developers and data experts.

PerformanceCounterCategoryType in .NET 2.0

I am porting an app from net 1.1 to .net 2.0. I have a line of code
(which sets up Performance Counters) that the new framework has obsoleted:

CounterCreationDataCollection CCDC = new CounterCreationDataCollection();

// obsoleted line
PerformanceCounterCategory pcc = PerformanceCounterCategory.Create("My
Category", "My Category Description", CCDC);

The preferred line is now:

pcc = PerformanceCounterCategory.Create("My Category", "My Category
Description",
PerformanceCounterCategoryType.SingleInstance, CCDC);

The difference obviously is the PerformanceCounterCategoryType enum
which supports SingleInstance and MultiInstance. From the sparse
documentation, I am not quite grokking the difference between the 2. I
want my code to work as it did under 1.1 framework. Which enumeration
value should I use?

Thanks.
Jan 10 '07 #1
3 2848
Hi Frank,

PerformanceCounterCategoryType enum indicates whether the performance
counter can have multiple instances. If you're only creating 1 instance in
your app, like in .NET 1.1, just use
PerformanceCounterCategoryType.SingleInstance. If you're trying to create
multiple instances for this category, please use
PerformanceCounterCategoryType.MultiInstance.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jan 10 '07 #2
Hi Frank,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
Microsoft Online Community Support
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jan 12 '07 #3
Kevin Yu [MSFT] wrote:
Hi Frank,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.
It seems to work fine, just like it did in .net 1.1, which is what I
wanted. Thank you. If any issues come up, I'll post them in a new thread.

>
Kevin Yu
Microsoft Online Community Support
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Jan 12 '07 #4

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

Similar topics

1
by: Ashkan Daie | last post by:
Hi All, When trying to install a performance counter via InstallUtil I get the following exception: Creating performance counter category Enterprise Library Caching. An exception occurred...
0
by: newscorrespondent | last post by:
Some performance counters are PerformanceCounterCategoryType.MultiInstance. Many of these occur once for each running app. If for example myapp has three at the same time myapp shows up three times...
3
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor...
5
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I've got some custom performance counters that can have multiple instances. I use the PerformanceCounter() constructor with the instance name parameter. The thing that puzzles me, though,...
1
by: Robert Strickland | last post by:
I have a .Net web service (written for 1.1 Framework using C#) running on Windows 2003 with all latest patches. To help monitor the service, the code creates several performance counters. One...
0
by: =?Utf-8?B?S2FpIFdhbmc=?= | last post by:
I use the following two lines of code to create a performance counter with an instance name. PerformanceCounterCategory.Create(m_CategoryName, "", PerformanceCounterCategoryType.MultiInstance,...
1
by: Ben | last post by:
hi, i have this line in a web app to create a custom perf category: PerformanceCounterCategory.Create(categoryName, categoryDesc, PerformanceCounterCategoryType.SingleInstance, ccdc); ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.