@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics( getEntityManagerFactory( args ) ); return Long.valueOf( statistics != null ? statistics.getEntityFetchCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
json.put("EntityInsertCount", statistics.getEntityInsertCount()); json.put("EntityLoadCount", statistics.getEntityLoadCount()); json.put("EntityFetchCount", statistics.getEntityFetchCount()); json.put("EntityUpdateCount", statistics.getEntityUpdateCount()); json.put("QueryExecutionCount", statistics.getQueryExecutionCount());
@Override public double getValue(Statistics statistics) { return statistics.getEntityFetchCount(); } }
/** * @see StatisticsServiceMBean#getEntityFetchCount() */ public long getEntityFetchCount() { return stats.getEntityFetchCount(); } /**
/** * @see StatisticsServiceMBean#getEntityFetchCount() */ public long getEntityFetchCount() { return stats.getEntityFetchCount(); } /**
/** * @see StatisticsServiceMBean#getEntityFetchCount() */ public long getEntityFetchCount() { return stats.getEntityFetchCount(); } /**
/** * @see StatisticsServiceMBean#getEntityFetchCount() */ public long getEntityFetchCount() { return stats.getEntityFetchCount(); } /**
@Override void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) { response.set(stats.getStatistics().getEntityFetchCount()); } });
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getEntityFetchCount() : 0); } };
public StatisticData[] retrieveStatisticData() { final List<StatisticData> resultList = new ArrayList<StatisticData>(); for (Map.Entry<String, Statistics> entry : statistics.entrySet()) { final String element = entry.getKey(); final Statistics stats = entry.getValue(); resultList.add(new StatisticData(NAME_DELETE, element, stats.getEntityDeleteCount())); resultList.add(new StatisticData(NAME_FETCH, element, stats.getEntityFetchCount())); resultList.add(new StatisticData(NAME_INSERT, element, stats.getEntityInsertCount())); resultList.add(new StatisticData(NAME_LOAD, element, stats.getEntityLoadCount())); resultList.add(new StatisticData(NAME_UPDATE, element, stats.getEntityUpdateCount())); } if (0 == resultList.size()) { return StatisticData.EMPTY_ARRAY; } final StatisticData[] result = new StatisticData[resultList.size()]; resultList.toArray(result); return result; } }
@Override public void printSessionFactoryStats() { logger.info("sessionFactoryStats:"); Statistics stats = sessionFactory.getStatistics(); String[] cacheRegionNames = stats.getSecondLevelCacheRegionNames(); logger.info("-- second-lvel-cache region details: "); for (int i = 0; i < cacheRegionNames.length; i++) { logger.info(i + ". " + cacheRegionNames[i]); SecondLevelCacheStatistics regionStats = stats.getSecondLevelCacheStatistics(cacheRegionNames[i]); if (regionStats.getElementCountInMemory() > 0) { logger.info(".. cache-region-count-in-memory :" + regionStats.getElementCountInMemory()); logger.info(".. cache-region-put :" + regionStats.getPutCount()); logger.info(".. cache-region-hit :" + regionStats.getHitCount()); logger.info(".. cache-region-miss :" + regionStats.getMissCount()); } } logger.info("-- second-lvel-cache summary: "); logger.info("cache-put: " + stats.getSecondLevelCachePutCount()); logger.info("cache-hit: " + stats.getSecondLevelCacheHitCount()); logger.info("cache-miss: " + stats.getSecondLevelCacheMissCount()); logger.info("query cache-put: " + stats.getQueryCachePutCount()); logger.info("query cache-hit: " + stats.getQueryCacheHitCount()); logger.info("query cache-miss: " + stats.getQueryCacheMissCount()); logger.info("-- "); logger.info("session.openCount: " + stats.getSessionOpenCount()); logger.info("session.entityFetchCount: " + stats.getEntityFetchCount()); logger.info("session.prepareStatementCount: " + stats.getPrepareStatementCount()); logger.info("."); }
private void addEntityStats(List<ApplicationStat> res, Statistics stats) { addStat(res, "entity/total/deletes", stats.getEntityDeleteCount()); addStat(res, "entity/total/fetches", stats.getEntityFetchCount()); addStat(res, "entity/total/inserts", stats.getEntityInsertCount()); addStat(res, "entity/total/loads", stats.getEntityLoadCount()); addStat(res, "entity/total/updates", stats.getEntityUpdateCount()); for (String entityName : stats.getEntityNames()) { EntityStatistics entStats = stats.getEntityStatistics(entityName); addStat(res, "entity/" + entityName + "/deletes", entStats.getDeleteCount()); addStat(res, "entity/" + entityName + "/fetches", entStats.getFetchCount()); addStat(res, "entity/" + entityName + "/inserts", entStats.getInsertCount()); addStat(res, "entity/" + entityName + "/loads", entStats.getLoadCount()); addStat(res, "entity/" + entityName + "/updates", entStats.getUpdateCount()); } }