use of org.apache.jackrabbit.stats.RepositoryStatisticsImpl in project jackrabbit-oak by apache.
the class DefaultStatisticsProviderTest method getRegisteredTimeSeries.
private Set<String> getRegisteredTimeSeries(DefaultStatisticsProvider statsProvider) {
RepositoryStatisticsImpl stats = (RepositoryStatisticsImpl) statsProvider.getStats();
Set<String> names = new HashSet<String>();
for (Map.Entry<String, TimeSeries> e : stats) {
names.add(e.getKey());
}
return names;
}
use of org.apache.jackrabbit.stats.RepositoryStatisticsImpl in project jackrabbit by apache.
the class AbstractBundlePersistenceManager method init.
// -------------------------------------------------< PersistenceManager >---
/**
* {@inheritDoc}
*
* Initializes the internal structures of this abstract persistence manager.
*/
public void init(PMContext context) throws Exception {
this.context = context;
// init bundle cache
bundles = new ConcurrentCache<NodeId, NodePropBundle>(context.getHomeDir().getName() + "BundleCache");
bundles.setMaxMemorySize(bundleCacheSize);
bundles.setAccessListener(this);
// statistics
RepositoryStatisticsImpl stats = context.getRepositoryStatistics();
readCounter = stats.getCounter(RepositoryStatistics.Type.BUNDLE_READ_COUNTER);
writeCounter = stats.getCounter(RepositoryStatistics.Type.BUNDLE_WRITE_COUNTER);
writeDuration = stats.getCounter(RepositoryStatistics.Type.BUNDLE_WRITE_DURATION);
cacheAccessCounter = stats.getCounter(RepositoryStatistics.Type.BUNDLE_CACHE_ACCESS_COUNTER);
cacheSizeCounter = stats.getCounter(RepositoryStatistics.Type.BUNDLE_CACHE_SIZE_COUNTER);
cacheMissCounter = stats.getCounter(RepositoryStatistics.Type.BUNDLE_CACHE_MISS_COUNTER);
cacheMissDuration = stats.getCounter(RepositoryStatistics.Type.BUNDLE_CACHE_MISS_DURATION);
}
use of org.apache.jackrabbit.stats.RepositoryStatisticsImpl in project jackrabbit by apache.
the class QueryImpl method execute.
/**
* This method simply forwards the <code>execute</code> call to the
* {@link ExecutableQuery} object returned by
* {@link QueryHandler#createExecutableQuery}.
* {@inheritDoc}
*/
public QueryResult execute() throws RepositoryException {
checkInitialized();
long time = System.nanoTime();
QueryResult result = sessionContext.getSessionState().perform(new SessionOperation<QueryResult>() {
public QueryResult perform(SessionContext context) throws RepositoryException {
return query.execute(offset, limit);
}
public String toString() {
return "query.execute(" + statement + ")";
}
});
time = System.nanoTime() - time;
final long timeMs = time / 1000000;
log.debug("executed in {} ms. ({})", timeMs, statement);
RepositoryStatisticsImpl statistics = sessionContext.getRepositoryContext().getRepositoryStatistics();
statistics.getCounter(Type.QUERY_COUNT).incrementAndGet();
statistics.getCounter(Type.QUERY_DURATION).addAndGet(timeMs);
sessionContext.getRepositoryContext().getStatManager().getQueryStat().logQuery(language, statement, timeMs);
return result;
}
use of org.apache.jackrabbit.stats.RepositoryStatisticsImpl in project jackrabbit by apache.
the class QueryObjectModelImpl method execute.
public QueryResult execute() throws RepositoryException {
long time = System.nanoTime();
final QueryResult result = sessionContext.getSessionState().perform(new SessionOperation<QueryResult>() {
public QueryResult perform(SessionContext context) throws RepositoryException {
final QueryEngine engine = new QueryEngine(sessionContext.getSessionImpl(), lqf, variables);
return engine.execute(getColumns(), getSource(), getConstraint(), getOrderings(), offset, limit);
}
public String toString() {
return "query.execute(" + statement + ")";
}
});
time = System.nanoTime() - time;
final long timeMs = time / 1000000;
log.debug("executed in {} ms. ({})", timeMs, statement);
RepositoryStatisticsImpl statistics = sessionContext.getRepositoryContext().getRepositoryStatistics();
statistics.getCounter(Type.QUERY_COUNT).incrementAndGet();
statistics.getCounter(Type.QUERY_DURATION).addAndGet(timeMs);
sessionContext.getRepositoryContext().getStatManager().getQueryStat().logQuery(language, statement, timeMs);
return result;
}
use of org.apache.jackrabbit.stats.RepositoryStatisticsImpl in project jackrabbit by apache.
the class PersistenceManagerTest method assertPersistenceManager.
private void assertPersistenceManager(PersistenceManager manager) throws Exception {
manager.init(new PMContext(directory, new MemoryFileSystem(), RepositoryImpl.ROOT_NODE_ID, new NamespaceRegistryImpl(new MemoryFileSystem()), null, null, new RepositoryStatisticsImpl()));
try {
assertCreateNewNode(manager);
assertCreateNewProperty(manager);
assertMissingItemStates(manager);
assertCreateUpdateDelete(manager);
} finally {
manager.close();
}
}
Aggregations