Solved

Creating Stats on Method Hits

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

19 Experts available now in Live!

Get 1:1 Help Now