@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics( getEntityManagerFactory( args ) ); return String.valueOf( statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
json.put("QueryExecutionCount", statistics.getQueryExecutionCount()); json.put("QueryExecutionMaxTime", statistics.getQueryExecutionMaxTime()); json.put("QueryExecutionMaxTimeQueryString", statistics.getQueryExecutionMaxTimeQueryString()); json.put("QueryCacheHitCount", statistics.getQueryCacheHitCount()); json.put("QueryCacheMissCount", statistics.getQueryCacheMissCount());
public String getQueryExecutionMaxTimeQueryString() { return stats.getQueryExecutionMaxTimeQueryString(); } }
public String getQueryExecutionMaxTimeQueryString() { return stats.getQueryExecutionMaxTimeQueryString(); } }
public String getQueryExecutionMaxTimeQueryString() { return stats.getQueryExecutionMaxTimeQueryString(); } }
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) { String sql = stats.getStatistics().getQueryExecutionMaxTimeQueryString(); if (sql != null) { response.set(sql); } else { context.getResult(); // result will be undefined } } });
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.Statistics statistics = getStatistics(getEntityManagerFactory(args)); return String.valueOf(statistics != null ? statistics.getQueryExecutionMaxTimeQueryString() : 0); } };
public StatisticData[] retrieveStatisticData() { final List<StatisticData> resultList = new ArrayList<StatisticData>(); for (Map.Entry<String, Statistics> entry : statistics.entrySet()) { final String element = entry.getKey(); final Statistics stats = entry.getValue(); resultList.add(new StatisticData(NAME_CACHE_HIT, element, stats.getQueryCacheHitCount())); resultList.add(new StatisticData(NAME_CACHE_MISS, element, stats.getQueryCacheMissCount())); resultList.add(new StatisticData(NAME_CACHE_PUT, element, stats.getQueryCachePutCount())); resultList.add(new StatisticData(NAME_EXECUTION_COUNT, element, stats.getQueryExecutionCount())); resultList.add(new StatisticData(NAME_EXECUTION_MAX_TIME, element, stats.getQueryExecutionMaxTime())); resultList.add(new StatisticData(NAME_EXECUTION_MAX_TIME_QUERY, element, stats.getQueryExecutionMaxTimeQueryString())); } if (0 == resultList.size()) { return StatisticData.EMPTY_ARRAY; } final StatisticData[] result = new StatisticData[resultList.size()]; resultList.toArray(result); return result; } }
logger.info(stats.getQueryExecutionMaxTimeQueryString()); logger.info("hit count"+stats.getSecondLevelCacheHitCount()); stats.logSummary();
@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()); }
return stats.getQueryExecutionMaxTimeQueryString();