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;
|
int measure = 0;
|
||||||
|
|
||||||
ScopeBean scopeBean = new ScopeBean(context);
|
ScopeBean scopeBean = new ScopeBean(context);
|
||||||
|
String lowerCasedContext = scopeBean.name().toLowerCase();
|
||||||
String[] splitContext = context.split("/");
|
String case1=lowerCasedContext+"/";
|
||||||
if (splitContext.length > 3) {
|
String case2=lowerCasedContext+"?";
|
||||||
String lowerCasedContext = splitContext[3].toLowerCase();
|
|
||||||
for (VREAccessesReportRow row : vreAccesses) {
|
for (VREAccessesReportRow row : vreAccesses) {
|
||||||
|
|
||||||
String pagePath = row.getPagePath();
|
String pagePath = row.getPagePath();
|
||||||
String[] splits = pagePath.split("/");
|
if (!pagePath.contains("_redirect=/group")) {
|
||||||
if (splits.length > 2 && splits[2].startsWith(lowerCasedContext))
|
if (pagePath.endsWith(lowerCasedContext)) {
|
||||||
|
System.out.println("match end->"+pagePath);
|
||||||
measure++;
|
measure++;
|
||||||
}
|
}
|
||||||
|
else if (pagePath.contains(case1) || pagePath.contains(case2) ) {
|
||||||
|
System.out.println("match compare->"+pagePath);
|
||||||
|
measure++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HarvestedData harvest = new HarvestedData(HarvestedDataKey.ACCESSES, context, measure);
|
HarvestedData harvest = new HarvestedData(HarvestedDataKey.ACCESSES, context, measure);
|
||||||
logger.debug(harvest.toString());
|
logger.debug(harvest.toString());
|
||||||
data.add(harvest);
|
data.add(harvest);
|
||||||
}
|
|
||||||
return data;
|
return data;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue