# Monitoring latency statistics using the CMC

When latency chaining is enabled, latency chain data is available in Liberator and can be accessed via JMX monitoring. You can view it using a [JMX](https://www.oracle.com/java/technologies/javase/javamanagement.html) console, such as the [Caplin Management Console](index.md) (CMC). Here’s how to do this with the CMC.

**📌 NOTE**\
This feature is available in **Liberator 6.2.7** and later.

## Overview

When a liberator object has latency information recorded against it, you can view this data by examining the object’s MBean attribute called `latency-chain` . The information is presented as a JSON map that contains latency data for a period (default 5 minutes) governed by the setting of the configuration item [`object-latency-stat-period`](../datasource/datasource-datasource-monitoring-configuration-part-1.md#object-latency-stat-period). At the end of this period, the data is reset and the calculation (averaging) starts again.

The JSON map has the following form:

```
{
  "point_A->point_B" : {
    "min" : "<min-millisec>",
    "max" : "<max-millisec>",
    "avg" : "<avg-millisec>",
    "count" : "<count>"
  }
  ...
}
```

The key syntax `__point_A__\->__point_B__` identifies the calculated statistics between two data points in the latency chain. Look at the keys in the example below:

**Example JSON map**

```json
{
  "<init>->datasource_X": {
    "min": "0",
    "max": "0",
    "avg": "0",
    "count": "2"
  },
  "datasource_X->Liberator_E": {
    "min": "4",
    "max": "10",
    "avg": "7",
    "count": "2"
  }
}
```

The example map above captures two sets of statistics:

* ***&lt;init>\->datasource_X***: latency statistics between the point the initial latency timestamp was added to the update message and the point the DataSource packet for the message exited adapter 'datasource'.
* ***datasource_X\->Liberator_E***: latency statistics between the point the DataSource packet for the update message exited adapter 'datasource' to the point the DataSource packet entered 'Liberator'.

## Accessing latency statistics in the CMC

Follow the steps below:

1. Configure your integration adapters, Transformers and Liberators to record latency information. See [Record latency in record updates](../datasource/datasource-record-latency-in-record-updates.md).
2. Start the CMC (see [step 3](cmc-installing-the-cmc.md#start-the-cmc) in [Installing the CMC](cmc-installing-the-cmc.md)).
3. In the initial CMC view, double-click the Liberator box. You should see a new CMC screen that shows the details of the Liberator and its connections to the other Platform components in your installation.

   For example:

   ![CMC_LatencyTestSetup](../../images/CMC_LatencyTestSetup.png)
4. Select the **Explorer** tab. In the **MBean Explorer** pane, select the **rttpd.cache.object** entry. Drill down through the hierarchy to select the MBean for the object whose latency data you wish to view.

   For example, here’s the Mbean for Liberator’s cached object for the example subject `/PLATYPUS/SUBSCRIBE/RECORD1`. Latency statistic’s are stored in the MBean’s `latency-chain` attribute:

   ![CMCMbeanLatencyChain](../../images/CMCMbeanLatencyChain.png)
5. Double click on the `latency-chain` attribute to open the **Attribute Viewer** window:

   ![CMC-MBeanAttributeViewer](../../images/CMC-MBeanAttributeViewer.png)

   The attribute’s value is a JSON collection. You can select the JSON and copy it to your clipboard to analyse elsewhere.

---

**See also:**

* How can I... [Record latency in record updates](../datasource/datasource-record-latency-in-record-updates.md)
* Reference: [Latency chains configuration](../datasource/datasource-latency-chains-configuration.md)
