feature completed

pull/2/head
Massimiliano Assante 4 years ago
parent baab4ba432
commit b041f78e1f

@ -106,7 +106,7 @@ public class CoreServicesAccessesHarvester extends BasicHarvester {
int messagesAccesses = 0;
int notificationsAccesses = 0;
int profileAccesses = 0;
logger.debug("CoreServices accesses for {} ", dashboardContext);
logger.debug("{};", dashboardContext);
for(CoreServiceAccessesReportRow row : coreServicesAccesses.get(dashboardContext)) {
// String pagePath = row.getPagePath();
switch (row.getKey()) {
@ -135,13 +135,13 @@ public class CoreServicesAccessesHarvester extends BasicHarvester {
AccountingRecord ar2 = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.MESSAGES_ACCESSES), (long) messagesAccesses);
AccountingRecord ar3 = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.NOTIFICATIONS_ACCESSES), (long) notificationsAccesses);
AccountingRecord ar4 = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.PROFILE_ACCESSES), (long) profileAccesses);
logger.debug("{} : {}", ar1.getDimension().getId(), ar1.getMeasure());
logger.debug("{};{}", ar1.getDimension().getId(), ar1.getMeasure());
accountingRecords.add(ar1);
logger.debug("{} : {}", ar2.getDimension().getId(), ar2.getMeasure());
logger.debug("{};{}", ar2.getDimension().getId(), ar2.getMeasure());
accountingRecords.add(ar2);
logger.debug("{} : {}", ar3.getDimension().getId(), ar3.getMeasure());
logger.debug("{};{}", ar3.getDimension().getId(), ar3.getMeasure());
accountingRecords.add(ar3);
logger.debug("{} : {}", ar4.getDimension().getId(), ar4.getMeasure());
logger.debug("{};{}", ar4.getDimension().getId(), ar4.getMeasure());
accountingRecords.add(ar4);
}
@ -171,16 +171,18 @@ public class CoreServicesAccessesHarvester extends BasicHarvester {
HashMap<String,List<GetReportsResponse>> responses = getReportResponses(service, credentialsFromD4S.getViewIds(), dateRange);
HashMap<String, List<CoreServiceAccessesReportRow>> toReturn = new HashMap<>();
int i = 1;
for(String view : responses.keySet()) {
String dashboardContext = getAccountingDashboardContextGivenGAViewID(view);
if (dashboardContext != null ) {
logger.trace("Parsing responses for this Gateway view, which corresponds to Dashboard Context: " + dashboardContext);
logger.trace("\n ({}) *** Parsing responses for this Gateway view, which corresponds to Dashboard Context: {} \n", i, dashboardContext );
List<CoreServiceAccessesReportRow> viewReport = parseResponse(view, responses.get(view), dashboardContext);
logger.trace("Got {} entries from view id={}", viewReport.size(), view);
toReturn.put(dashboardContext, viewReport);
} else {
logger.warn("Got entries from view id={} but cannot find Dashboard Context correspondance, I think you need to update the Generic Resource of the Mappings", view);
}
i++;
}
return toReturn;
}
@ -274,22 +276,22 @@ public class CoreServicesAccessesHarvester extends BasicHarvester {
if (!pagePath.contains("_redirect=/group")) {
if ( pagePath.contains(PAGE_WORKSPACE_ACCESSES)) {
var.setKey(HarvestedDataKey.WORKSPACE_ACCESSES);
System.out.println("\n **matched "+pagePath);
logger.trace("**matched "+pagePath);
validEntry = true;
}
else if ( pagePath.contains(PAGE_MESSAGES_ACCESSES)) {
var.setKey(HarvestedDataKey.MESSAGES_ACCESSES);
System.out.println("\n **matched "+pagePath);
logger.trace("**matched "+pagePath);
validEntry = true;
}
else if ( pagePath.contains(PAGE_PROFILE_ACCESSES)) {
var.setKey(HarvestedDataKey.PROFILE_ACCESSES);
System.out.println("\n **matched "+pagePath);
logger.trace("**matched "+pagePath);
validEntry = true;
}
else if ( pagePath.contains(PAGE_NOTIFICATION_ACCESSES)) {
var.setKey(HarvestedDataKey.NOTIFICATIONS_ACCESSES);
System.out.println("\n **matched "+pagePath);
logger.trace("**matched "+pagePath);
validEntry = true;
}
}

@ -741,8 +741,8 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
//AccountingDao dao = getAccountingDao();
Date start = DateUtils.getStartCalendar(2020, Calendar.JANUARY, 1).getTime();
Date end = DateUtils.getStartCalendar(2020, Calendar.FEBRUARY, 1).getTime();
Date start = DateUtils.getStartCalendar(2020, Calendar.APRIL, 1).getTime();
Date end = DateUtils.getStartCalendar(2020, Calendar.MAY, 1).getTime();
/*
* Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();

Loading…
Cancel
Save