Fixed visit and visitor new definition.
This commit is contained in:
parent
f6d433de00
commit
f1361c9d25
12 changed files with 133 additions and 102 deletions
|
@ -507,7 +507,7 @@ public class Service extends PathPropertyList
|
|||
{
|
||||
long result;
|
||||
|
||||
MonthValues values = getMetricMonthValues("metrics.http.visits.humans");
|
||||
MonthValues values = getMetricMonthValues("metrics.http.visits");
|
||||
|
||||
values = values.extract(YearMonth.now().minusMonths(1), YearMonth.now().minusMonths(1));
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ public class FederationMetricSummaryPage
|
|||
data.setContent("metricMenuView", FederationMetricMenuView.htmlize(federation, TypeMenu.SUMMARY, view, period));
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.hits.humans", federation, view, period, "metrics.http.hits.humans", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors.humans", federation, view, period, "metrics.http.visitors.humans", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits.humans", federation, view, period, "metrics.http.visits.humans", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors", federation, view, period, "metrics.http.visitors", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits", federation, view, period, "metrics.http.visits", ChartColor.GREEN);
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml", data).toString();
|
||||
|
|
|
@ -98,25 +98,25 @@ public class FederationMetricWebPage
|
|||
FederationMetricHtmlizer.htmlize(data, "http.ip.ipv4", federation, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.ip.ipv6", federation, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters", federation, view, period, "metrics.http.requesters", ChartColor.BLUE);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters-humansbots", federation, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN,
|
||||
"metrics.http.requesters.bots", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters.humans", federation, view, period, "metrics.http.requesters.humans", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters.bots", federation, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters-ipv4ipv6", federation, view, period, "http.requesters (ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW,
|
||||
"metrics.http.requesters.ipv6", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters.ipv4", federation, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.requesters.ipv6", federation, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits", federation, view, period, "metrics.http.visits", ChartColor.BLUE);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors", federation, view, period, "metrics.http.visitors", ChartColor.BLUE);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors-humansbots", federation, view, period, "http.visitors (humans + bots)", "metrics.http.visitors.humans", ChartColor.GREEN,
|
||||
"metrics.http.visitors.bots", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors.humans", federation, view, period, "metrics.http.visitors.humans", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors.bots", federation, view, period, "metrics.http.visitors.bots", ChartColor.YELLOW);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors-ipv4ipv6", federation, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW,
|
||||
"metrics.http.visitors.ipv6", ChartColor.GREEN);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors.ipv4", federation, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visitors.ipv6", federation, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits", federation, view, period, "metrics.http.visits", ChartColor.BLUE);
|
||||
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits-humansbots", federation, view, period, "http.visits (humans + bots)", "metrics.http.visits.humans", ChartColor.GREEN,
|
||||
"metrics.http.visits.bots", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits.bots", federation, view, period, "metrics.http.visits.bots", ChartColor.YELLOW);
|
||||
FederationMetricHtmlizer.htmlize(data, "http.visits.humans", federation, view, period, "metrics.http.visits.humans", ChartColor.GREEN);
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricWebView.xhtml", data).toString();
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ public class OrganizationMetricSummaryPage
|
|||
data.setContent("metricMenuView", OrganizationMetricMenuView.htmlize(organization, TypeMenu.SUMMARY, view, period));
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.hits.humans", organization, view, period, "metrics.http.hits.humans", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors.humans", organization, view, period, "metrics.http.visitors.humans", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits.humans", organization, view, period, "metrics.http.visits.humans", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors", organization, view, period, "metrics.http.visitors", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits", organization, view, period, "metrics.http.visits", ChartColor.GREEN);
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml", data).toString();
|
||||
|
|
|
@ -107,25 +107,25 @@ public class OrganizationMetricWebPage
|
|||
OrganizationMetricHtmlizer.htmlize(data, "http.ip.ipv4", organization, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.ip.ipv6", organization, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters", organization, view, period, "metrics.http.requesters", ChartColor.BLUE);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters-humansbots", organization, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN,
|
||||
"metrics.http.requesters.bots", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters.humans", organization, view, period, "metrics.http.requesters.humans", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters.bots", organization, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters-ipv4ipv6", organization, view, period, "http.requesters(ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW,
|
||||
"metrics.http.requesters.ipv6", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters.ipv4", organization, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.requesters.ipv6", organization, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits", organization, view, period, "metrics.http.visits", ChartColor.BLUE);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors", organization, view, period, "metrics.http.visitors", ChartColor.BLUE);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors-humansbots", organization, view, period, "http.visitors (humans + bots)", "metrics.http.visitors.humans", ChartColor.GREEN,
|
||||
"metrics.http.visitors.bots", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors.humans", organization, view, period, "metrics.http.visitors.humans", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors.bots", organization, view, period, "metrics.http.visitors.bots", ChartColor.YELLOW);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors-ipv4ipv6", organization, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW,
|
||||
"metrics.http.visitors.ipv6", ChartColor.GREEN);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors.ipv4", organization, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visitors.ipv6", organization, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits", organization, view, period, "metrics.http.visits", ChartColor.BLUE);
|
||||
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits-humansbots", organization, view, period, "http.visits (humans + bots)", "metrics.http.visits.humans", ChartColor.GREEN,
|
||||
"metrics.http.visits.bots", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits.bots", organization, view, period, "metrics.http.visits.bots", ChartColor.YELLOW);
|
||||
OrganizationMetricHtmlizer.htmlize(data, "http.visits.humans", organization, view, period, "metrics.http.visits.humans", ChartColor.GREEN);
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricWebView.xhtml", data).toString();
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ public class ServiceMetricSummaryPage
|
|||
data.setContent("metricMenuView", ServiceMetricMenuView.htmlize(service, TypeMenu.SUMMARY, view, period));
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.hits.humans", service, view, period, "metrics.http.hits.humans", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors.humans", service, view, period, "metrics.http.visitors.humans", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits.humans", service, view, period, "metrics.http.visits.humans", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors", service, view, period, "metrics.http.visitors", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits", service, view, period, "metrics.http.visits", ChartColor.GREEN);
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml", data).toString();
|
||||
|
|
|
@ -106,25 +106,25 @@ public class ServiceMetricWebPage
|
|||
ServiceMetricHtmlizer.htmlize(data, "http.ip.ipv4", service, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.ip.ipv6", service, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN);
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors", service, view, period, "metrics.http.ip", ChartColor.BLUE);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters", service, view, period, "metrics.http.requesters", ChartColor.BLUE);
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors-humansbots", service, view, period, "http.visitors (humans + bots)", "metrics.http.visitors.humans", ChartColor.GREEN,
|
||||
"metrics.http.visitors.bots", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors.humans", service, view, period, "metrics.http.visitors.humans", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors.bots", service, view, period, "metrics.http.visitors.bots", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters-humansbots", service, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN,
|
||||
"metrics.http.requesters.bots", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters.humans", service, view, period, "metrics.http.requesters.humans", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters.bots", service, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW);
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters-ipv4ipv6", service, view, period, "http.requesters (ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW,
|
||||
"metrics.http.requesters.ipv6", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters.ipv4", service, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.requesters.ipv6", service, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN);
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits", service, view, period, "metrics.http.visits", ChartColor.BLUE);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors", service, view, period, "metrics.http.visitors", ChartColor.BLUE);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors-ipv4ipv6", service, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW,
|
||||
"metrics.http.visitors.ipv6", ChartColor.GREEN);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors.ipv4", service, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visitors.ipv6", service, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN);
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits", service, view, period, "metrics.http.visits", ChartColor.BLUE);
|
||||
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits-humansbots", service, view, period, "http.visits (humans + bots)", "metrics.http.visits.humans", ChartColor.GREEN,
|
||||
"metrics.http.visits.bots", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits.bots", service, view, period, "metrics.http.visits.bots", ChartColor.YELLOW);
|
||||
ServiceMetricHtmlizer.htmlize(data, "http.visits.humans", service, view, period, "metrics.http.visits.humans", ChartColor.GREEN);
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricWebView.xhtml", data).toString();
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<div id="metricMenuView" />
|
||||
<div id="charts" style="display: block;">
|
||||
<div id="http.hits.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visitors.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visits.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visitors" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visits" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -50,23 +50,26 @@
|
|||
<div id="http.ip.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.ip.bots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
|
||||
<h2>http.visitors</h2>
|
||||
<div id="http.visitors" style="width: 450px; height: 300px; border: 1px solid #e7e7e7;"/>
|
||||
<h2>http.requesters</h2>
|
||||
<div id="http.requesters" style="width: 450px; height: 300px; border: 1px solid #e7e7e7;"/>
|
||||
|
||||
<div id="http.requesters-ipv4ipv6" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.requesters.ipv4" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.requesters.ipv6" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<br/>
|
||||
<div id="http.requesters-humansbots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.requesters.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.requesters.bots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
|
||||
<h2>Visites</h2>
|
||||
<div id="http.visitors" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visits" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<br/>
|
||||
<div id="http.visitors-ipv4ipv6" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visitors.ipv4" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visitors.ipv6" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<br/>
|
||||
<div id="http.visitors-humansbots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visitors.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visitors.bots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
|
||||
<h2>http.visits</h2>
|
||||
<div id="http.visits" style="width: 450px; height: 300px; border: 1px solid #e7e7e7;"/>
|
||||
|
||||
<div id="http.visits-humansbots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visits.humans" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
<div id="http.visits.bots" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -231,6 +231,28 @@ public class HttpAccessLog
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is visit.
|
||||
*
|
||||
* @return true, if is visit
|
||||
*/
|
||||
public boolean isVisit()
|
||||
{
|
||||
boolean result;
|
||||
|
||||
if ((this.status.getCategory() == HttpStatusCategory.SUCCESS) && (!isBot()) && (this.request.startsWith("GET ")))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setBodyBytesSent(final long bodyBytesSent)
|
||||
{
|
||||
this.bodyBytesSent = bodyBytesSent;
|
||||
|
|
|
@ -51,19 +51,20 @@ public class HttpAccessLogAnalyzer
|
|||
|
||||
private int errorCount;
|
||||
private PathCounters counters;
|
||||
private VisitCounters visits;
|
||||
private VisitCounters botVisits;
|
||||
private VisitCounters humanVisits;
|
||||
private IpCounters ips;
|
||||
private IpCounters ipv4;
|
||||
private IpCounters ipv6;
|
||||
private IpCounters botIps;
|
||||
private IpCounters humanIps;
|
||||
private VisitorCounters requesters;
|
||||
private VisitorCounters ipv4Requesters;
|
||||
private VisitorCounters ipv6Requesters;
|
||||
private VisitorCounters botRequesters;
|
||||
private VisitorCounters humanRequesters;
|
||||
private VisitCounters visits;
|
||||
private VisitorCounters visitors;
|
||||
private VisitorCounters ipv4Visitors;
|
||||
private VisitorCounters ipv6Visitors;
|
||||
private VisitorCounters botVisitors;
|
||||
private VisitorCounters humanVisitors;
|
||||
|
||||
/**
|
||||
* Instantiates a new http access log prober.
|
||||
|
@ -71,20 +72,22 @@ public class HttpAccessLogAnalyzer
|
|||
public HttpAccessLogAnalyzer()
|
||||
{
|
||||
this.counters = new PathCounters();
|
||||
this.visits = new VisitCounters();
|
||||
this.botVisits = new VisitCounters();
|
||||
this.humanVisits = new VisitCounters();
|
||||
this.ips = new IpCounters();
|
||||
this.ipv4 = new IpCounters();
|
||||
this.ipv6 = new IpCounters();
|
||||
this.botIps = new IpCounters();
|
||||
this.humanIps = new IpCounters();
|
||||
|
||||
this.requesters = new VisitorCounters();
|
||||
this.ipv4Requesters = new VisitorCounters();
|
||||
this.ipv6Requesters = new VisitorCounters();
|
||||
this.humanRequesters = new VisitorCounters();
|
||||
this.botRequesters = new VisitorCounters();
|
||||
|
||||
this.visits = new VisitCounters();
|
||||
this.visitors = new VisitorCounters();
|
||||
this.ipv4Visitors = new VisitorCounters();
|
||||
this.ipv6Visitors = new VisitorCounters();
|
||||
this.botVisitors = new VisitorCounters();
|
||||
this.humanVisitors = new VisitorCounters();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,15 +108,16 @@ public class HttpAccessLogAnalyzer
|
|||
result.putAll(this.botIps.getCounters("metrics.http.ip.bots"));
|
||||
result.putAll(this.humanIps.getCounters("metrics.http.ip.humans"));
|
||||
|
||||
result.putAll(this.visits.getCounters("metrics.http.visits"));
|
||||
result.putAll(this.botVisits.getCounters("metrics.http.visits.bots"));
|
||||
result.putAll(this.humanVisits.getCounters("metrics.http.visits.humans"));
|
||||
result.putAll(this.requesters.getCounters("metrics.http.requesters"));
|
||||
result.putAll(this.ipv4Requesters.getCounters("metrics.http.requesters.ipv4"));
|
||||
result.putAll(this.ipv6Requesters.getCounters("metrics.http.requesters.ipv6"));
|
||||
result.putAll(this.botRequesters.getCounters("metrics.http.requesters.bots"));
|
||||
result.putAll(this.humanRequesters.getCounters("metrics.http.requesters.humans"));
|
||||
|
||||
result.putAll(this.visits.getCounters("metrics.http.visits"));
|
||||
result.putAll(this.visitors.getCounters("metrics.http.visitors"));
|
||||
result.putAll(this.ipv4Visitors.getCounters("metrics.http.visitors.ipv4"));
|
||||
result.putAll(this.ipv6Visitors.getCounters("metrics.http.visitors.ipv6"));
|
||||
result.putAll(this.botVisitors.getCounters("metrics.http.visitors.bots"));
|
||||
result.putAll(this.humanVisitors.getCounters("metrics.http.visitors.humans"));
|
||||
|
||||
//
|
||||
return result;
|
||||
|
@ -267,46 +271,50 @@ public class HttpAccessLogAnalyzer
|
|||
this.humanIps.put(log.getIp(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
|
||||
// metrics.http.visits.* =
|
||||
this.visits.putVisit(log);
|
||||
this.visits.storeTimeMarks(year, yearMonth, yearWeek, date);
|
||||
// metrics.http.requesters.* =
|
||||
this.requesters.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
|
||||
if (log.isBot())
|
||||
{
|
||||
this.botVisits.putVisit(log);
|
||||
this.botVisits.storeTimeMarks(year, yearMonth, yearWeek, date);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.humanVisits.putVisit(log);
|
||||
this.humanVisits.storeTimeMarks(year, yearMonth, yearWeek, date);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
// metrics.http.visitors.* =
|
||||
this.visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
|
||||
// metrics.http.visitors.ipv4.* =
|
||||
// metrics.http.visitors.ipv6.* =
|
||||
// metrics.http.requesters.ipv4.* =
|
||||
// metrics.http.requesters.ipv6.* =
|
||||
if (log.isIPv4())
|
||||
{
|
||||
this.ipv4Visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
this.ipv4Requesters.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ipv6Visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
this.ipv6Requesters.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
|
||||
// metrics.http.visitors.bots.*
|
||||
// metrics.http.visitors.humans.*
|
||||
// metrics.http.requesters.bots.*
|
||||
// metrics.http.requesters.humans.*
|
||||
if (log.isBot())
|
||||
{
|
||||
this.botVisitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
this.botRequesters.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.humanVisitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
this.humanRequesters.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
|
||||
// metrics.http.visits.* =
|
||||
// metrics.http.visitors.* =
|
||||
// metrics.http.visitors.ipv4.* =
|
||||
// metrics.http.visitors.ipv6.* =
|
||||
if (log.isVisit())
|
||||
{
|
||||
this.visits.putVisit(log);
|
||||
this.visits.storeTimeMarks(year, yearMonth, yearWeek, date);
|
||||
|
||||
this.visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
|
||||
if (log.isIPv4())
|
||||
{
|
||||
this.ipv4Visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ipv6Visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
|
||||
}
|
||||
}
|
||||
|
||||
// metrics.http.status.XXXX
|
||||
|
|
|
@ -176,8 +176,6 @@ public class VisitCounters extends HashMap<String, Visits>
|
|||
*/
|
||||
public void putVisit(final HttpAccessLog log)
|
||||
{
|
||||
// if ((log != null) && (log.getStatus().getCategory() ==
|
||||
// HttpStatusCategory.SUCCESS))
|
||||
if (log != null)
|
||||
{
|
||||
String key = computeKey(log);
|
||||
|
|
Loading…
Reference in a new issue