Event Metrics feature provides a drilled down visualisation of metrics relating to CEP specific artifacts to carry out in-depth monitoring of throughput, latency, and memory usage of CEP. It is disabled by default to avoid the excessive processing of events and execution plan from causing a system overhead.
Before you use event metrics, both JVM metrics and CEP component-specific metrics need to be enabled as follows.
To enable metrics for the CEP, set the
Enabledparameter under the Metrics element to true in the
<CEP_HOME>/repository/conf/metrics.xmlfile. Alternatively, you can enable metrics at the time of starting the CEP server by using the following command:
For detailed instructions to enable/disable metrics and to configure metrics, see Enabling Metrics and Storage Types.
To generate metrics related statistics, set the
<CEP_HOME>/repository/conf/carbon.xmlfile as shown below.
- To enable event metrics for specific event receivers, event publishers, and execution plans, enable statistics for the relevant components by clicking the Enable Statistics link. e.g., The following image shows how to enable statistics for an execution plan.
Monitoring event metrics
There are two methods to view event metrics:
Both methods generate the same metrics. The difference between the two methods is, when there are multiple tenants, the CEP Management Console allows you to view metrics for the currently logged tenant as well as other tenants wheres the JConsole only allows you to view metrics for the currently logged tenant.
Monitoring Metrics using the Management Console
Follow the procedure below to access event metrics via the Management Console.
- Log into the CEP Management Console. For detailed instructions, see Running the Product.
In the Monitor tab, click Event Metrics. The View All Metrics page is displayed as shown in the example below.
Alternatively, you can click Metrics to open the View All Metrics page.
If you click Event Metrics, the View All Metrics page displays only event metrics. If you click Metrics, the View All Metrics page displays both JVM metrics and event metrics.
Click on a link displayed under Sub Levels to view a specific metric as shown in the example below.
Monitoring Metrics using the JConsole
Follow the procedure below to monitor event metrics via the JConsole.
- Start the WSO2 CEP server.
- Start the JConsole. For detailed instructions to start the JConsole to monitor the CEP, see JMX-Based Monitoring.
- Click the MBeans tab in the JConsole window. Then expand the
- Click on the relevant MBeans under the
org.wso2.carbon.metricsdomain to view the required metrics.