<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory">Chapter 15. eXo JCR statistics</title><link rel="stylesheet" href="css/jbossorg.css" type="text/css"/><meta xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" name="generator" content="DocBook XSL Stylesheets V1.72.0"/><link rel="start" href="index.html" title="eXoJCR Reference Manual"/><link rel="up" href="part-jcr.html" title="Part I. eXoJCR"/><link rel="prev" href="ch-transaction-manager.html" title="Chapter 14. TransactionManagerLookup"/><link rel="next" href="part-kernel.html" title="Part II. eXoKernel"/></head><body><p id="title"><a href="http://www.jboss.org" class="site_href"><strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href"><strong>Community Documentation</strong></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="ch-transaction-manager.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="part-kernel.html"><strong>Next</strong></a></li></ul><div class="chapter" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="ch_statistics"/>Chapter 15. eXo JCR statistics</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ch-statistics#d0e2102">15.1. Statistics on the Database Access Layer</a></span></dt></dl></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="d0e2102"/>15.1. Statistics on the Database Access Layer</h2></div></div></div><p>In order to have a better idea of the time spent into the database
    access layer, it cans 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 anormally slow in this layer, which
    could help to fix the problem quickly.</p><p>In case you use
    <code class="envar">org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer</code>
    or
    <code class="envar">org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer</code>
    as <code class="envar">WorkspaceDataContainer</code>, 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
    <code class="envar">org.exoplatform.services.jcr.storage.WorkspaceStorageConnection</code>,
    so for all the methods defined in this interface, we can have the
    following figures: </p><div class="itemizedlist"><ul><li><p>The minimum time spent into the method.</p></li><li><p>The maximum time spent into the method.</p></li><li><p>The average time spent into the method.</p></li><li><p>The total amount of time spent into the method.</p></li><li><p>The total amount of times the method has been called.</p></li></ul></div><p>Those figures are also available globaly for all the methods which
    gives us the global behavior of this layer.</p><p>If you want to enable the statistics, you just need to set the JVM
    parameter called
    <span class="emphasis"><em>JDBCWorkspaceDataContainer.statistics.enabled</em></span> to
    <span class="emphasis"><em>true</em></span>. This will then create at startup a file called
    <span class="emphasis"><em>StatisticsJDBCStorageConnection-${creation-timestamp}.csv</em></span>
    into the user directory if it is possible otherwise it will create it into
    the temporary directory. The format of this file is <code class="envar">CSV</code>
    (i.e. Comma-Seperated Values), one new line will be added every 5 seconds
    and one last line will be added at JVM exit. Each line, will be composed
    of the 5 figures described above for each method and globaly for all the
    methods.</p><p>The format of each column header is
    ${method-alias}-${metric-alias}.</p><div class="table"><a id="d0e2155"/><p class="title"><b>Table 15.1. Method Alias</b></p><div class="table-contents"><table summary="Method Alias" border="1"><colgroup><col/><col/></colgroup><tbody><tr><td>global</td><td>This is the alias for all the methods.</td></tr><tr><td>getItemDataById</td><td>This is the alias for the method
            <span class="emphasis"><em>getItemData(String identifier).</em></span></td></tr><tr><td>getItemDataByNodeDataNQPathEntry</td><td>This is the alias for the method
            <span class="emphasis"><em>getItemData(NodeData parentData, QPathEntry
            name).</em></span></td></tr><tr><td>getChildNodesData</td><td>This is the alias for the method
            <span class="emphasis"><em>getChildNodesData(NodeData parent).</em></span></td></tr><tr><td>getChildNodesCount</td><td>This is the alias for the method
            <span class="emphasis"><em>getChildNodesCount(NodeData parent).</em></span></td></tr><tr><td>getChildPropertiesData</td><td>This is the alias for the method
            <span class="emphasis"><em>getChildPropertiesData(NodeData
            parent).</em></span></td></tr><tr><td>listChildPropertiesData</td><td>This is the alias for the method
            <span class="emphasis"><em>listChildPropertiesData(NodeData
            parent).</em></span></td></tr><tr><td>getReferencesData</td><td>This is the alias for the method
            <span class="emphasis"><em>getReferencesData(String
            nodeIdentifier).</em></span></td></tr><tr><td>commit</td><td>This is the alias for the method
            <span class="emphasis"><em>commit().</em></span></td></tr><tr><td>addNodeData</td><td>This is the alias for the method <span class="emphasis"><em>add(NodeData
            data).</em></span></td></tr><tr><td>addPropertyData</td><td>This is the alias for the method <span class="emphasis"><em>add(PropertyData
            data).</em></span></td></tr><tr><td>updateNodeData</td><td>This is the alias for the method <span class="emphasis"><em>update(NodeData
            data).</em></span></td></tr><tr><td>updatePropertyData</td><td>This is the alias for the method
            <span class="emphasis"><em>update(PropertyData data).</em></span></td></tr><tr><td>deleteNodeData</td><td>This is the alias for the method <span class="emphasis"><em>delete(NodeData
            data).</em></span></td></tr><tr><td>deletePropertyData</td><td>This is the alias for the method
            <span class="emphasis"><em>delete(PropertyData data).</em></span></td></tr><tr><td>renameNodeData</td><td>This is the alias for the method <span class="emphasis"><em>rename(NodeData
            data).</em></span></td></tr><tr><td>rollback</td><td>This is the alias for the method
            <span class="emphasis"><em>rollback().</em></span></td></tr><tr><td>isOpened</td><td>This is the alias for the method
            <span class="emphasis"><em>isOpened().</em></span></td></tr><tr><td>close</td><td>This is the alias for the method
            <span class="emphasis"><em>close().</em></span></td></tr></tbody></table></div></div><br class="table-break"/><div class="table"><a id="d0e2291"/><p class="title"><b>Table 15.2. Metric Alias</b></p><div class="table-contents"><table summary="Metric Alias" border="1"><colgroup><col/><col/></colgroup><tbody><tr><td>Min</td><td>The minimum time spent into the method.</td></tr><tr><td>Max</td><td>The maximum time spent into the method.</td></tr><tr><td>Total</td><td>The total amount of time spent into the method.</td></tr><tr><td>Avg</td><td>The average time spent into the method.</td></tr><tr><td>Times</td><td>The total amount of times the method has been
            called.</td></tr></tbody></table></div></div><br class="table-break"/></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="ch-transaction-manager.html"><strong>Prev</strong>Chapter 14. TransactionManagerLookup</a></li><li class="up"><a accesskey="u" href="#"><strong>Top of page</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Front page</strong></a></li><li class="next"><a accesskey="n" href="part-kernel.html"><strong>Next</strong>Part II. eXoKernel</a></li></ul></body></html>