From 37853c40d9a360dda34cfa1bc552b224622fdd0f Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 27 Feb 2022 11:57:56 +0100 Subject: [PATCH] Improved Gitea user metric computation. --- .../devinsy/statoolinfos/metrics/gitea/GiteaProber.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaProber.java b/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaProber.java index 06d9de2..8b5c13d 100644 --- a/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaProber.java +++ b/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaProber.java @@ -32,6 +32,7 @@ import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.UserCounters; import fr.devinsy.statoolinfos.metrics.http.HttpAccessLog; import fr.devinsy.statoolinfos.metrics.http.HttpAccessLogs; +import fr.devinsy.statoolinfos.metrics.http.HttpStatusCategory; import fr.devinsy.statoolinfos.metrics.util.DatabaseProber; import fr.devinsy.statoolinfos.metrics.util.DatafilesProber; import fr.devinsy.statoolinfos.util.Files; @@ -186,9 +187,14 @@ public class GiteaProber GET /cpm GET /devinsy */ + // regexList.add("GET /\\w+ .*"); /* GET /devinsy/bacasable + */ + // regexList.add("GET /\\w+/\\w+ .*"); + + /* GET /devinsy/bacasable/activity GET /devinsy/bacasable/commits/branch/master GET /devinsy/bacasable/compare/master...master @@ -279,7 +285,7 @@ public class GiteaProber // metrics.service.users // metrics.service.users.ipv4 // metrics.service.users.ipv6 - if ((!log.isBot()) && (USE_PATTERN.matcher(log.getRequest()).matches())) + if ((log.getStatus().getCategory() == HttpStatusCategory.SUCCESS) && (!log.isBot()) && (USE_PATTERN.matcher(log.getRequest()).matches())) { String key = String.format("%s---%s", log.getIp(), log.getUserAgent());