@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics( getEntityManagerFactoryAccess( args ), getPathAddress( args ) ); return Long.valueOf( statistics != null ? statistics.getPutCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Test public void testGetEntityWithNullManyToOne() { sessionFactory().getCache().evictAllRegions(); sessionFactory().getStatistics().clear(); int id = doInHibernate( this::sessionFactory, session -> { final AnEntity anEntity = new AnEntity(); session.persist( anEntity ); return anEntity.id; } ); assertEquals( 1, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); sessionFactory().getStatistics().clear(); doInHibernate( this::sessionFactory, session -> { final AnEntity anEntity = session.find( AnEntity.class, id ); assertNotNull( anEntity ); assertNull( anEntity.otherEntity ); } ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 1, getEntity2LCStatistics( AnEntity.class ).getHitCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getHitCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getMissCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getMissCount() ); }
assertEquals( 1, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 1, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 0, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() );
assertEquals( 1, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 1, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 0, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() );
assertEquals( 1, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 1, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 0, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() );
assertEquals( 1, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 1, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() ); assertEquals( 0, getQueryStatistics( queryString ).getCachePutCount() ); assertEquals( 0, getEntity2LCStatistics( AnEntity.class ).getPutCount() ); assertEquals( 0, getEntity2LCStatistics( OtherEntity.class ).getPutCount() );
@Override protected void handle(SecondLevelCacheStatistics statistics, OperationContext context, String attributeName) { long count = statistics.getPutCount(); context.getResult().set(count); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.SecondLevelCacheStatistics statistics = getStatistics(getEntityManagerFactoryAccess(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getPutCount() : 0); } };
public CacheRegionStats(String region, SecondLevelCacheStatistics src) { this(region); this.hitCount = src.getHitCount(); this.missCount = src.getMissCount(); this.putCount = src.getPutCount(); this.hitRatio = determineHitRatio(); this.elementCountInMemory = src.getElementCountInMemory(); this.elementCountOnDisk = src.getElementCountOnDisk(); this.elementCountTotal = /* src.getElementCountInMemory() + */src.getElementCountOnDisk(); }
public CacheRegionStats(String region, SecondLevelCacheStatistics src) { this(region); this.hitCount = src.getHitCount(); this.missCount = src.getMissCount(); this.putCount = src.getPutCount(); this.hitRatio = determineHitRatio(); this.elementCountInMemory = src.getElementCountInMemory(); this.elementCountOnDisk = src.getElementCountOnDisk(); this.elementCountTotal = /* src.getElementCountInMemory() + */src.getElementCountOnDisk(); }
public CacheRegionStats(String region, SecondLevelCacheStatistics src) { this(region); this.hitCount = src.getHitCount(); this.missCount = src.getMissCount(); this.putCount = src.getPutCount(); this.hitRatio = determineHitRatio(); this.elementCountInMemory = src.getElementCountInMemory(); this.elementCountOnDisk = src.getElementCountOnDisk(); this.elementCountTotal = src.getElementCountInMemory() + src.getElementCountOnDisk(); }
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()); } }