Mediation statistics allow a server administrator to collect runtime statistical information from sequences, proxy services, and endpoints and view it through the ESB management console. This provides a simple but effective way of determining the runtime performance of the ESB. The collected statistical data can be used to analyze network traffic patterns and draw rough estimates on how the service bus will be used in the future. You can configure the mediation statistics in a fine-grained manner so that you can collect data on only a specified set of sequences, proxy services, and endpoints. You can also extend the mediation statistics component by developing custom statistics consumers (CSC), which is useful if you want to write the collected statistics to an external database or make them available to an external monitoring application.
This page includes the following sections:
Enabling statistics
To enable statistics for a mediation component using the Synapse configuration language, you set the value of the statistics
attribute to enabled
on the sequence, proxy service, or endpoint configuration. To enable it using the management console, see the following topics:
- Editing a Mediation Sequence
- Managing Proxy Services
- Enabling and Disabling Statistics (for endpoints).
Viewing statistics
Follow the instructions below to view mediation statistics.
1. Sign in. Enter your user name and password to log on to the ESB Management Console.
2. Click on "Monitor" on the left side to access the "Monitor" menu.
3. In the "Monitor" menu, click on the "Mediation Statistics."
4. The "Mediation Statistics" page appears. It provides the following details:
- Server Statistics - Shows the total number of mediated messages.
- Proxy Service Statistics - Shows the number of mediated messages by each Proxy Service.
- Sequence Statistics - Shows the number of mediated messages by each sequence.
- Endpoint Statistics - Shows the number of mediated messages sent to each endpoint.
5. Click on a link to view the relevant statistics. Each link will take you to a new page that displays the components of mediation statistics.
For example, click on the "Server Statistics" link to see its details.
Server statistics
This page provides the detailed statistics of the server and shows the temporal variation of the average response time.
- Total message count - The total number of messages received and mediated through the mediation channel.
- Minimum response time - The least amount of time taken to mediate a message (in milliseconds).
- Maximum response time - The greatest amount of time taken to mediate a message (in milliseconds).
- Average response time - The average amount of time taken to mediate a message (in milliseconds).
Proxy service statistics
Proxy services have two built-in mediation channels:
- In-sequence - The statistics associated with the in-sequence.
- Out-sequence - The statistics associated with the out-sequence.
Learn more information about the statistics detailed data in the "Sequence" statistics below.
Click on a particular Proxy Service in the "Proxy Services" list to see its detailed statistics.
Sequence statistics
A sequence has to deal with two mediation channels, one for requests and the other for responses.
- In-statistics - The statistics collected on the sequence are related to the request processing channel.
- Out-statistics - The statistics associated with the response channel.
The statistics consist of following data items:
- Total message count - The total number of messages received and mediated through the mediation channel.
- Fault message count - The number of messages that triggered faults while being mediated through the channel.
- Minimum response time - The least amount of time taken by the mediation channel to mediate a message (in milliseconds).
- Maximum response time - The greatest amount of time taken by the mediation channel to mediate a message (in milliseconds).
- Average response time - The average amount of time taken by the mediation channel to mediate a message (in milliseconds).
The average time for a particular mediation channel is calculated using the following formula:
- Tn - Average processing time after mediating n messages.
- n - Number of messages mediated (Total count).
- tn - Time taken to mediate the nth message through the channel (aka mediation time - more on this later).
Click on a particular sequence in the "Sequences" list to see its detailed statistics.
Endpoint statistics
WSO2 ESB collects only the in-statistics for the endpoints. In WSO2 ESB, an endpoint represents an entity to which messages can be sent. The ESB core is designed to be completely asynchronous and non-blocking, and therefore responses are not associated with a particular endpoint. ESB handles responses separately, using a call back receiver mechanism. As a result, an endpoint has only one mediation channel, namely the request channel, associated with it. Endpoint in-statistics also consist of the same set of data items as statistics of sequences or Proxy Services. But in case of endpoints, their definitions are slightly different. The revised definitions are as follows:
- Total message count - Total number of messages forwarded to the endpoint.
- Fault message count - Number of messages that triggered faults while being forwarded to the endpoint.
- Minimum response time - The least amount of time taken to send a request to the endpoint and receive a response.
- Maximum response time - The greatest amount of time taken to send a request to the endpoint and receive a response.
- Average response time - The average time taken to forward a request to the endpoint and receive a response.
Endpoint average times are computed using the same formula as the one used to calculate average times for sequences and Proxy Services.
Use the derived information. These numbers can help you to identify potential bottlenecks in an ESB configuration, understand traffic flow patterns and even discover various software and network errors.
- If the average mediation time of an endpoint increases unusually, that is an indication of the backend service performing poorly or the network link between the ESB and the service getting congested.
- If a Proxy Service or a sequence reports a very high fault count compared to its total count, that could be a sign of backend services not functioning as expected or ESB experiencing communication errors while sending messages.
- If the average time, minimum time and maximum time for a particular item has close values, it can be deduced that the network, the ESB and backend servers are all functioning smoothly.
- If the difference between the minimum time and the maximum time is unusually large, that indicates the network or some application is functioning poorly at times, causing considerable delays.
Ideally, the average mediation time for all sequences, endpoints and Proxy Services should be at a minimum and so does the fault count. Also the difference between the minimum times and corresponding maximum times should be low. While it is possible to tune up ESB configurations and backend services to provide low average times and fault counts, it is almost impossible to maintain a low difference between the maximum and minimum times. This is because networks tend to operate in burst mode, most of the time.
Monitoring statistics from other applications
WSO2 ESB produces statistics data using JMX, allowing you to monitor the data from applications like JConsole that can consume JMX data. For more information, see JMX Monitoring.
You can also use the BAM Mediator to capture data events and send them to the WSO2 Business Activity Monitor server.