org.hibernate.stat.Statistics.getQueryExecutionMaxTime()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.hibernate.stat.Statistics.getQueryExecutionMaxTime()方法的一些代码示例,展示了Statistics.getQueryExecutionMaxTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Statistics.getQueryExecutionMaxTime()方法的具体详情如下:
包路径:org.hibernate.stat.Statistics
类名称:Statistics
方法名:getQueryExecutionMaxTime

Statistics.getQueryExecutionMaxTime介绍

[英]Get the time in milliseconds of the slowest query.
[中]获取最慢查询的时间(以毫秒为单位)。

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics( getEntityManagerFactory( args ) );
    return Long.valueOf( statistics != null ? statistics.getQueryExecutionMaxTime() : 0 );
  }
};

代码示例来源:origin: gocd/gocd

json.put("EntityUpdateCount", statistics.getEntityUpdateCount());
json.put("QueryExecutionCount", statistics.getQueryExecutionCount());
json.put("QueryExecutionMaxTime", statistics.getQueryExecutionMaxTime());
json.put("QueryExecutionMaxTimeQueryString", statistics.getQueryExecutionMaxTimeQueryString());
json.put("QueryCacheHitCount", statistics.getQueryCacheHitCount());

代码示例来源:origin: wildfly/wildfly

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: riotfamily/riot

@Override
protected void populateStats(Statistics stats) throws Exception {
  org.hibernate.stat.Statistics hs = sessionFactory.getStatistics();
  stats.add("Start time", new Date(hs.getStartTime()));
  stats.add("Flush count", hs.getFlushCount());
  stats.add("Session open count", hs.getSessionOpenCount());
  stats.add("Session close count", hs.getSessionCloseCount(), 
        hs.getSessionCloseCount() < hs.getSessionOpenCount());
  
  stats.add("Transaction count", hs.getTransactionCount());
  stats.add("Successful transaction count", hs.getSuccessfulTransactionCount());
  stats.add("Optimistic failure count", hs.getOptimisticFailureCount());
  stats.add("Connect count", hs.getConnectCount());
  stats.add("Prepare statement count", hs.getPrepareStatementCount());
  stats.add("Close statement count", hs.getCloseStatementCount());
  
  stats.add("Query execution count", hs.getQueryExecutionCount());
  stats.addOkBelow("Query execution max time", hs.getQueryExecutionMaxTime(), 1000);
  stats.add("Slowest statement", hs.getQueryExecutionMaxTimeQueryString());
}

代码示例来源:origin: wildfly/wildfly

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: wildfly/wildfly

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: wildfly/wildfly

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: hibernate/hibernate-orm

assertEquals( "unexpected row count", results, continentStats.getExecutionRowCount() );
long maxTime = continentStats.getExecutionMaxTime();
assertEquals( maxTime, sf.getStatistics().getQueryExecutionMaxTime() );
assertEquals( "unexpected row count", results, localityStats.getExecutionRowCount() );
maxTime = localityStats.getExecutionMaxTime();
assertEquals( maxTime, sf.getStatistics().getQueryExecutionMaxTime() );
assertEquals( "unexpected row count", results, sqlStats.getExecutionRowCount() );
maxTime = sqlStats.getExecutionMaxTime();
assertEquals( maxTime, sf.getStatistics().getQueryExecutionMaxTime() );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public long getQueryExecutionMaxTime() {
  return stats.getQueryExecutionMaxTime();
}
public long getQueryCacheMissCount() {

代码示例来源:origin: hibernate/hibernate

public long getQueryExecutionMaxTime() {
  return stats.getQueryExecutionMaxTime();
}
public long getQueryCacheMissCount() {

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public long getQueryExecutionMaxTime() {
  return stats.getQueryExecutionMaxTime();
}
public long getQueryCacheMissCount() {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public long getQueryExecutionMaxTime() {
  return stats.getQueryExecutionMaxTime();
}
public long getQueryCacheMissCount() {

代码示例来源:origin: org.jboss.as/jboss-as-jpa-hibernate4

@Override
  void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) {
    response.set(stats.getStatistics().getQueryExecutionMaxTime());
  }
});

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate5

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate4-3

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-3

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate5-3

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-1

@Override
  public Object invoke(Object... args) {
    org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args));
    return Long.valueOf(statistics != null ? statistics.getQueryExecutionMaxTime() : 0);
  }
};

代码示例来源:origin: org.codehaus.sonar/sonar-commons

private void dumpStatistics() {
 if (logger.isDebugEnabled() && factory instanceof EntityManagerFactoryImpl) {
  HibernateEntityManagerFactory hibernateFactory = (HibernateEntityManagerFactory)factory;
  Statistics stats = hibernateFactory.getSessionFactory().getStatistics();
  for (String query : stats.getQueries()) {
   QueryStatistics stat = stats.getQueryStatistics(query);
   StringBuilder sb = new StringBuilder();
   sb.append(stats.getQueryExecutionMaxTime());
   sb.append("ms, count=");
   sb.append(stat.getExecutionCount());
   sb.append(", sql=");
   sb.append(stat.getCategoryName());
   logger.debug(sb.toString());
  }
  stats.clear();
 }
}

代码示例来源:origin: com.springsource.insight/insight-repo

public List<ApplicationStat> getStats() {
  Statistics stats = getStatistics();
  List<ApplicationStat> res = new ArrayList<ApplicationStat>();
  
  addCollectionStats(res, stats);
  addEntityStats(res, stats);
  addSecondLevelCacheStats(res, stats);
  
  addStat(res, "misc/connectCount", stats.getConnectCount());        
  addStat(res, "misc/flushes", stats.getFlushCount());
  addStat(res, "misc/optimisticFailures", stats.getOptimisticFailureCount());
  addStat(res, "misc/preparedStatements", stats.getPrepareStatementCount());
  addStat(res, "misc/queries", stats.getQueryExecutionCount());
  addStat(res, "misc/queryMaxTime", stats.getQueryExecutionMaxTime());
  addStat(res, "misc/closeStatements", stats.getCloseStatementCount());
  addCacheStat(res, "qCache/", stats.getQueryCacheHitCount(), stats.getQueryCacheMissCount(), stats.getQueryCachePutCount());
  addStat(res, "session/closes", stats.getSessionCloseCount());
  addStat(res, "session/opens", stats.getSessionOpenCount());
  addStat(res, "tx/successful", stats.getSuccessfulTransactionCount());
  addStat(res, "tx/total", stats.getTransactionCount());
  return res;
}

相关文章

Statistics类方法