Class DocumentStoreStats
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.DocumentStoreStats
-
- All Implemented Interfaces:
DocumentStoreStatsCollector
,DocumentStoreStatsMBean
public class DocumentStoreStats extends Object implements DocumentStoreStatsCollector, DocumentStoreStatsMBean
Document Store statistics helper class.
-
-
Field Summary
Fields Modifier and Type Field Description static int
PERF_LOG_THRESHOLD
-
Fields inherited from interface org.apache.jackrabbit.oak.plugins.document.DocumentStoreStatsMBean
TYPE
-
-
Constructor Summary
Constructors Constructor Description DocumentStoreStats(StatisticsProvider provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doneCreate(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids, boolean insertSuccess)
Called when a document is created in the given collectionvoid
doneCreateOrUpdate(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids)
Called when multiple document are either created or updated.void
doneFindAndModify(long timeTakenNanos, Collection<? extends Document> collection, String key, boolean newEntry, boolean success, int retryCount)
Called when a update operation was completed which affected single document.void
doneFindAndModify(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids, boolean success, int retryCount)
Called when a update operation was completed which could have affected multiple documents.void
doneFindCached(Collection<? extends Document> collection, String key)
Called when a document with given key is found from the cachevoid
doneFindUncached(long timeTakenNanos, Collection<? extends Document> collection, String key, boolean docFound, boolean isSlaveOk)
Called when a document with given key is read from remote storevoid
donePrefetch(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids)
Called when a prefetch operation for documents was completed.void
doneQuery(long timeTakenNanos, Collection<? extends Document> collection, String fromKey, String toKey, boolean indexedProperty, int resultSize, long lockTime, boolean isSlaveOk)
Called when query with given parameters is performedvoid
doneRemove(long timeTakenNanos, Collection<? extends Document> collection, int removeCount)
Called when a remove operation for documents was completed.CompositeData
getCreateJournalHistory()
CompositeData
getCreateNodesHistory()
CompositeData
getFindCachedNodesHistory()
CompositeData
getFindNodesFromPrimaryHistory()
CompositeData
getFindNodesFromSlaveHistory()
CompositeData
getFindNodesMissingHistory()
CompositeData
getFindSplitNodesHistory()
long
getJournalCreateCount()
long
getJournalReadCount()
long
getNodesCreateCount()
long
getNodesFindCount()
long
getNodesFindMissingCount()
long
getNodesFindQueryCount()
long
getNodesPrefetchCount()
long
getNodesReadByQueryCount()
long
getNodesRemoveCount()
long
getNodesUpdateCount()
CompositeData
getPrefetchNodesHistory()
CompositeData
getQueryJournalHistory()
CompositeData
getQueryNodesFromPrimaryHistory()
CompositeData
getQueryNodesFromSlaveHistory()
CompositeData
getQueryNodesLockHistory()
CompositeData
getRemoveNodesHistory()
CompositeData
getUpdateNodesFailureHistory()
CompositeData
getUpdateNodesHistory()
CompositeData
getUpdateNodesRetryHistory()
-
-
-
Field Detail
-
PERF_LOG_THRESHOLD
public static final int PERF_LOG_THRESHOLD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DocumentStoreStats
public DocumentStoreStats(StatisticsProvider provider)
-
-
Method Detail
-
doneFindCached
public void doneFindCached(Collection<? extends Document> collection, String key)
Description copied from interface:DocumentStoreStatsCollector
Called when a document with given key is found from the cache- Specified by:
doneFindCached
in interfaceDocumentStoreStatsCollector
- Parameters:
collection
- the collectionkey
- collection key which is found
-
doneFindUncached
public void doneFindUncached(long timeTakenNanos, Collection<? extends Document> collection, String key, boolean docFound, boolean isSlaveOk)
Description copied from interface:DocumentStoreStatsCollector
Called when a document with given key is read from remote store- Specified by:
doneFindUncached
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionkey
- collection keydocFound
- true if document is foundisSlaveOk
- true if find was performed against a secondary instance
-
doneQuery
public void doneQuery(long timeTakenNanos, Collection<? extends Document> collection, String fromKey, String toKey, boolean indexedProperty, int resultSize, long lockTime, boolean isSlaveOk)
Description copied from interface:DocumentStoreStatsCollector
Called when query with given parameters is performed- Specified by:
doneQuery
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionfromKey
- the start value (excluding)toKey
- the end value (excluding)indexedProperty
- true if indexedProperty was specifiedresultSize
- number of documents found for given querylockTime
- time in millis to acquire any lock (-1
if no lock was required)isSlaveOk
- true if find was performed against a secondary instance
-
doneCreate
public void doneCreate(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids, boolean insertSuccess)
Description copied from interface:DocumentStoreStatsCollector
Called when a document is created in the given collection- Specified by:
doneCreate
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionids
- list of ids request to be createdinsertSuccess
- true if the insert was successful
-
doneCreateOrUpdate
public void doneCreateOrUpdate(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids)
Description copied from interface:DocumentStoreStatsCollector
Called when multiple document are either created or updated.- Specified by:
doneCreateOrUpdate
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionids
- list of ids request to be created or updated
-
doneFindAndModify
public void doneFindAndModify(long timeTakenNanos, Collection<? extends Document> collection, String key, boolean newEntry, boolean success, int retryCount)
Description copied from interface:DocumentStoreStatsCollector
Called when a update operation was completed which affected single document.- Specified by:
doneFindAndModify
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionkey
- collection which got updated or insertednewEntry
- true if the document was newly created due to given operationsuccess
- true if the update was successretryCount
- number of retries done to get the update
-
doneFindAndModify
public void doneFindAndModify(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids, boolean success, int retryCount)
Description copied from interface:DocumentStoreStatsCollector
Called when a update operation was completed which could have affected multiple documents.- Specified by:
doneFindAndModify
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionids
- List of document ids which got updatedsuccess
- true if the update was successretryCount
- number of retries done to get the update
-
doneRemove
public void doneRemove(long timeTakenNanos, Collection<? extends Document> collection, int removeCount)
Description copied from interface:DocumentStoreStatsCollector
Called when a remove operation for documents was completed.- Specified by:
doneRemove
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionremoveCount
- the number of removed documents
-
donePrefetch
public void donePrefetch(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids)
Description copied from interface:DocumentStoreStatsCollector
Called when a prefetch operation for documents was completed.- Specified by:
donePrefetch
in interfaceDocumentStoreStatsCollector
- Parameters:
timeTakenNanos
- time takencollection
- the collectionids
- list of IDs to prefetch / read
-
getNodesFindCount
public long getNodesFindCount()
- Specified by:
getNodesFindCount
in interfaceDocumentStoreStatsMBean
-
getNodesFindQueryCount
public long getNodesFindQueryCount()
- Specified by:
getNodesFindQueryCount
in interfaceDocumentStoreStatsMBean
-
getNodesFindMissingCount
public long getNodesFindMissingCount()
- Specified by:
getNodesFindMissingCount
in interfaceDocumentStoreStatsMBean
-
getNodesReadByQueryCount
public long getNodesReadByQueryCount()
- Specified by:
getNodesReadByQueryCount
in interfaceDocumentStoreStatsMBean
-
getNodesCreateCount
public long getNodesCreateCount()
- Specified by:
getNodesCreateCount
in interfaceDocumentStoreStatsMBean
-
getNodesUpdateCount
public long getNodesUpdateCount()
- Specified by:
getNodesUpdateCount
in interfaceDocumentStoreStatsMBean
-
getNodesRemoveCount
public long getNodesRemoveCount()
- Specified by:
getNodesRemoveCount
in interfaceDocumentStoreStatsMBean
-
getJournalCreateCount
public long getJournalCreateCount()
- Specified by:
getJournalCreateCount
in interfaceDocumentStoreStatsMBean
-
getJournalReadCount
public long getJournalReadCount()
- Specified by:
getJournalReadCount
in interfaceDocumentStoreStatsMBean
-
getNodesPrefetchCount
public long getNodesPrefetchCount()
- Specified by:
getNodesPrefetchCount
in interfaceDocumentStoreStatsMBean
-
getFindCachedNodesHistory
public CompositeData getFindCachedNodesHistory()
- Specified by:
getFindCachedNodesHistory
in interfaceDocumentStoreStatsMBean
-
getFindSplitNodesHistory
public CompositeData getFindSplitNodesHistory()
- Specified by:
getFindSplitNodesHistory
in interfaceDocumentStoreStatsMBean
-
getFindNodesFromPrimaryHistory
public CompositeData getFindNodesFromPrimaryHistory()
- Specified by:
getFindNodesFromPrimaryHistory
in interfaceDocumentStoreStatsMBean
-
getFindNodesFromSlaveHistory
public CompositeData getFindNodesFromSlaveHistory()
- Specified by:
getFindNodesFromSlaveHistory
in interfaceDocumentStoreStatsMBean
-
getFindNodesMissingHistory
public CompositeData getFindNodesMissingHistory()
- Specified by:
getFindNodesMissingHistory
in interfaceDocumentStoreStatsMBean
-
getQueryNodesFromSlaveHistory
public CompositeData getQueryNodesFromSlaveHistory()
- Specified by:
getQueryNodesFromSlaveHistory
in interfaceDocumentStoreStatsMBean
-
getQueryNodesFromPrimaryHistory
public CompositeData getQueryNodesFromPrimaryHistory()
- Specified by:
getQueryNodesFromPrimaryHistory
in interfaceDocumentStoreStatsMBean
-
getQueryNodesLockHistory
public CompositeData getQueryNodesLockHistory()
- Specified by:
getQueryNodesLockHistory
in interfaceDocumentStoreStatsMBean
-
getQueryJournalHistory
public CompositeData getQueryJournalHistory()
- Specified by:
getQueryJournalHistory
in interfaceDocumentStoreStatsMBean
-
getCreateJournalHistory
public CompositeData getCreateJournalHistory()
- Specified by:
getCreateJournalHistory
in interfaceDocumentStoreStatsMBean
-
getCreateNodesHistory
public CompositeData getCreateNodesHistory()
- Specified by:
getCreateNodesHistory
in interfaceDocumentStoreStatsMBean
-
getUpdateNodesHistory
public CompositeData getUpdateNodesHistory()
- Specified by:
getUpdateNodesHistory
in interfaceDocumentStoreStatsMBean
-
getUpdateNodesRetryHistory
public CompositeData getUpdateNodesRetryHistory()
- Specified by:
getUpdateNodesRetryHistory
in interfaceDocumentStoreStatsMBean
-
getUpdateNodesFailureHistory
public CompositeData getUpdateNodesFailureHistory()
- Specified by:
getUpdateNodesFailureHistory
in interfaceDocumentStoreStatsMBean
-
getRemoveNodesHistory
public CompositeData getRemoveNodesHistory()
- Specified by:
getRemoveNodesHistory
in interfaceDocumentStoreStatsMBean
-
getPrefetchNodesHistory
public CompositeData getPrefetchNodesHistory()
- Specified by:
getPrefetchNodesHistory
in interfaceDocumentStoreStatsMBean
-
-