This documentation is for WSO2 ESB version 4.5.0. View documentation for the latest release.

Mediation Statistics

The "Mediation Statistics" feature is one of the most useful and widely used features. The mediation configuration of WSO2 ESB is composed of following functional elements:

From these functional components, sequences, Proxy Services and endpoints directly get involved in processing messages. The mediation statistics feature enables a server administrator to collect runtime statistical information on these three types of functional components and view them through the ESB management console. This feature 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. Perhaps the most enticing attribute of the mediation statistics feature is that it can be configured in a fine grained manner. In other words, it allows a user to collect data on only a specified set of sequences, Proxy Services and endpoints.

If you want to enable statistics for a mediation component using the Synapse configuration language, you have to set the value of the statistics attribute to enabled on the sequence, Proxy or endpoint configuration. Or you can do it using user interface. See Editing a Mediation Sequence, Proxy Service Specific Configuration, Enabling and Disabling Statistics for endpoints.

Follow the instructions below to access "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.

Tip

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.