Instrumentation helps Administrator monitor the behavior of an application over time.
Performance Counters help monitor the progress of an application on a timely basis. There are various system wide performance counters, which one can use to monitor the various processes running in a machine. In short, if one needs to know how many times ‘Method A’ was called, then you can have a performance counter to do this.
Performance Counters can be defined for an application and are called custom performance counters. The same is explained in detail, later in the article.
Tracing feature in .Net helps debug/troubleshoot an application. They exist in the form of messages and they can get into a text file, event log or output window. Output window can be monitored during development to see the progress of an application. Event Log and Text files are handy resources when an application is deployed in the production environment. To assist Tracing, the framework consists of ‘Trace Listeners’ whose primary responsibility is to receive messages and record against the specified resource. To achieve this feature, the Trace messages are to be placed in the application code.
Ex:
Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Trace.Write("Control is in Form Load")
End Sub
If there were Trace listeners for Event Log, the above message would be recorded in the event log. Tracing can be logic driven and based on a value. This mechanism is explained in detail, later in the article.
Next Page: Implementing Performance Counters