Search in sources :

Example 1 with IndexerStatisticsVO

use of org.olat.restapi.system.vo.IndexerStatisticsVO in project OpenOLAT by OpenOLAT.

the class SystemTest method testSystemIndexerStatistics.

@Test
public void testSystemIndexerStatistics() throws IOException, URISyntaxException {
    RestConnection conn = new RestConnection();
    assertTrue(conn.login("administrator", "openolat"));
    URI systemUri = conn.getContextURI().path("system").path("monitoring").path("openolat").path("indexer").build();
    IndexerStatisticsVO indexerStats = conn.get(systemUri, IndexerStatisticsVO.class);
    assertNotNull(indexerStats);
    assertNotNull(indexerStats.getStatus());
    assertNotNull(indexerStats.getFullIndexStartedAt());
    assertNotNull(indexerStats.getLastFullIndexTime());
    assertTrue(indexerStats.getIndexedDocumentCount() >= 0);
    assertTrue(indexerStats.getExcludedDocumentCount() >= 0);
    assertTrue(indexerStats.getAvailableFolderIndexerCount() >= 0);
    assertTrue(indexerStats.getRunningFolderIndexerCount() >= 0);
    assertTrue(indexerStats.getIndexingTime() >= 0);
    assertTrue(indexerStats.getIndexSize() >= 0);
    conn.shutdown();
}
Also used : IndexerStatisticsVO(org.olat.restapi.system.vo.IndexerStatisticsVO) URI(java.net.URI) Test(org.junit.Test)

Example 2 with IndexerStatisticsVO

use of org.olat.restapi.system.vo.IndexerStatisticsVO in project openolat by klemens.

the class SystemTest method testSystemIndexerStatistics.

@Test
public void testSystemIndexerStatistics() throws IOException, URISyntaxException {
    RestConnection conn = new RestConnection();
    assertTrue(conn.login("administrator", "openolat"));
    URI systemUri = conn.getContextURI().path("system").path("monitoring").path("openolat").path("indexer").build();
    IndexerStatisticsVO indexerStats = conn.get(systemUri, IndexerStatisticsVO.class);
    assertNotNull(indexerStats);
    assertNotNull(indexerStats.getStatus());
    assertNotNull(indexerStats.getFullIndexStartedAt());
    assertNotNull(indexerStats.getLastFullIndexTime());
    assertTrue(indexerStats.getIndexedDocumentCount() >= 0);
    assertTrue(indexerStats.getExcludedDocumentCount() >= 0);
    assertTrue(indexerStats.getAvailableFolderIndexerCount() >= 0);
    assertTrue(indexerStats.getRunningFolderIndexerCount() >= 0);
    assertTrue(indexerStats.getIndexingTime() >= 0);
    assertTrue(indexerStats.getIndexSize() >= 0);
    conn.shutdown();
}
Also used : IndexerStatisticsVO(org.olat.restapi.system.vo.IndexerStatisticsVO) URI(java.net.URI) Test(org.junit.Test)

Example 3 with IndexerStatisticsVO

use of org.olat.restapi.system.vo.IndexerStatisticsVO in project openolat by klemens.

the class IndexerWebService method getIndexerStatistics.

protected IndexerStatisticsVO getIndexerStatistics() {
    IndexerStatisticsVO stats = new IndexerStatisticsVO();
    SearchServiceStatus status = SearchServiceFactory.getService().getStatus();
    if (status instanceof SearchServiceStatusImpl) {
        SearchServiceStatusImpl statusImpl = (SearchServiceStatusImpl) status;
        FullIndexerStatus fStatus = statusImpl.getFullIndexerStatus();
        stats.setIndexedDocumentCount(fStatus.getDocumentCount());
        stats.setExcludedDocumentCount(fStatus.getExcludedDocumentCount());
        stats.setIndexSize(fStatus.getIndexSize());
        stats.setIndexingTime(fStatus.getIndexingTime());
        stats.setFullIndexStartedAt(fStatus.getFullIndexStartedAt());
        stats.setDocumentQueueSize(fStatus.getDocumentQueueSize());
        stats.setRunningFolderIndexerCount(fStatus.getNumberRunningFolderIndexer());
        stats.setAvailableFolderIndexerCount(fStatus.getNumberAvailableFolderIndexer());
        stats.setLastFullIndexTime(fStatus.getLastFullIndexDateString());
        stats.setStatus(status.getStatus());
    } else {
        stats.setStatus("disabled");
    }
    return stats;
}
Also used : IndexerStatisticsVO(org.olat.restapi.system.vo.IndexerStatisticsVO) FullIndexerStatus(org.olat.search.service.indexer.FullIndexerStatus) SearchServiceStatusImpl(org.olat.search.service.SearchServiceStatusImpl) SearchServiceStatus(org.olat.search.SearchServiceStatus)

Example 4 with IndexerStatisticsVO

use of org.olat.restapi.system.vo.IndexerStatisticsVO in project OpenOLAT by OpenOLAT.

the class IndexerWebService method getIndexerStatistics.

protected IndexerStatisticsVO getIndexerStatistics() {
    IndexerStatisticsVO stats = new IndexerStatisticsVO();
    SearchServiceStatus status = SearchServiceFactory.getService().getStatus();
    if (status instanceof SearchServiceStatusImpl) {
        SearchServiceStatusImpl statusImpl = (SearchServiceStatusImpl) status;
        FullIndexerStatus fStatus = statusImpl.getFullIndexerStatus();
        stats.setIndexedDocumentCount(fStatus.getDocumentCount());
        stats.setExcludedDocumentCount(fStatus.getExcludedDocumentCount());
        stats.setIndexSize(fStatus.getIndexSize());
        stats.setIndexingTime(fStatus.getIndexingTime());
        stats.setFullIndexStartedAt(fStatus.getFullIndexStartedAt());
        stats.setDocumentQueueSize(fStatus.getDocumentQueueSize());
        stats.setRunningFolderIndexerCount(fStatus.getNumberRunningFolderIndexer());
        stats.setAvailableFolderIndexerCount(fStatus.getNumberAvailableFolderIndexer());
        stats.setLastFullIndexTime(fStatus.getLastFullIndexDateString());
        stats.setStatus(status.getStatus());
    } else {
        stats.setStatus("disabled");
    }
    return stats;
}
Also used : IndexerStatisticsVO(org.olat.restapi.system.vo.IndexerStatisticsVO) FullIndexerStatus(org.olat.search.service.indexer.FullIndexerStatus) SearchServiceStatusImpl(org.olat.search.service.SearchServiceStatusImpl) SearchServiceStatus(org.olat.search.SearchServiceStatus)

Aggregations

IndexerStatisticsVO (org.olat.restapi.system.vo.IndexerStatisticsVO)4 URI (java.net.URI)2 Test (org.junit.Test)2 SearchServiceStatus (org.olat.search.SearchServiceStatus)2 SearchServiceStatusImpl (org.olat.search.service.SearchServiceStatusImpl)2 FullIndexerStatus (org.olat.search.service.indexer.FullIndexerStatus)2