use of org.olat.admin.sysinfo.model.DatabaseConnectionVO 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.admin.sysinfo.model.DatabaseConnectionVO in project openolat by klemens.
the class HibernateStatisticsController method loadModel.
protected void loadModel() {
Statistics statistics = dbInstance.getStatistics();
mainVC.contextPut("isStatisticsEnabled", statistics.isStatisticsEnabled());
mainVC.contextPut("hibernateStatistics", statistics);
DatabaseConnectionVO connectionInfos = databaseStatsManager.getConnectionInfos();
mainVC.contextPut("connectionInfos", connectionInfos);
}
use of org.olat.admin.sysinfo.model.DatabaseConnectionVO in project OpenOLAT by OpenOLAT.
the class HibernateStatisticsController method loadModel.
protected void loadModel() {
Statistics statistics = dbInstance.getStatistics();
mainVC.contextPut("isStatisticsEnabled", statistics.isStatisticsEnabled());
mainVC.contextPut("hibernateStatistics", statistics);
DatabaseConnectionVO connectionInfos = databaseStatsManager.getConnectionInfos();
mainVC.contextPut("connectionInfos", connectionInfos);
}
use of org.olat.admin.sysinfo.model.DatabaseConnectionVO 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.admin.sysinfo.model.DatabaseConnectionVO in project OpenOLAT by OpenOLAT.
the class MonitoringService method getStatistics.
public Statistics getStatistics() {
Statistics statistics = new Statistics();
SessionsVO sessionsVo = new OpenOLATStatisticsWebService().getSessionsVO();
statistics.setSessionsVo(sessionsVo);
SearchServiceStatus status = SearchServiceFactory.getService().getStatus();
if (status instanceof SearchServiceStatusImpl) {
SearchServiceStatusImpl statusImpl = (SearchServiceStatusImpl) status;
FullIndexerStatus fStatus = statusImpl.getFullIndexerStatus();
statistics.setLastFullIndexTime(fStatus.getLastFullIndexDateString());
}
// activeUserCount="88" // registered and activated identities, same as in GUI
if (start < 1 || (System.currentTimeMillis() - start) > RENEW_RATE) {
start = System.currentTimeMillis();
activeUserCount = securityManager.countIdentitiesByPowerSearch(null, null, false, null, null, null, null, null, null, null, Constants.USERSTATUS_ACTIVE);
totalGroupCount = businessGroupService.countBusinessGroups(null, null);
publishedCourses = repositoryManager.countPublished(CourseModule.ORES_TYPE_COURSE);
}
statistics.setActiveUserCount(activeUserCount);
statistics.setTotalGroupCount(totalGroupCount);
statistics.setPublishedCourses(publishedCourses);
DatabaseConnectionVO connections = databaseStatsManager.getConnectionInfos();
if (connections != null) {
statistics.setActiveConnectionCount(connections.getActiveConnectionCount());
statistics.setCurrentConnectionCount(connections.getCurrentConnectionCount());
}
return statistics;
}
Aggregations