Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

How To: Custom Performance Counters with intervals other than 1 second?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mountain - 11 Aug 2005 01:52 GMT
I want to implement a custom performance counter for monitoring errors
in my application. However, the correct rate is not exceptions per
second!

(If my app is throwing multiple exceptions per second, then the last
thing I need to be doing is writing custom performance counters!)

I want to implement a counter that has a period of 1 hour. What is the
right way (or best way) to do this? I figure out one way, but I had to
implement all the code and not use any of the methods in the
Diagnostics namespace (other than just setting the raw value of my
counter).

I don't think that is the right way to do it. Although all the
framework code seems to assume periodicity of 1 sec, I have a feeling I
should be able to use the framework methods and obtain rates per hour
-- I just need some help figuring out the way to go about it.

Thanks
Derrick Coetzee [MSFT] - 12 Aug 2005 22:55 GMT
> I want to implement a counter that has a period of 1 hour. What is the
> right way (or best way) to do this? I figure out one way, but I had to
> implement all the code and not use any of the methods in the
> Diagnostics namespace (other than just setting the raw value of my
> counter).

Hi, Mountain. Our team has dealt with this problem also, and in the end we
decided to primarily use "total" counters, which simply count all
occurrences of the event since the application began (or even ever). Once
you have this, you can easily construct a tool that takes regular samples
and takes differences to construct a plot at any rate you desire.
Unfortunately Performance Monitor does not have this useful capability
built-in, but once you create such a tool you can use it in diverse
circumstances. I hope this helps.
Signature

Derrick Coetzee, MCP, MSFT (Speech Server)
This posting is provided "AS IS" with no warranties, and confers no
rights.

Mountain - 13 Aug 2005 15:19 GMT
Hi Derrick,
Thank you for your reply. It seems there are only 2 options: do it like
you did, or write a performance extension DLL. I'm not sure writing a
performance extension DLL is worth the effort given that the approach
you describe should work just as well.
Regards,
Mountain

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.