本文整理了Java中org.hibernate.stat.Statistics.getQueryPlanCacheMissCount()
方法的一些代码示例,展示了Statistics.getQueryPlanCacheMissCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Statistics.getQueryPlanCacheMissCount()
方法的具体详情如下:
包路径:org.hibernate.stat.Statistics
类名称:Statistics
方法名:getQueryPlanCacheMissCount
[英]Get the global number of query plans lookups not found in cache
[中]获取在缓存中找到的查询计划查找未的全局数
代码示例来源:origin: hibernate/hibernate-orm
assertEquals( 0, statistics.getQueryPlanCacheMissCount() );
assertEquals( 1, statistics.getQueryPlanCacheMissCount() );
assertEquals( 1, statistics.getQueryPlanCacheMissCount() );
assertEquals( 1, statistics.getQueryPlanCacheMissCount() );
assertEquals( 2, statistics.getQueryPlanCacheMissCount() );
assertEquals( 2, statistics.getQueryPlanCacheMissCount() );
assertEquals( 2, statistics.getQueryPlanCacheMissCount() );
代码示例来源:origin: vladmihalcea/high-performance-java-persistence
@Test
public void testInQueryCachePlan() {
SessionFactory sessionFactory = entityManagerFactory().unwrap(SessionFactory.class);
Statistics statistics = sessionFactory.getStatistics();
statistics.clear();
doInJPA(entityManager -> {
for (int i = 2; i < 16; i++) {
getPostByIds(
entityManager,
IntStream.range(1, i).boxed().toArray(Integer[]::new)
);
}
assertEquals(6L, statistics.getQueryPlanCacheMissCount());
for (String query : statistics.getQueries()) {
LOGGER.info("Executed query: {}", query);
}
});
}
代码示例来源:origin: vladmihalcea/high-performance-java-persistence
@Test
public void testInQueryCachePlan() {
SessionFactory sessionFactory = entityManagerFactory().unwrap(SessionFactory.class);
Statistics statistics = sessionFactory.getStatistics();
statistics.clear();
doInJPA(entityManager -> {
for (int i = 1; i < 16; i++) {
getPostByIds(
entityManager,
IntStream.range(1, i + 1).boxed().toArray(Integer[]::new)
);
}
});
assertEquals(16L, statistics.getQueryPlanCacheMissCount());
for (String query : statistics.getQueries()) {
LOGGER.info("Executed query: {}", query);
}
}
内容来源于网络,如有侵权,请联系作者删除!