Search in sources :

Example 1 with DatabaseConnectionVO

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();
}
Also used : DatabaseStatsManager(org.olat.admin.sysinfo.manager.DatabaseStatsManager) DatabaseVO(org.olat.restapi.system.vo.DatabaseVO) HibernateStatisticsVO(org.olat.restapi.system.vo.HibernateStatisticsVO) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with DatabaseConnectionVO

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);
}
Also used : Statistics(org.hibernate.stat.Statistics) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO)

Example 3 with DatabaseConnectionVO

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);
}
Also used : Statistics(org.hibernate.stat.Statistics) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO)

Example 4 with DatabaseConnectionVO

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();
}
Also used : DatabaseStatsManager(org.olat.admin.sysinfo.manager.DatabaseStatsManager) DatabaseVO(org.olat.restapi.system.vo.DatabaseVO) HibernateStatisticsVO(org.olat.restapi.system.vo.HibernateStatisticsVO) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 5 with DatabaseConnectionVO

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;
}
Also used : SessionsVO(org.olat.restapi.system.vo.SessionsVO) FullIndexerStatus(org.olat.search.service.indexer.FullIndexerStatus) SearchServiceStatusImpl(org.olat.search.service.SearchServiceStatusImpl) SearchServiceStatus(org.olat.search.SearchServiceStatus) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO)

Aggregations

DatabaseConnectionVO (org.olat.admin.sysinfo.model.DatabaseConnectionVO)8 MBeanServer (javax.management.MBeanServer)2 GET (javax.ws.rs.GET)2 Produces (javax.ws.rs.Produces)2 Statistics (org.hibernate.stat.Statistics)2 DatabaseStatsManager (org.olat.admin.sysinfo.manager.DatabaseStatsManager)2 JMXManager (org.olat.core.commons.services.jmx.JMXManager)2 DatabaseVO (org.olat.restapi.system.vo.DatabaseVO)2 HibernateStatisticsVO (org.olat.restapi.system.vo.HibernateStatisticsVO)2 SessionsVO (org.olat.restapi.system.vo.SessionsVO)2 SearchServiceStatus (org.olat.search.SearchServiceStatus)2 SearchServiceStatusImpl (org.olat.search.service.SearchServiceStatusImpl)2 FullIndexerStatus (org.olat.search.service.indexer.FullIndexerStatus)2