In order to have a better idea of the time spent into the database access layer, it can be interesting to get some statistics on that part of the code, knowing that most of the time spent into eXo JCR is mainly the database access. This statistics will then allow you to identify without using any profiler what is normally slow in this layer, which could help to fix the problem quickly.
In case you use
org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer
or
org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer
as WorkspaceDataContainer, you can get statistics on the
time spent into the database access layer. The database access layer (in
eXo JCR) is represented by the methods of the interface
org.exoplatform.services.jcr.storage.WorkspaceStorageConnection,
so for all the methods defined in this interface, we can have the
following figures:
The minimum time spent into the method.
The maximum time spent into the method.
The average time spent into the method.
The total amount of time spent into the method.
The total amount of time the method has been called.
Those figures are also available globally for all the methods which gives us the global behavior of this layer.
If you want to enable the statistics, you just need to set the JVM parameter called JDBCWorkspaceDataContainer.statistics.enabled to true. The corresponding CSV file is StatisticsJDBCStorageConnection-${creation-timestamp}.csv for more details about how the csv files are managed, please refer to the section dedicated to the statistics manager.
The format of each column header is ${method-alias}-${metric-alias}. The metric alias are described in the statistics manager section.
The name of the category of statistics corresponding to these statistics is JDBCStorageConnection, this name is mostly needed to access to the statistics through JMX.
| global | This is the alias for all the methods. |
| getItemDataById | This is the alias for the method getItemData(String identifier). |
| getItemDataByNodeDataNQPathEntry | This is the alias for the method getItemData(NodeData parentData, QPathEntry name). |
| getChildNodesData | This is the alias for the method getChildNodesData(NodeData parent). |
| getChildNodesCount | This is the alias for the method getChildNodesCount(NodeData parent). |
| getChildPropertiesData | This is the alias for the method getChildPropertiesData(NodeData parent). |
| listChildPropertiesData | This is the alias for the method listChildPropertiesData(NodeData parent). |
| getReferencesData | This is the alias for the method getReferencesData(String nodeIdentifier). |
| commit | This is the alias for the method commit(). |
| addNodeData | This is the alias for the method add(NodeData data). |
| addPropertyData | This is the alias for the method add(PropertyData data). |
| updateNodeData | This is the alias for the method update(NodeData data). |
| updatePropertyData | This is the alias for the method update(PropertyData data). |
| deleteNodeData | This is the alias for the method delete(NodeData data). |
| deletePropertyData | This is the alias for the method delete(PropertyData data). |
| renameNodeData | This is the alias for the method rename(NodeData data). |
| rollback | This is the alias for the method rollback(). |
| isOpened | This is the alias for the method isOpened(). |
| close | This is the alias for the method close(). |