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();
}
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();
}
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;
}
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;
}
Aggregations