From d5c67afb64e86cd62b631824cbdd29269792d44d Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Fri, 24 Dec 2021 17:38:30 +0100 Subject: [PATCH] Improved generic metric display. --- src/fr/devinsy/statoolinfos/core/Service.java | 4 ++-- .../htmlize/FederationMetricGenericPage.java | 12 +++++++++--- .../htmlize/OrganizationMetricGenericPage.java | 13 +++++++++---- .../htmlize/ServiceMetricGenericPage.java | 18 +++++++++++++++--- .../htmlize/serviceMetricGenericView.xhtml | 12 ++++++++---- 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 189eb33..065f857 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -487,7 +487,7 @@ public class Service extends PathPropertyList { long result; - MonthValues values = getMetricMonthValues("metrics.users.count"); + MonthValues values = getMetricMonthValues("metrics.service.users"); values = values.extract(YearMonth.now().minusMonths(1), YearMonth.now().minusMonths(1)); @@ -506,7 +506,7 @@ public class Service extends PathPropertyList { long result; - MonthValues values = getMetricMonthValues("metrics.http.visits.visitors"); + MonthValues values = getMetricMonthValues("metrics.http.visits.humans"); values = values.extract(YearMonth.now().minusMonths(1), YearMonth.now().minusMonths(1)); diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationMetricGenericPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationMetricGenericPage.java index 9f84b93..132e2e4 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationMetricGenericPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationMetricGenericPage.java @@ -69,9 +69,15 @@ public class FederationMetricGenericPage data.setContent("metricMenuView", FederationMetricMenuView.htmlize(federation, TypeMenu.GENERIC, view, period)); // - FederationMetricHtmlizer.htmlize(data, "users.count", federation, view, period, "metrics.users.count", ChartColor.GREEN); - FederationMetricHtmlizer.htmlize(data, "database.bytes", federation, view, period, "metrics.database.bytes", ChartColor.GREEN); - FederationMetricHtmlizer.htmlize(data, "files.bytes", federation, view, period, "metrics.http.visits.visitors", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "graphic.users", federation, view, period, "metrics.service.users", ChartColor.GREEN); + + FederationMetricHtmlizer.htmlize(data, "graphic.accounts.combo", federation, view, period, "Accounts + active", "metrics.service.accounts", ChartColor.YELLOW, + "metrics.service.accounts.active", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "graphic.accounts", federation, view, period, "metrics.service.accounts", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "graphic.accounts.active", federation, view, period, "metrics.service.accounts.active", ChartColor.GREEN); + + FederationMetricHtmlizer.htmlize(data, "graphic.database.bytes", federation, view, period, "metrics.service.database.bytes", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "graphic.files.bytes", federation, view, period, "metrics.service.files.bytes", ChartColor.GREEN); // String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml", data).toString(); diff --git a/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricGenericPage.java b/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricGenericPage.java index b376092..f5530f4 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricGenericPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricGenericPage.java @@ -70,12 +70,17 @@ public class OrganizationMetricGenericPage data.setContent("metricMenuView", OrganizationMetricMenuView.htmlize(organization, TypeMenu.GENERIC, view, period)); // - OrganizationMetricHtmlizer.htmlize(data, "users.count", organization, view, period, "metrics.users.count", ChartColor.GREEN); - OrganizationMetricHtmlizer.htmlize(data, "database.bytes", organization, view, period, "metrics.database.bytes", ChartColor.GREEN); - OrganizationMetricHtmlizer.htmlize(data, "files.bytes", organization, view, period, "metrics.http.visits.visitors", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "graphic.users", organization, view, period, "metrics.service.users", ChartColor.GREEN); + + OrganizationMetricHtmlizer.htmlize(data, "graphic.accounts.combo", organization, view, period, "Accounts + active", "metrics.service.accounts", ChartColor.YELLOW, + "metrics.service.accounts.active", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "graphic.accounts", organization, view, period, "metrics.service.accounts", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "graphic.accounts.active", organization, view, period, "metrics.service.accounts.active", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "graphic.database.bytes", organization, view, period, "metrics.service.database.bytes", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "graphic.files.bytes", organization, view, period, "metrics.service.files.bytes", ChartColor.GREEN); // - String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml", data).toString(); + String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml", data).toString(); BreadcrumbTrail trail = new BreadcrumbTrail(); trail.add(organization.getName(), organization.getLocalFileBaseName() + ".xhtml"); diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricGenericPage.java b/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricGenericPage.java index c168124..ab2c3f0 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricGenericPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricGenericPage.java @@ -70,9 +70,21 @@ public class ServiceMetricGenericPage data.setContent("metricMenuView", ServiceMetricMenuView.htmlize(service, TypeMenu.GENERIC, view, period)); // - ServiceMetricHtmlizer.htmlize(data, "users.count", service, view, period, "metrics.users.count", ChartColor.GREEN); - ServiceMetricHtmlizer.htmlize(data, "database.bytes", service, view, period, "metrics.database.bytes", ChartColor.GREEN); - ServiceMetricHtmlizer.htmlize(data, "files.bytes", service, view, period, "metrics.http.visits.visitors", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "graphic.users", service, view, period, "metrics.service.users", ChartColor.GREEN); + + ServiceMetricHtmlizer.htmlize(data, "graphic.accounts.combo", service, view, period, "Accounts + active", "metrics.service.accounts", ChartColor.YELLOW, + "metrics.service.accounts.active", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "graphic.accounts", service, view, period, "metrics.service.accounts", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "graphic.accounts.active", service, view, period, "metrics.service.accounts.active", ChartColor.GREEN); + + ServiceMetricHtmlizer.htmlize(data, "graphic.database.bytes", service, view, period, "metrics.service.database.bytes", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "graphic.files.bytes", service, view, period, "metrics.service.files.bytes", ChartColor.GREEN); + + // metrics.moderation.accounts.reported.* = + // metrics.moderation.accounts.sanctioned.* = + // metrics.moderation.accounts.disabled.* = + // metrics.moderation.accounts.silenced.* = + // metrics.moderation.accounts.cancelled.* = // String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml", data).toString(); diff --git a/src/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml b/src/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml index 90f8b39..a15087f 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/serviceMetricGenericView.xhtml @@ -16,11 +16,15 @@

Utilisateurs

-
- +
+
+
+
+
+

Données

-
-
+
+