<!--
  NOTE: This copyright does *not* cover user programs that use HQ
  program services by normal system calls through the application
  program interfaces provided as part of the Hyperic Plug-in Development
  Kit or the Hyperic Client Development Kit - this is merely considered
  normal use of the program, and does *not* fall under the heading of
  "derived work".
  
  Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
  This file is part of HQ.
  
  HQ is free software; you can redistribute it and/or modify
  it under the terms version 2 of the GNU General Public License as
  published by the Free Software Foundation. This program is distributed
  in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE. See the GNU General Public License for more
  details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA.
 -->

<service name="Hibernate Session Factory" model="lightweight">
  <property name="OBJECT_NAME"
            value="Hibernate:type=statistics,application=%application%"/>

  <plugin type="autoinventory"/>    

  <config>
    <option name="application"
            description="Application Name"
            default="sample"/>
  </config>

  <metric name="Availability" indicator="true"/>

  <metric name="Entity Insert Count"
          template="${OBJECT_NAME}:EntityInsertCount"
          category="THROUGHPUT"
          indicator="true"
          collectionType="trendsup"/>

  <metric name="Query Execution Max Time"
          template="${OBJECT_NAME}:QueryExecutionMaxTime"
          category="PERFORMANCE"
          indicator="true"
          units="ms"/>

  <metric name="Entity Update Count"
          template="${OBJECT_NAME}:EntityUpdateCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Collection Update Count"
          template="${OBJECT_NAME}:CollectionUpdateCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Entity Load Count"
          template="${OBJECT_NAME}:EntityLoadCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Entity Fetch Count"
          template="${OBJECT_NAME}:EntityFetchCount"
          category="THROUGHPUT"
          indicator="true"
          collectionType="trendsup"/>

  <metric name="Entity Delete Count"
          template="${OBJECT_NAME}:EntityDeleteCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Collection Recreate Count"
          template="${OBJECT_NAME}:CollectionRecreateCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Query Execution Count"
          template="${OBJECT_NAME}:QueryExecutionCount"
          category="THROUGHPUT"
          indicator="true"
          collectionType="trendsup"/>

  <metric name="Flush Count"
          template="${OBJECT_NAME}:FlushCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Collection Load Count"
          template="${OBJECT_NAME}:CollectionLoadCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Successful Transaction Count"
          template="${OBJECT_NAME}:SuccessfulTransactionCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Query Cache Hit Count"
          template="${OBJECT_NAME}:QueryCacheHitCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Collection Remove Count"
          template="${OBJECT_NAME}:CollectionRemoveCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Connect Count"
          template="${OBJECT_NAME}:ConnectCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Start Time"
          template="${OBJECT_NAME}:StartTime"
          category="AVAILABILITY"
          units="epoch-millis"
          collectionType="static"/>

  <metric name="Second Level Cache Put Count"
          template="${OBJECT_NAME}:SecondLevelCachePutCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Query Cache Put Count"
          template="${OBJECT_NAME}:QueryCachePutCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Session Open Count"
          template="${OBJECT_NAME}:SessionOpenCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Transaction Count"
          template="${OBJECT_NAME}:TransactionCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Collection Fetch Count"
          template="${OBJECT_NAME}:CollectionFetchCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Session Close Count"
          template="${OBJECT_NAME}:SessionCloseCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Query Cache Miss Count"
          template="${OBJECT_NAME}:QueryCacheMissCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <metric name="Second Level Cache Miss Count"
          template="${OBJECT_NAME}:SecondLevelCacheMissCount"
          category="THROUGHPUT"
          collectionType="trendsup"/>

  <help>
  <![CDATA[
See Hibernate's doc: <a href="http://www.hibernate.org/216.html">Publishing statistics through JMX</a>
]]>
  </help>
</service>
