revised heuristic counting VRE accesses from page paths
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-dashboard-harvester-se-plugin@169200 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8335d11956
commit
adab0bea74
|
@ -92,21 +92,26 @@ public class VREAccessesHarvester extends BasicHarvester {
|
|||
int measure = 0;
|
||||
|
||||
ScopeBean scopeBean = new ScopeBean(context);
|
||||
|
||||
String[] splitContext = context.split("/");
|
||||
if (splitContext.length > 3) {
|
||||
String lowerCasedContext = splitContext[3].toLowerCase();
|
||||
for (VREAccessesReportRow row : vreAccesses) {
|
||||
|
||||
String pagePath = row.getPagePath();
|
||||
String[] splits = pagePath.split("/");
|
||||
if (splits.length > 2 && splits[2].startsWith(lowerCasedContext))
|
||||
String lowerCasedContext = scopeBean.name().toLowerCase();
|
||||
String case1=lowerCasedContext+"/";
|
||||
String case2=lowerCasedContext+"?";
|
||||
for (VREAccessesReportRow row : vreAccesses) {
|
||||
String pagePath = row.getPagePath();
|
||||
if (!pagePath.contains("_redirect=/group")) {
|
||||
if (pagePath.endsWith(lowerCasedContext)) {
|
||||
System.out.println("match end->"+pagePath);
|
||||
measure++;
|
||||
}
|
||||
else if (pagePath.contains(case1) || pagePath.contains(case2) ) {
|
||||
System.out.println("match compare->"+pagePath);
|
||||
measure++;
|
||||
}
|
||||
}
|
||||
HarvestedData harvest = new HarvestedData(HarvestedDataKey.ACCESSES, context, measure);
|
||||
logger.debug(harvest.toString());
|
||||
data.add(harvest);
|
||||
}
|
||||
}
|
||||
|
||||
HarvestedData harvest = new HarvestedData(HarvestedDataKey.ACCESSES, context, measure);
|
||||
logger.debug(harvest.toString());
|
||||
data.add(harvest);
|
||||
return data;
|
||||
} catch(Exception e) {
|
||||
throw e;
|
||||
|
|
Loading…
Reference in New Issue