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 / June 2007

Tip: Looking for answers? Try searching our database.

Help - use of PerformanceCounter for monitoring heartbeat?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
n.phelge - 29 Jun 2007 13:44 GMT
I have a C# .NET 1.1 application where I need to monitor heartbeat
requests from an external system - the external system (which I cannot
otherwise access) is going to send a message to my application on a
periodic basis to let me know it is still functional, and my
application needs to monitor those messages, sending an email
notification if it doesn't receive one within some configured
interval.  This seems like a good candidate for use of performance
counters within my application and MOM to monitor the counter values,
as this isn't data that necessarily needs to be persisted, but I'm not
sure which type of PerformanceCounter would apply to this scenario. I
really don't need to know the average or total number of messages
received - I need to know either when I received the last message or
how many I received in a fixed interval of time. I guess I could use
the NumberOfItems64 to represent the ticks at the time when the last
message was received and have MOM calculate the delta between the
current time and that value to see if it exceeds some threshold, but I
thought I would ask if anyone has other suggestions.

Thanks in advance
r norman - 29 Jun 2007 14:06 GMT
>I have a C# .NET 1.1 application where I need to monitor heartbeat
>requests from an external system - the external system (which I cannot
[quoted text clipped - 15 lines]
>
>Thanks in advance

I do this quite regularly, but don't bother with all the rigmarole you
suggest.  Instead I use a simple timer.

When the heartbeat is detected, increment a counter.  When the timer
interval expires,  check to see how many heart beats have occurred.  A
non-zero value indicates a problem.  Then zero the counter.

Don't rely on a single heartbeat count -- you may get a race condition
and it may occur a fraction of a microsecond after your timer hit
especially if the clocks in the two systems have a slightly different
rate.  If you expect one beat per second, check every two or three
seconds for a non-zero count of received beats.  Unless you have a
very special application, that will detect a problem soon enough.

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.