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

PerformanceCounter(), multiple instances

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, is that when I look in Perfmon for those
counters, the instance name I've passed in has been lowercased. Why would
that be? If you look at the Processes counter, it has mixed case instances.

Thanks
_Mark

Feb 28 '07 #1
5 8217
Hello Mark,

Is the problem only occur with all the custom performance counters? As I
understand, you get correct instance name in your .NET application, but
incorrect name (lowcase) in Perfmon, is my understanding right? This seems
not be a programming issue, since only Perfmon has this problem. You may
consult the vendor of the custom performance counters, to see if they know
the problem with thier performance counters in Perfmon.

Sincerely,

Luke Zhang

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.

Mar 1 '07 #2
Hi Luke...

The custom performance counters are our own, using the .Net
System.Diagnostics classes (PerformanceCounter, etc). We pass in an instance
name of mixed case but when we look at the counters in perfmon, the instance
is in all lower case.

Looking at other multi-instance counters in perfmon, it's clear that *other*
counters don't have their instance names case-normalized.

It appears to be more a weird behavior of the .Net framework classes, though
I'm scratching my head why they would do this.

I was hoping someone on one of the newsgroups would know why this happens.

Thanks
-Mark
"Luke Zhang [MSFT]" wrote:
Hello Mark,

Is the problem only occur with all the custom performance counters? As I
understand, you get correct instance name in your .NET application, but
incorrect name (lowcase) in Perfmon, is my understanding right? This seems
not be a programming issue, since only Perfmon has this problem. You may
consult the vendor of the custom performance counters, to see if they know
the problem with thier performance counters in Perfmon.

Sincerely,

Luke Zhang

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.

Mar 1 '07 #3
Hello mark,

I build a sample performance counter in VS.NET 2005 based on this article:

http://support.microsoft.com/kb/317679

But I didn't find the issue. Maybe you can also test this sample on your
server to see if it is a code issue or an environment issue.

Sincerely,

Luke Zhang

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.

Mar 5 '07 #4
Hi Luke...

I think I see your problem - you're not creating multi-instance counters,
only single instance. That's not what I'm referring to. Multi-instance
counters have the same structure but can have multiple instantiations as
different processes use copies of them.

If you replace
PerformanceCounterCategory.Create("HowToCounter", "some...", CounterDatas);
with
PerformanceCounterCategory.Create("HowToCounter", "some...",
PerformanceCounterCategoryType.MultiInstance, CounterDatas);

and
Dim PerfCounter As New PerformanceCounter("HowToCounter", "ThreadCounter",
False)
with
Dim PerfCounter As New PerformanceCounter("HowToCounter", "ThreadCounter",
"MixedCaseInstance", False)

in the example you were using, you'll be getting a multi-instance counter
this time and should see the case normalization I was referring to.

Thanks
-Mark

"Luke Zhang [MSFT]" wrote:
Hello mark,

I build a sample performance counter in VS.NET 2005 based on this article:

http://support.microsoft.com/kb/317679

But I didn't find the issue. Maybe you can also test this sample on your
server to see if it is a code issue or an environment issue.

Sincerely,

Luke Zhang

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.

Mar 6 '07 #5
Hi Mark,

Thank you for the information, I also found the problem with the code. I
will perform further research on it and update you as soon as possible.

Sincerely,

Luke Zhang

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.

Mar 7 '07 #6

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

Similar topics

1
by: Martin V. | last post by:
Hello, Is the multiple instances capability of SQL2K mature enough for a Production system? We're looking at upgrading our hardware but the proposed solution calls for consolidating two...
1
by: W1ld0ne74 | last post by:
I am implimenting Performance counters into a web application. I use the following code to create the counters during setup: private void SetupPerfCntrs() {...
1
by: Chris | last post by:
I'm trying to do something really easy: just get the % CPU load. However, I just get mostly 0's sprinkled with an occasional 100. I poked around on the web for info, but all the stuff I found (I...
1
by: jimbo | last post by:
Here is my problem. I'm creating an Instrumentation class that will use previously created Performance Categories and Counters in order to time various processes (ie. query duration etc.). This...
0
by: BuddyWork | last post by:
Hello, Can someone please explain why my Instances are not appearing in Perfmon. Here is my code to create the counters. CounterCreationDataCollection CCDC = new...
3
by: Rob Meade | last post by:
Hi all, I'm having a bit of trouble with the following function.... Private Function GetSystemUpTime() As TimeSpan ' declare variables Dim Result As TimeSpan Dim PerformanceCounter As...
0
by: Scheu | last post by:
Hi all, I'm hoping someone can help me with this bizarre problem. If I create a new PerformanceCounter object in a ComVisible class and invoke it from wscript, it never seems to terminate. When...
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...
1
by: bobido | last post by:
Hi there! Currently I'm trying to display the current performance of my servers on my website. I tried it with the following code: protected static PerformanceCounter cpuCounter; ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?

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.