From b1e841c7876c456575715587829d6507192ea3d3 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 5 Mar 2022 15:57:57 +0100 Subject: [PATCH] Added services figure view. --- src/fr/devinsy/statoolinfos/core/Service.java | 34 ++++++++++++ .../htmlize/ServiceFigureView.java | 5 +- .../htmlize/serviceFigureView.xhtml | 54 +++++++++++++++++-- 3 files changed, 88 insertions(+), 5 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 6948f32..c838dea 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -497,6 +497,40 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the month database bytes. + * + * @param month + * the month + * @return the month database bytes + */ + public long getMonthDatabaseBytes(final YearMonth month) + { + long result; + + result = getMonthCount("metrics.service.database.bytes", month); + + // + return result; + } + + /** + * Gets the month datafiles bytes. + * + * @param month + * the month + * @return the month datafiles bytes + */ + public long getMonthDatafilesBytes(final YearMonth month) + { + long result; + + result = getMonthCount("metrics.service.datafiles.bytes", month); + + // + return result; + } + /** * Gets the month hit count. * diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServiceFigureView.java b/src/fr/devinsy/statoolinfos/htmlize/ServiceFigureView.java index e0eb0d6..6cdb940 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServiceFigureView.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServiceFigureView.java @@ -62,6 +62,8 @@ public class ServiceFigureView TagDataManager data = new TagDataManager(); data.setContent("serviceCount", services.size()); + YearMonth month = YearMonth.now(); + data.setContent("currentMonth", month.format(DateTimeFormatter.ofPattern("MMMM yyyy"))); if (services.isEmpty()) { @@ -98,13 +100,14 @@ public class ServiceFigureView data.setEscapedContent("serviceListLine", index, "serviceListLineSoftwareLink", service.getSoftwareName()); data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", "software-" + service.getSoftwareTechnicalName() + ".xhtml"); - YearMonth month = YearMonth.now(); data.setContent("serviceListLine", index, "serviceListLineHitCount", StatoolInfosUtils.defaultIfZero(service.getMonthHitCount(month), "😢")); data.setContent("serviceListLine", index, "serviceListLineVisitCount", StatoolInfosUtils.defaultIfZero(service.getMonthVisitCount(month), "😞")); data.setContent("serviceListLine", index, "serviceListLineVisitorCount", StatoolInfosUtils.defaultIfZero(service.getMonthVisitorCount(month), "😞")); data.setContent("serviceListLine", index, "serviceListLineUserCount", StatoolInfosUtils.defaultIfZero(service.getMonthUserCount(month), "😢")); data.setContent("serviceListLine", index, "serviceListLineAccountCount", StatoolInfosUtils.defaultIfZero(service.getMonthAccountCount(month), "😇")); data.setContent("serviceListLine", index, "serviceListLineActiveAccountCount", StatoolInfosUtils.defaultIfZero(service.getMonthActiveAccountCount(month), "😇")); + data.setContent("serviceListLine", index, "serviceListLineDatabaseBytes", StatoolInfosUtils.defaultIfZero(service.getMonthDatabaseBytes(month), "😇")); + data.setContent("serviceListLine", index, "serviceListLineDatafilesBytes", StatoolInfosUtils.defaultIfZero(service.getMonthDatafilesBytes(month), "😇")); index += 1; } diff --git a/src/fr/devinsy/statoolinfos/htmlize/serviceFigureView.xhtml b/src/fr/devinsy/statoolinfos/htmlize/serviceFigureView.xhtml index a80f10a..36d291c 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/serviceFigureView.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/serviceFigureView.xhtml @@ -13,8 +13,8 @@

-
Nombre de services : n/a
- +
n/a
+
n/a services
@@ -26,6 +26,8 @@ + + @@ -49,8 +51,13 @@ + + + + +
Utilisateurs Comptes Comptes actifsBase (octets)Fichiers (octets)
n/a n/a n/an/an/a