use of org.olat.restapi.system.vo.HibernateStatisticsVO in project OpenOLAT by OpenOLAT.
the class DatabaseWebService method getDatabaseStatistics.
/**
* Return the statistics about database and hibernate
*
* @response.representation.200.qname {http://www.example.com}runtimeVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The version of the instance
* @response.representation.200.example {@link org.olat.restapi.system.vo.Examples#SAMPLE_DATABASEVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param request The HTTP request
* @return The informations about runtime, uptime, classes loaded, memory summary...
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getDatabaseStatistics() {
DatabaseConnectionVO connections = CoreSpringFactory.getImpl(DatabaseStatsManager.class).getConnectionInfos();
HibernateStatisticsVO hibernateStats = getHibernateStatistics();
DatabaseVO vo = new DatabaseVO();
vo.setConnectionInfos(connections);
vo.setHibernateStatistics(hibernateStats);
return Response.ok(vo).build();
}
use of org.olat.restapi.system.vo.HibernateStatisticsVO in project openolat by klemens.
the class DatabaseWebService method getHibernateStatistics.
private HibernateStatisticsVO getHibernateStatistics() {
Statistics statistics = DBFactory.getInstance().getStatistics();
if (!statistics.isStatisticsEnabled()) {
return null;
}
HibernateStatisticsVO stats = new HibernateStatisticsVO();
stats.setOpenSessionsCount(statistics.getSessionOpenCount());
stats.setTransactionsCount(statistics.getTransactionCount());
stats.setSuccessfulTransactionCount(statistics.getSuccessfulTransactionCount());
stats.setFailedTransactionsCount(statistics.getTransactionCount() - statistics.getSuccessfulTransactionCount());
stats.setOptimisticFailureCount(statistics.getOptimisticFailureCount());
stats.setQueryExecutionCount(statistics.getQueryExecutionCount());
stats.setQueryExecutionMaxTime(statistics.getQueryExecutionMaxTime());
stats.setQueryExecutionMaxTimeQueryString(statistics.getQueryExecutionMaxTimeQueryString());
return stats;
}
use of org.olat.restapi.system.vo.HibernateStatisticsVO in project openolat by klemens.
the class DatabaseWebService method getDatabaseStatistics.
/**
* Return the statistics about database and hibernate
*
* @response.representation.200.qname {http://www.example.com}runtimeVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The version of the instance
* @response.representation.200.example {@link org.olat.restapi.system.vo.Examples#SAMPLE_DATABASEVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param request The HTTP request
* @return The informations about runtime, uptime, classes loaded, memory summary...
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getDatabaseStatistics() {
DatabaseConnectionVO connections = CoreSpringFactory.getImpl(DatabaseStatsManager.class).getConnectionInfos();
HibernateStatisticsVO hibernateStats = getHibernateStatistics();
DatabaseVO vo = new DatabaseVO();
vo.setConnectionInfos(connections);
vo.setHibernateStatistics(hibernateStats);
return Response.ok(vo).build();
}
use of org.olat.restapi.system.vo.HibernateStatisticsVO in project OpenOLAT by OpenOLAT.
the class DatabaseWebService method getHibernateStatistics.
private HibernateStatisticsVO getHibernateStatistics() {
Statistics statistics = DBFactory.getInstance().getStatistics();
if (!statistics.isStatisticsEnabled()) {
return null;
}
HibernateStatisticsVO stats = new HibernateStatisticsVO();
stats.setOpenSessionsCount(statistics.getSessionOpenCount());
stats.setTransactionsCount(statistics.getTransactionCount());
stats.setSuccessfulTransactionCount(statistics.getSuccessfulTransactionCount());
stats.setFailedTransactionsCount(statistics.getTransactionCount() - statistics.getSuccessfulTransactionCount());
stats.setOptimisticFailureCount(statistics.getOptimisticFailureCount());
stats.setQueryExecutionCount(statistics.getQueryExecutionCount());
stats.setQueryExecutionMaxTime(statistics.getQueryExecutionMaxTime());
stats.setQueryExecutionMaxTimeQueryString(statistics.getQueryExecutionMaxTimeQueryString());
return stats;
}
Aggregations