use of org.alfresco.heartbeat.datasender.HBData in project alfresco-repository by Alfresco.
the class SessionsUsageDataCollectorTest method testSystemUsageDataIsCollected.
@Test
public void testSystemUsageDataIsCollected() {
HBData sessionsUsage = grabDataByCollectorId(sessionsUsageDataCollector.getCollectorId());
assertNotNull("Sessions usage data missing.", sessionsUsage);
Map<String, Object> data = sessionsUsage.getData();
assertTrue(data.containsKey("activeTickets"));
assertEquals("Wrong number of active tickets", TICKET_NON_EXPIRED, data.get("activeTickets"));
}
use of org.alfresco.heartbeat.datasender.HBData in project alfresco-repository by Alfresco.
the class AuthoritiesDataCollectorTest method testAuthDataIsCollected.
@Test
public void testAuthDataIsCollected() {
HBData authorityInfo = grabDataByCollectorId(authorityDataCollector.getCollectorId());
assertNotNull("Authority info data missing.", authorityInfo);
Map<String, Object> data = authorityInfo.getData();
assertTrue(data.containsKey("numUsers"));
assertTrue(data.containsKey("numGroups"));
}
use of org.alfresco.heartbeat.datasender.HBData in project alfresco-repository by Alfresco.
the class ModelUsageDataCollectorTest method testModelUsageDataIsCollected.
@Test
public void testModelUsageDataIsCollected() {
HBData modelUsage = grabDataByCollectorId(usageModelCollector.getCollectorId());
assertNotNull("Model usage data missing.", modelUsage);
Map<String, Object> data = modelUsage.getData();
assertTrue(data.containsKey("numOfActiveModels"));
assertTrue(data.containsKey("numOfActiveTypes"));
assertTrue(data.containsKey("numOfActiveAspects"));
}
use of org.alfresco.heartbeat.datasender.HBData in project alfresco-repository by Alfresco.
the class AuthoritiesDataCollector method collectData.
@Override
public List<HBData> collectData() {
this.logger.debug("Preparing repository usage (authorities) data...");
Map<String, Object> authoritiesUsageValues = new HashMap<>();
authoritiesUsageValues.put("numUsers", new Integer(this.authorityService.getAllAuthoritiesInZone(AuthorityService.ZONE_APP_DEFAULT, AuthorityType.USER).size()));
authoritiesUsageValues.put("numGroups", new Integer(this.authorityService.getAllAuthoritiesInZone(AuthorityService.ZONE_APP_DEFAULT, AuthorityType.GROUP).size()));
HBData authoritiesUsageData = new HBData(this.currentRepoDescriptorDAO.getDescriptor().getId(), this.getCollectorId(), this.getCollectorVersion(), new Date(), authoritiesUsageValues);
return Arrays.asList(authoritiesUsageData);
}
use of org.alfresco.heartbeat.datasender.HBData in project alfresco-remote-api by Alfresco.
the class RenditionsDataCollector method collectData.
@Override
public List<HBData> collectData() {
List<HBData> collectedData = new LinkedList<>();
String systemId = this.currentRepoDescriptorDAO.getDescriptor().getId();
String collectorId = this.getCollectorId();
String collectorVersion = this.getCollectorVersion();
Date timestamp = new Date();
// We don't mind if new renditions are added while we iterate, as we will pick them up next time.
for (ThumbnailDefinition rendition : renditionRequests.keySet()) {
String renditionName = rendition.getName();
String targetMimetype = rendition.getMimetype();
for (Map.Entry<String, AtomicInteger> entry : renditionRequests.remove(rendition).entrySet()) {
String sourceMimetype = entry.getKey();
AtomicInteger count = entry.getValue();
Map<String, Object> values = new HashMap<>();
values.put("rendition", renditionName);
values.put("count", count.intValue());
values.put("sourceMimetype", sourceMimetype);
values.put("targetMimetype", targetMimetype);
// Decided it would be simpler to be able to combine results in Kibana from different nodes
// and days if the data was flattened (denormalized) out at this point. It is very likely
// that different nodes would have different sets of sourceMimetypes which would make summing
// the counts harder to do, if there was a single entry for each rendition with a nested
// structure for each sourceMimetype.
collectedData.add(new HBData(systemId, collectorId, collectorVersion, timestamp, values));
if (logger.isDebugEnabled()) {
logger.debug(renditionName + " " + count + " " + sourceMimetype + " " + targetMimetype);
}
}
}
return collectedData;
}
Aggregations