org.hibernate.search.stat.impl
Class StatisticsImpl

java.lang.Object
  extended by 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

Constructor Summary
StatisticsImpl(SearchFactoryImplementor searchFactoryImplementor)
           
 
Method Summary
 void clear()
          Reset all statistics.
 Set<String> getIndexedClassNames()
          Returns a list of all indexed classes.
 int getNumberOfIndexedEntities(String entity)
          Returns the number of documents for the given entity.
 long getObjectLoadingExecutionAvgTime()
          Get the average object loading time in nanoseconds.
 long getObjectLoadingExecutionMaxTime()
          Get the time in nanoseconds for the slowest object load.
 long getObjectLoadingTotalTime()
          Get the total object loading in nanoseconds.
 long getObjectsLoadedCount()
          Gets the total number of objects loaded
 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.
 boolean isStatisticsEnabled()
          Are statistics logged
 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(SearchFactoryImplementor searchFactoryImplementor)
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

getSearchQueryExecutionMaxTime

public long getSearchQueryExecutionMaxTime()
Description copied from interface: Statistics
Get the time in nanoseconds of the slowest search.

Specified by:
getSearchQueryExecutionMaxTime in interface Statistics

getSearchQueryExecutionAvgTime

public long getSearchQueryExecutionAvgTime()
Description copied from interface: Statistics
Get the average search time in nanoseconds.

Specified by:
getSearchQueryExecutionAvgTime in interface Statistics

getSearchQueryExecutionMaxTimeQueryString

public String getSearchQueryExecutionMaxTimeQueryString()
Description copied from interface: Statistics
Get the query string for the slowest query.

Specified by:
getSearchQueryExecutionMaxTimeQueryString in interface Statistics

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()
Description copied from interface: Statistics
Gets the total number of objects loaded

Specified by:
getObjectsLoadedCount in interface Statistics

getObjectLoadingTotalTime

public long getObjectLoadingTotalTime()
Description copied from interface: Statistics
Get the total object loading in nanoseconds.

Specified by:
getObjectLoadingTotalTime in interface Statistics

getObjectLoadingExecutionMaxTime

public long getObjectLoadingExecutionMaxTime()
Description copied from interface: Statistics
Get the time in nanoseconds for the slowest object load.

Specified by:
getObjectLoadingExecutionMaxTime in interface Statistics

getObjectLoadingExecutionAvgTime

public long getObjectLoadingExecutionAvgTime()
Description copied from interface: Statistics
Get the average object loading time in nanoseconds.

Specified by:
getObjectLoadingExecutionAvgTime in interface Statistics

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()
Description copied from interface: Statistics
Are statistics logged

Specified by:
isStatisticsEnabled in interface Statistics

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

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.


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