Solved

Creating Stats on Method Hits

Posted on 2007-11-16
2
221 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now