@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics( getEntityManagerFactory( args ) ); return Long.valueOf( statistics != null ? statistics.getSecondLevelCachePutCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
json.put("SecondLevelCacheHitCount", statistics.getSecondLevelCacheHitCount()); json.put("SecondLevelCacheMissCount", statistics.getSecondLevelCacheMissCount()); json.put("SecondLevelCachePutCount", statistics.getSecondLevelCachePutCount()); json.put("SessionCloseCount", statistics.getSessionCloseCount()); json.put("SessionOpenCount", statistics.getSessionOpenCount());
@Override public double getValue(Statistics statistics) { return statistics.getSecondLevelCachePutCount(); } }
assertEquals(0L, statistics.getSecondLevelCachePutCount()); assertFalse(sessionFactory.getCache().containsEntity(PurchaseOrder.class, 1L)); assertEquals(0, statistics.getSecondLevelCachePutCount()); assertEquals( 0, statistics.getSecondLevelCachePutCount() );
assertEquals( 3, statistics.getSecondLevelCachePutCount() ); assertEquals( 1, sqlStatementInterceptor.getSqlQueries().size() );
/** * @see StatisticsServiceMBean#getSecondLevelCachePutCount() */ public long getSecondLevelCachePutCount() { return stats.getSecondLevelCachePutCount(); } /**
/** * @see StatisticsServiceMBean#getSecondLevelCachePutCount() */ public long getSecondLevelCachePutCount() { return stats.getSecondLevelCachePutCount(); }
/** * @see StatisticsServiceMBean#getSecondLevelCachePutCount() */ public long getSecondLevelCachePutCount() { return stats.getSecondLevelCachePutCount(); }
/** * @see StatisticsServiceMBean#getSecondLevelCachePutCount() */ public long getSecondLevelCachePutCount() { return stats.getSecondLevelCachePutCount(); } /**
@Override void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) { response.set(stats.getStatistics().getSecondLevelCachePutCount()); } });
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return Long.valueOf(statistics != null ? statistics.getSecondLevelCachePutCount() : 0); } };
public void printStats() { System.out.println("2lc put count: " + sessionFactory.getStatistics().getSecondLevelCachePutCount()); System.out.println("2lc hit count: " + sessionFactory.getStatistics().getSecondLevelCacheHitCount()); System.out.println("2lc miss count: " + sessionFactory.getStatistics().getSecondLevelCacheMissCount()); }
@Override protected void populateStats(Statistics stats) throws Exception { org.hibernate.stat.Statistics hs = sessionFactory.getStatistics(); stats.add("Query cache hit count", hs.getQueryCacheHitCount()); stats.add("Query cache miss count", hs.getQueryCacheMissCount()); stats.add("Query cache put count", hs.getQueryCachePutCount()); stats.add("2nd level cache hit count" , hs.getSecondLevelCacheHitCount()); stats.add("2nd level cache miss count", hs.getSecondLevelCacheMissCount()); stats.add("2nd level cache put count", hs.getSecondLevelCachePutCount()); }
private void addSecondLevelCacheStats(List<ApplicationStat> res, Statistics stats) { addCacheStat(res, "2Cache/total/", stats.getSecondLevelCacheHitCount(), stats.getSecondLevelCacheMissCount(), stats.getSecondLevelCachePutCount()); for (String cacheRegion : stats.getSecondLevelCacheRegionNames()) { SecondLevelCacheStatistics cStats = stats.getSecondLevelCacheStatistics(cacheRegion); addCacheStat(res, "2Cache/" + cacheRegion + "/", cStats.getHitCount(), cStats.getMissCount(), cStats.getPutCount()); addStat(res, "2Cache/" + cacheRegion + "/size", cStats.getElementCountInMemory(), "onDisk=" + cStats.getElementCountOnDisk() + ", memSize=" + cStats.getSizeInMemory()); } }