Once the web application is deployed, the admin monitors the functioning of the application. Through monitoring, user can detect the problems that occur in an application and resolve them. For monitoring a web application, ASP.NET provides the following two features. Health monitoring Performance monitoring 1. Health monitoring Health monitoring helps user to monitor the status of the deployed web applications. User can track the system errors and events. The detailed run time information of the ASP.NET resources is provided. The System.Web.Management namespace contains the implementation of the heath monitoring system. It contains the classes and interfaces for managing the health of the web application. The web events can be captured using the built in event providers. Configuration of Health Monitoring The configuration of applications are used for the built in or customized monitoring providers. They process the health monitoring information and report the health status and the performance characteristics. The following configuration jobs are to be performed while using the health monitoring. Configure and enable web events to be monitored Configure and enable event providers used for listening and processing several web events. The following code snippet demonstrates the configuration of health monitoring through the <healthMonitoring> element. Code: <healthMonitoring enabled = “true | false” heartbeatInterval = “time interval” > <bufferModes>…</bufferModes> <providers>…</providers> <eventMappings>…</eventMappings> <profiles>…</profiles> <rules>…</rules> </healthMonitoring> The following list shows the attributes of the <healthMonitoring> element. enabled: It specifies whether health monitoring is enabled or not. heartbeatInterval: It specifies the interval, in seconds indicating the WebHeartBeatEvent interval. The child elements of the <healthMonitoring> element are as mentioned below: bufferModes: It specifies the buffering capacity of the provider profiles: It defines the collection of parameter sets for configuring events eventMappings: It maps the event names for the related event types rules: It maps events to the providers providers: It states the health monitoring providers that process the events. Event Providers The event providers are used for listening the web events that are raised by an application. There are several listeners provided by the ASP.NET used for capturing web events raised by the web application. Some of the built in providers in the system are as listed below: EventLogWebEventProvider: It is used to log the web events in the Windows event log. SqlWebEventProvider: It is a web event provider for SQL Server databases. SimpleMailWebEventProvider: It is used for sending response to the email messages. TraceWebEventProvider: It sends the web events to the diagnostics trace. WmiWebEventProvider: It sends the web events to the WMI subsystem. The following code snippet demonstrates the EventLogWebProvider in the configuration file. Code: <healthMonitoring enabled = “true” heartbeatInterval = “0” > <rules> <add name = “New Device “ eventName = “Device Value” provider = “EventLogProvider” profile =”Default” minInterval = “00:02:00” /> </rules> </healthMonitoring> In the above code, the <rule> element is the child element. The rule creates an handle for the Device Value. 2. Performance Monitoring Performance is useful in the success of a project. There are performance counters for tracking the execution of the web application. The counters can be application restarts, requests queued, and error totals. The following groups of the performance counters are supported by ASP.NET. System Performance counters Application Performance counters 1. System Performance counters The system performance counters are displayed in the Windows Performance monitor form of the ASP.NET. Some of the system performance counters are as listed below: Requests Disconnected: It states the number of requests that have been disconnected due to the failure in communication Request Wait State: It states the number of milliseconds that the most recent request waited in the queue. State Server Session Active: It represents the number of user sessions that are inactive due to some action. Application Running: It states the number of applications running simultaneously on a web server. Worker Process Running: It states the number of worker processes running on a web server. 2. Application Performance Counters The performance counters in ASP.NET application are displayed in the application performance object. A unique instance of the application collects the counter of an application. Some of the application performance counters are listed below: Anonymous Requests / Sec: It represents the number of requests per second that are using the anonymous authentication. Cache Total Entries: It states the total number of entries in a cache. Cache Total Hits: It represents the total number of hits from the cache. Debugging Requests: It states the number of requests that occur in enabled debugging.