@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getLoadCount() : 0 ); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override protected void handle(CollectionStatistics statistics, OperationContext context, String attributeName) { long count = statistics.getLoadCount(); context.getResult().set(count); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { CollectionStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
protected void logCollections(StringBuilder builder, String lineSep, Statistics stats) { builder.append("Important collections statistics: ").append(lineSep); for (String col : stats.getCollectionRoleNames()) { CollectionStatistics collectionStats = stats.getCollectionStatistics(col); if (collectionStats.getRecreateCount() > LIMIT || collectionStats.getUpdateCount() > LIMIT || collectionStats.getRemoveCount() > LIMIT || collectionStats.getLoadCount() > LIMIT || collectionStats.getFetchCount() > LIMIT) { builder.append(col).append(" - ") .append("recreated: ").append(collectionStats.getRecreateCount()) .append(", updated: ").append(collectionStats.getUpdateCount()) .append(", removed: ").append(collectionStats.getRemoveCount()) .append(", loaded: ").append(collectionStats.getLoadCount()) .append(", fetched: ").append(collectionStats.getFetchCount()) .append(lineSep); } } builder.append(lineSep); }
public static String[] getCollectionStatistics(final SessionFactory sessionFactory, final String collectionRoleName) { if (isNull(sessionFactory)) throw new NullPointerException("Parameter sessionFactory is null"); if (isNull(collectionRoleName)) throw new NullPointerException("Parameter collectionRoleName is null"); if (collectionRoleName.isEmpty()) throw new IllegalArgumentException("Parameter collectionRoleName is a empty String"); final Statistics sfstats = sessionFactory.getStatistics(); if (!ArrayUtils.contains(sfstats.getCollectionRoleNames(), collectionRoleName)) throw new IllegalArgumentException("Collection Role " + collectionRoleName + " is not managed by given SessionFactory"); final CollectionStatistics stats = sfstats.getCollectionStatistics(collectionRoleName); return new String[] { "+ Collection Statistics: " + collectionRoleName, "+", "+ Fetched: " + stats.getFetchCount(), "+ Recreated: " + stats.getRecreateCount(), "+ Loaded: " + stats.getLoadCount(), "+ Updated: " + stats.getUpdateCount(), "+ Removed: " + stats.getRemoveCount(), "+", "+" }; }
public CollectionStats(String name, CollectionStatistics src) { this(name); this.loadCount = src.getLoadCount(); this.fetchCount = src.getFetchCount(); this.updateCount = src.getUpdateCount(); this.removeCount = src.getRemoveCount(); this.recreateCount = src.getRecreateCount(); }
public CollectionStats(String name, CollectionStatistics src) { this(name); this.loadCount = src.getLoadCount(); this.fetchCount = src.getFetchCount(); this.updateCount = src.getUpdateCount(); this.removeCount = src.getRemoveCount(); this.recreateCount = src.getRecreateCount(); }
public CollectionStats(String name, CollectionStatistics src) { this(name); this.loadCount = src.getLoadCount(); this.fetchCount = src.getFetchCount(); this.updateCount = src.getUpdateCount(); this.removeCount = src.getRemoveCount(); this.recreateCount = src.getRecreateCount(); }
private void addCollectionStats(List<ApplicationStat> res, Statistics stats) { addStat(res, "collection/total/fetches", stats.getCollectionFetchCount()); addStat(res, "collection/total/loads", stats.getCollectionLoadCount()); addStat(res, "collection/total/recreates", stats.getCollectionRecreateCount()); addStat(res, "collection/total/removes", stats.getCollectionRemoveCount()); addStat(res, "collection/total/updates", stats.getCollectionUpdateCount()); for (String collectionRole : stats.getCollectionRoleNames()) { CollectionStatistics collStats = stats.getCollectionStatistics(collectionRole); addStat(res, "collection/" + collectionRole + "/fetches", collStats.getFetchCount()); addStat(res, "collection/" + collectionRole + "/loads", collStats.getLoadCount()); addStat(res, "collection/" + collectionRole + "/recreates", collStats.getRecreateCount()); addStat(res, "collection/" + collectionRole + "/removes", collStats.getRemoveCount()); addStat(res, "collection/" + collectionRole + "/update", collStats.getUpdateCount()); } }
QueryStatistics queryStats = stats.getQueryStatistics("from Store s"); queryStats.getCacheHitCount(); queryStats.getCacheMissCount(); queryStats.getCachePutCount(); queryStats.getExecutionCount(); queryStats.getExecutionAvgTime(); queryStats.getExecutionMaxTime(); queryStats.getExecutionMinTime(); queryStats.getExecutionRowCount(); SecondLevelCacheStatistics cacheStats = stats.getSecondLevelCacheStatistics("Sale.cache"); cacheStats.getElementCountInMemory(); cacheStats.getElementCountOnDisk(); cacheStats.getEntries(); cacheStats.getHitCount(); cacheStats.getMissCount(); cacheStats.getPutCount(); cacheStats.getSizeInMemory(); CollectionStatistics collectionStats = stats.getCollectionStatistics("Sale.items"); collectionStats.getFetchCount(); collectionStats.getLoadCount(); collectionStats.getRecreateCount(); collectionStats.getRemoveCount(); collectionStats.getUpdateCount();