org.hibernate.search.stat.impl

## Class StatisticsImpl

- java.lang.Object
- - org.hibernate.search.stat.impl.StatisticsImpl

- All Implemented Interfaces:
    StatisticsImplementor, Statistics

      public class StatisticsImpl
      extends Object
      implements Statistics, StatisticsImplementor

  A concurrent implementation of the `Statistics` interface.
  Author:
    Hardy Ferentschik, Sanne Grinovero

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatisticsImpl(ExtendedSearchIntegrator extendedIntegrator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Reset all statistics.
    `Set<String>` | `getIndexedClassNames()` Returns a list of all indexed classes.
    `long` | `getIndexSize(String indexName)` Returns the size of the index with the given name, in bytes.
    `int` | `getNumberOfIndexedEntities(String entity)` Returns the number of documents for the given entity.
    `long` | `getObjectLoadingExecutionAvgTime()`
    `long` | `getObjectLoadingExecutionMaxTime()`
    `long` | `getObjectLoadingTotalTime()`
    `long` | `getObjectsLoadedCount()`
    `long` | `getSearchQueryExecutionAvgTime()` Get the average search time in nanoseconds.
    `long` | `getSearchQueryExecutionCount()` Get global number of executed search queries
    `long` | `getSearchQueryExecutionMaxTime()` Get the time in nanoseconds of the slowest search.
    `String` | `getSearchQueryExecutionMaxTimeQueryString()` Get the query string for the slowest query.
    `long` | `getSearchQueryTotalTime()` Get the total search time in nanoseconds.
    `String` | `getSearchVersion()` Returns the Hibernate Search version.
    `Map<String,Integer>` | `indexedEntitiesCount()` Returns a map of all indexed entities and their document count in the index.
    `Map<String,Long>` | `indexSizes()`
    `boolean` | `isStatisticsEnabled()`
    `void` | `objectLoadExecuted(long numberOfObjectsLoaded, long time)` Callback for number of object loaded from the db.
    `void` | `searchExecuted(String searchString, long time)` Callback for an executed Lucene search.
    `void` | `setStatisticsEnabled(boolean b)` Enable statistics logs (this is a dynamic parameter)

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StatisticsImpl

          public StatisticsImpl(ExtendedSearchIntegrator extendedIntegrator)

  - ### Method Detail

    - #### clear

          public void clear()

      Description copied from interface: `Statistics`
      Reset all statistics.
      Specified by:
        `clear` in interface `Statistics`

    - #### getSearchQueryExecutionCount

          public long getSearchQueryExecutionCount()

      Description copied from interface: `Statistics`
      Get global number of executed search queries
      Specified by:
        `getSearchQueryExecutionCount` in interface `Statistics`
      Returns:
        search query execution count

    - #### getSearchQueryTotalTime

          public long getSearchQueryTotalTime()

      Description copied from interface: `Statistics`
      Get the total search time in nanoseconds.
      Specified by:
        `getSearchQueryTotalTime` in interface `Statistics`
      Returns:
        the total search time in nanoseconds.

    - #### getSearchQueryExecutionMaxTime

          public long getSearchQueryExecutionMaxTime()

      Description copied from interface: `Statistics`
      Get the time in nanoseconds of the slowest search.
      Specified by:
        `getSearchQueryExecutionMaxTime` in interface `Statistics`
      Returns:
        the time in nanoseconds of the slowest search.

    - #### getSearchQueryExecutionAvgTime

          public long getSearchQueryExecutionAvgTime()

      Description copied from interface: `Statistics`
      Get the average search time in nanoseconds.
      Specified by:
        `getSearchQueryExecutionAvgTime` in interface `Statistics`
      Returns:
        the average search time in nanoseconds

    - #### getSearchQueryExecutionMaxTimeQueryString

          public String getSearchQueryExecutionMaxTimeQueryString()

      Description copied from interface: `Statistics`
      Get the query string for the slowest query.
      Specified by:
        `getSearchQueryExecutionMaxTimeQueryString` in interface `Statistics`
      Returns:
        the query string for the slowest query.

    - #### searchExecuted

          public void searchExecuted(String searchString,
                                     long time)

      Description copied from interface: `StatisticsImplementor`
      Callback for an executed Lucene search.
      Specified by:
        `searchExecuted` in interface `StatisticsImplementor`
      Parameters:
        `searchString` - executed query string
        `time` - time in nanoseconds to execute the search

    - #### getObjectsLoadedCount

          public long getObjectsLoadedCount()

      Specified by:
        `getObjectsLoadedCount` in interface `Statistics`
      Returns:
        the total number of objects loaded

    - #### getObjectLoadingTotalTime

          public long getObjectLoadingTotalTime()

      Specified by:
        `getObjectLoadingTotalTime` in interface `Statistics`
      Returns:
        the total object loading in nanoseconds.

    - #### getObjectLoadingExecutionMaxTime

          public long getObjectLoadingExecutionMaxTime()

      Specified by:
        `getObjectLoadingExecutionMaxTime` in interface `Statistics`
      Returns:
        the time in nanoseconds for the slowest object load.

    - #### getObjectLoadingExecutionAvgTime

          public long getObjectLoadingExecutionAvgTime()

      Specified by:
        `getObjectLoadingExecutionAvgTime` in interface `Statistics`
      Returns:
        the average object loading time in nanoseconds.

    - #### objectLoadExecuted

          public void objectLoadExecuted(long numberOfObjectsLoaded,
                                         long time)

      Description copied from interface: `StatisticsImplementor`
      Callback for number of object loaded from the db.
      Specified by:
        `objectLoadExecuted` in interface `StatisticsImplementor`
      Parameters:
        `numberOfObjectsLoaded` - Number of objects loaded
        `time` - time in nanoseconds to load the objects

    - #### isStatisticsEnabled

          public boolean isStatisticsEnabled()

      Specified by:
        `isStatisticsEnabled` in interface `Statistics`
      Returns:
        `true` if statistics are enabled, `false` otherwise

    - #### setStatisticsEnabled

          public void setStatisticsEnabled(boolean b)

      Description copied from interface: `Statistics`
      Enable statistics logs (this is a dynamic parameter)
      Specified by:
        `setStatisticsEnabled` in interface `Statistics`
      Parameters:
        `b` - if `true`, it enables the statistics.

    - #### getSearchVersion

          public String getSearchVersion()

      Description copied from interface: `Statistics`
      Returns the Hibernate Search version.
      Specified by:
        `getSearchVersion` in interface `Statistics`
      Returns:
        the Hibernate Search version

    - #### getIndexedClassNames

          public Set<String> getIndexedClassNames()

      Description copied from interface: `Statistics`
      Returns a list of all indexed classes.
      Specified by:
        `getIndexedClassNames` in interface `Statistics`
      Returns:
        list of all indexed classes

    - #### getNumberOfIndexedEntities

          public int getNumberOfIndexedEntities(String entity)

      Description copied from interface: `Statistics`
      Returns the number of documents for the given entity.
      Specified by:
        `getNumberOfIndexedEntities` in interface `Statistics`
      Parameters:
        `entity` - the fqc of the entity
      Returns:
        number of documents for the specified entity name

    - #### indexedEntitiesCount

          public Map<String,Integer> indexedEntitiesCount()

      Description copied from interface: `Statistics`
      Returns a map of all indexed entities and their document count in the index.
      Specified by:
        `indexedEntitiesCount` in interface `Statistics`
      Returns:
        a map of all indexed entities and their document count. The map key is the fqc of the entity and the map value is the document count.

    - #### getIndexSize

          public long getIndexSize(String indexName)

      Description copied from interface: `Statistics`
      Returns the size of the index with the given name, in bytes.
      Specified by:
        `getIndexSize` in interface `Statistics`
      Parameters:
        `indexName` - the index name (which may differ from the entity name, depending on configuration settings)
      Returns:
        the size of the given index, in bytes

    - #### indexSizes

          public Map<String,Long> indexSizes()

      Specified by:
        `indexSizes` in interface `Statistics`
      Returns:
        a map of all index names and the size of the corresponding index, in bytes. The map key is the index name (which may differ from the entity name, depending on configuration settings).

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved