?
Solved

Creating Stats on Method Hits

Posted on 2007-11-16
2
Medium Priority
?
261 Views
Last Modified: 2010-04-15
Bit of a strange one, but I am looking to have a method:

GetStatus()

That would simply return statistical information on how many times certain processes are done. I was thinking the best way to do this would be to use a KVP system and every time a method is called simply increment it by one.

So I would have:

GetMatrix()

This would go to the KVP look for the Matrix entry and update it's pairby one. Just making sure there really isnt an easier way before I put this all throughout my code.

Cheers
0
Comment
Question by:directxBOB
2 Comments
 
LVL 22

Accepted Solution

by:
JimBrandley earned 2000 total points
ID: 20299041
We use a product called NLog. It's free and very capable.
In addition to counts, it can log errors debug info etc. It is configured with XML so you can turn it on and off at any given installation as needed.

http://www.nlog-project.org/

Jim
0
 

Author Comment

by:directxBOB
ID: 20311214
Cheers Jim, I am already using NLog for tracing, errors and debuging.

That said the purpose of this method is to actually determine the status of the application. So for example it will have the last error, what parts of the application is offline etc.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question