tags:

views:

24

answers:

1

Scenario

  • I've written a distributed application in C# using WCF.
  • It uses Client/Server architecture, implementing the Publisher/Subscriber design pattern for "pushing" new data to the client.
  • The server-side is hosted in a windows service, the client is a windows forms app.
  • The server-side continually loops through a series of processes and sends the results to the client.
  • I want to add a whole area to the application for monitoring everything that is going on server-side.

Problem

  • Here is where I am a bit stuck - I can't decide how I should monitor this stuff.

Thoughts

  • Do I create an object for storing lots of different information - logs of where the process is up to in the loop on the server-side, exceptions if any, errors etc??
  • I guess the real question is, how can I successfully maintain a monitoring aspect of the application that gives me relevant information?
  • Perhaps a central cache on the server-side that gets "snapped" at a point in time every so often and updates the client with the info?
A: 

Do you want to know what's currently going on in the server or do you also want to keep a history of what has happened?

If you only want to know what is going on at this moment, my solution would be to maintain the current server state in-memory (this shouldn't be too hard) and have the monitoring client call the server when it wants to know what is happening.

If you want to keep a history of what has happened, you need some data store where the server can write events to. The monitoring client can then read this data store to show what is happening now and what has happened in the past. Even better would be if the client did not have direct access to this data store but instead contacts the server to obtain the relevant information. This way you hide the implementation details of your monitoring history from the client.

Ronald Wildenberg