The Telerik Data Access Profiler offers you a real-time (live) monitoring via a Telerik Data Access implemented web service. This topic demonstrates you how to configure a Telerik Data Access application for a real-time monitoring.
To prepare your application for a real-time (live) monitoring:
First, you need to add a reference to the Telerik.OpenAccess.ServiceHost.dll assembly.
- This will open the Model Settings Dialog. Go to the Backend Configuration -> Tracing and Logging settings. The Tracing and Logging settings allow you to configure the event logging properties, such as specifying the log file name, controlling the amount of logging information to be generated, etc.
The snapshot below shows you the minimal settings you need to consider and/or specify:
Ensure that the Enable Logging option is set to True.
- The first step is to specify the amount of logging information to be generated. This is controlled by the Log Level setting. The event logging levels are as follows:
- None - logs no events.
- Errors - logs only serious errors (such as connections timing out). This is the default value.
- Normal - logs the most useful events that do not reduce performance significantly (e.g. SQL executed).
- Verbose - logs lots of events (this slows down the performance, could be used while debugging).
- All - logs all possible events (this slows down the performance very significantly, could be used while debugging).
- The Include Stack Trace setting controls if the logging facilities append stack trace information. The default value for this option is False. In this demo it is set to True.
- Telerik Data Access produces two different kinds of data - metrics and events. Metrics are similar to the operating system counters. They produce snapshots of the system status like counting insert, update and delete statements per second. Log events contain the real operation information, including query parameters and stack traces. Compared to metrics, the production of log events is far more expensive and can slow down the application. Set the following options to True:
- Keep Events for Profiler - allows the user to configure the events store.
- Keep Metrics for Profiler - allows the user to configure the metrics store.
- The final step is to define the size of the event/metric store in the memory. This is controlled by the Events Threshold and Metrics Threshold settings.
Next, you need to start the web service host from the application:
Where the parameter contains the communication port number. Later in the profiler, the server name, the database name and this port are necessary to initiate the online download. 15555 is the default communication port number. That is the port number that the Profiler expects (by default). But you could change it to whatever you want. Just make sure you are setting the same number in the Connection dialog of the Profiler.
You could optionally shut down the service, it is not mandatory. You need to call the StopProfilerService method.
In web applications, the best places to start and stop the service are in the Application_Start and Application_End event handlers in the Global.asax.cs class.
The port information could also be added to the app/web.config file. Then you need to pass the key of the appSettings node to the StartProfilerService method. If no port is found, then the server is not started. The advantage of this approach is that you can configure your application without recompilation. You just need to edit the configuration file.
<configuration> <appSettings> <add key="ProfilerPort" value ="15555"/> </appSettings> </configuration>
In order to start a real-time monitoring in the Telerik Data Access Profiler, you need to use the Connect To Toolbar Command.
This will open the Open Connection dialog. Here you need to enter the connection string name (from the app/web config file) and the server name you are using in your application, as well as the port number you have passed to the web service.