Package org.apache.jackrabbit.stats
Class QueryStatImpl
- java.lang.Object
-
- org.apache.jackrabbit.stats.QueryStatImpl
-
- All Implemented Interfaces:
QueryStat
,QueryStatCore
public class QueryStatImpl extends Object implements QueryStatCore
DefaultQueryStatCore
implementation
-
-
Constructor Summary
Constructors Constructor Description QueryStatImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearPopularQueriesQueue()
clears the Popular queuevoid
clearSlowQueriesQueue()
clears the Slow queueQueryStatDto[]
getPopularQueries()
int
getPopularQueriesQueueSize()
QueryStatDto[]
getSlowQueries()
int
getSlowQueriesQueueSize()
boolean
isEnabled()
If this service is currently registering statsvoid
logQuery(String language, String statement, long durationMs)
Logs the call of each query ran on the repository.void
reset()
clears all datavoid
setEnabled(boolean enabled)
Enables/Disables the servicevoid
setPopularQueriesQueueSize(int size)
Change the size of the Popular queuevoid
setSlowQueriesQueueSize(int size)
Change the size of the Slow queue
-
-
-
Method Detail
-
getSlowQueriesQueueSize
public int getSlowQueriesQueueSize()
- Specified by:
getSlowQueriesQueueSize
in interfaceQueryStat
- Returns:
- size of the Slow queue
-
setSlowQueriesQueueSize
public void setSlowQueriesQueueSize(int size)
Description copied from interface:QueryStat
Change the size of the Slow queue- Specified by:
setSlowQueriesQueueSize
in interfaceQueryStat
- Parameters:
size
- the new size
-
isEnabled
public boolean isEnabled()
Description copied from interface:QueryStat
If this service is currently registering stats
-
setEnabled
public void setEnabled(boolean enabled)
Description copied from interface:QueryStat
Enables/Disables the service- Specified by:
setEnabled
in interfaceQueryStat
-
logQuery
public void logQuery(String language, String statement, long durationMs)
Description copied from interface:QueryStatCore
Logs the call of each query ran on the repository.- Specified by:
logQuery
in interfaceQueryStatCore
- Parameters:
language
- the query language, seeQueryManager.getSupportedQueryLanguages()
statement
- the querydurationMs
- time in ms
-
clearSlowQueriesQueue
public void clearSlowQueriesQueue()
Description copied from interface:QueryStat
clears the Slow queue- Specified by:
clearSlowQueriesQueue
in interfaceQueryStat
-
getSlowQueries
public QueryStatDto[] getSlowQueries()
- Specified by:
getSlowQueries
in interfaceQueryStat
- Returns:
- a sorted array containing the top
QueryStat.getSlowQueriesQueueSize()
slowest queries
-
getPopularQueries
public QueryStatDto[] getPopularQueries()
- Specified by:
getPopularQueries
in interfaceQueryStat
- Returns:
- a sorted array containing the
QueryStat.getPopularQueriesQueueSize()
most popular queries
-
getPopularQueriesQueueSize
public int getPopularQueriesQueueSize()
- Specified by:
getPopularQueriesQueueSize
in interfaceQueryStat
- Returns:
- size of the Popular queue
-
setPopularQueriesQueueSize
public void setPopularQueriesQueueSize(int size)
Description copied from interface:QueryStat
Change the size of the Popular queue- Specified by:
setPopularQueriesQueueSize
in interfaceQueryStat
- Parameters:
size
- the new size
-
clearPopularQueriesQueue
public void clearPopularQueriesQueue()
Description copied from interface:QueryStat
clears the Popular queue- Specified by:
clearPopularQueriesQueue
in interfaceQueryStat
-
-