/** * {@inheritDoc} * * @see HibernateStats#getQueryStats() */ public TabularData getQueryStats() { List<CompositeData> result = new ArrayList<CompositeData>(); Statistics statistics = getStatistics(); for (String query : statistics.getQueries()) { QueryStats queryStats = new QueryStats(query, statistics.getQueryStatistics(query)); result.add(queryStats.toCompositeData()); } TabularData td = QueryStats.newTabularDataInstance(); td.putAll(result.toArray(new CompositeData[result.size()])); return td; }
/** * {@inheritDoc} * * @see HibernateStats#getEntityStats() */ public TabularData getEntityStats() { List<CompositeData> result = new ArrayList<CompositeData>(); Statistics statistics = getStatistics(); for (String entity : statistics.getEntityNames()) { EntityStats entityStats = new EntityStats(entity, statistics.getEntityStatistics(entity)); result.add(entityStats.toCompositeData()); } TabularData td = EntityStats.newTabularDataInstance(); td.putAll(result.toArray(new CompositeData[result.size()])); return td; }
/** {@inheritDoc} */ public TabularData getCacheRegionStats() { List<CompositeData> list = new ArrayList<CompositeData>(); Statistics statistics = getStatistics(); for (String region : statistics.getSecondLevelCacheRegionNames()) { CacheRegionStats l2CacheStats = new CacheRegionStats(region, statistics.getSecondLevelCacheStatistics(region)); list.add(l2CacheStats.toCompositeData()); } TabularData td = CacheRegionStats.newTabularDataInstance(); td.putAll(list.toArray(new CompositeData[list.size()])); return td; }
/** * {@inheritDoc} * * @see HibernateStats#getCollectionStats() */ public TabularData getCollectionStats() { List<CompositeData> result = new ArrayList<CompositeData>(); Statistics statistics = getStatistics(); for (String roleName : statistics.getCollectionRoleNames()) { CollectionStats collectionStats = new CollectionStats(roleName, statistics.getCollectionStatistics(roleName)); result.add(collectionStats.toCompositeData()); } TabularData td = CollectionStats.newTabularDataInstance(); td.putAll(result.toArray(new CompositeData[result.size()])); return td; }