Added visits.ipv4 and visits.ipv6 management.

This commit is contained in:
Christian P. MOMON 2022-01-20 19:25:02 +01:00
parent 00d778c9f3
commit 0e47ac2dae
5 changed files with 55 additions and 8 deletions

View file

@ -110,13 +110,18 @@ public class FederationMetricWebPage
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-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-ipv4ipv6", federation, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW,
"metrics.http.visits.ipv6", ChartColor.GREEN);
FederationMetricHtmlizer.htmlize(data, "http.visits.ipv4", federation, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW);
FederationMetricHtmlizer.htmlize(data, "http.visits.ipv6", federation, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN);
//
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricWebView.xhtml", data).toString();

View file

@ -119,13 +119,18 @@ public class OrganizationMetricWebPage
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-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-ipv4ipv6", organization, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW,
"metrics.http.visits.ipv6", ChartColor.GREEN);
OrganizationMetricHtmlizer.htmlize(data, "http.visits.ipv4", organization, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW);
OrganizationMetricHtmlizer.htmlize(data, "http.visits.ipv6", organization, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN);
//
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricWebView.xhtml", data).toString();

View file

@ -118,13 +118,18 @@ public class ServiceMetricWebPage
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-ipv4ipv6", service, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW,
"metrics.http.visits.ipv6", ChartColor.GREEN);
ServiceMetricHtmlizer.htmlize(data, "http.visits.ipv4", service, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW);
ServiceMetricHtmlizer.htmlize(data, "http.visits.ipv6", service, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN);
//
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricWebView.xhtml", data).toString();

View file

@ -61,15 +61,20 @@
<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/>
<h2>Visiteurs</h2>
<div id="http.visitors" style="width: 450px; height: 300px; border: 1px solid #e7e7e7;"/>
<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/>
<h2>Visites</h2>
<div id="http.visits" style="width: 450px; height: 300px; border: 1px solid #e7e7e7;"/>
<div id="http.visits-ipv4ipv6" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
<div id="http.visits.ipv4" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
<div id="http.visits.ipv6" style="width: 450px; height: 300px; display: inline-block; border: 1px solid #e7e7e7;"/>
<br/>
</div>
</div>
</body>

View file

@ -62,6 +62,8 @@ public class HttpAccessLogAnalyzer
private VisitorCounters botRequesters;
private VisitorCounters humanRequesters;
private VisitCounters visits;
private VisitCounters ipv4Visits;
private VisitCounters ipv6Visits;
private VisitorCounters visitors;
private VisitorCounters ipv4Visitors;
private VisitorCounters ipv6Visitors;
@ -85,6 +87,9 @@ public class HttpAccessLogAnalyzer
this.botRequesters = new VisitorCounters();
this.visits = new VisitCounters();
this.ipv4Visits = new VisitCounters();
this.ipv6Visits = new VisitCounters();
this.visitors = new VisitorCounters();
this.ipv4Visitors = new VisitorCounters();
this.ipv6Visitors = new VisitorCounters();
@ -115,6 +120,9 @@ public class HttpAccessLogAnalyzer
result.putAll(this.humanRequesters.getCounters("metrics.http.requesters.humans"));
result.putAll(this.visits.getCounters("metrics.http.visits"));
result.putAll(this.ipv4Visits.getCounters("metrics.http.visits.ipv4"));
result.putAll(this.ipv6Visits.getCounters("metrics.http.visits.ipv6"));
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"));
@ -297,14 +305,33 @@ public class HttpAccessLogAnalyzer
}
// metrics.http.visits.* =
// metrics.http.visits.ipv4.* =
// metrics.http.visits.ipv6.* =
// metrics.http.visitors.* =
// metrics.http.visitors.ipv4.* =
// metrics.http.visitors.ipv6.* =
if (log.isVisit())
{
// metrics.http.visits.* =
// metrics.http.visits.ipv4.* =
// metrics.http.visits.ipv6.* =
this.visits.putVisit(log);
this.visits.storeTimeMarks(year, yearMonth, yearWeek, date);
if (log.isIPv4())
{
this.ipv4Visits.putVisit(log);
this.ipv4Visits.storeTimeMarks(year, yearMonth, yearWeek, date);
}
else
{
this.ipv6Visits.putVisit(log);
this.ipv6Visits.storeTimeMarks(year, yearMonth, yearWeek, date);
}
// metrics.http.visitors.* =
// metrics.http.visitors.ipv4.* =
// metrics.http.visitors.ipv6.* =
this.visitors.put(log.getIp(), log.getUserAgent(), year, yearMonth, yearWeek, date);
if (log.isIPv4())