From 87a6a15f10252316ae2dc2cf57b371afc5cabe22 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 7 Mar 2022 19:40:30 +0100 Subject: [PATCH] Added sql database probing. Gitea + Minetest. --- .classpath | 5 +- README.md | 116 +++-- lib/mariadb-java-client-3.0.3.jar | Bin 0 -> 567989 bytes lib/postgresql-42.3.3.jar | Bin 0 -> 1039047 bytes lib/sqlite-jdbc-3.36.0.3.jar | Bin 0 -> 9731064 bytes .../statoolinfos/core/Configuration.java | 10 +- .../statoolinfos/core/DatabaseConfig.java | 78 ++-- .../devinsy/statoolinfos/metrics/Prober.java | 12 +- .../metrics/gitea/GiteaProber.java | 24 +- .../metrics/minetest/MinetestProber.java | 52 ++- .../metrics/util/DatabaseProber.java | 28 +- .../util/sql/ClosedDatabaseException.java | 72 +++ .../util/sql/OpenedDatabaseException.java | 72 +++ .../statoolinfos/util/sql/SQLDatabase.java | 441 ++++++++++++++++++ .../statoolinfos/util/{ => sql}/SQLUtils.java | 81 +++- 15 files changed, 881 insertions(+), 110 deletions(-) create mode 100644 lib/mariadb-java-client-3.0.3.jar create mode 100644 lib/postgresql-42.3.3.jar create mode 100644 lib/sqlite-jdbc-3.36.0.3.jar create mode 100644 src/fr/devinsy/statoolinfos/util/sql/ClosedDatabaseException.java create mode 100644 src/fr/devinsy/statoolinfos/util/sql/OpenedDatabaseException.java create mode 100644 src/fr/devinsy/statoolinfos/util/sql/SQLDatabase.java rename src/fr/devinsy/statoolinfos/util/{ => sql}/SQLUtils.java (79%) diff --git a/.classpath b/.classpath index 5f9bb89..56f0fa7 100644 --- a/.classpath +++ b/.classpath @@ -10,7 +10,6 @@ - @@ -29,5 +28,9 @@ + + + + diff --git a/README.md b/README.md index 5147189..f39b2f9 100644 --- a/README.md +++ b/README.md @@ -127,55 +127,6 @@ Create a cron file to update the metric file everyday: Warning: in previous day mode, the metrics generated are overwrited for the last month, the last week and the last day. So, six weeks in logs are required. -### Web metrics - -Configuration template: - -``` -conf.probe.types=HttpAccessLog, HttpErrorLog -conf.probe.httpaccesslog.file=/var/log/apache2/foo.bar.org-access.log* -conf.probe.httperrorlog.file=/var/log/apache2/foo.bar.org-error.log* -conf.probe.target=/srv/statoolinfos/well-known/statoolinfos/foo.bar.org-metrics.properties - -# Custom access log pattern with Java regex. -# Default: "^(?[a-zA-F0-9\\\\:\\\\.]+) - (?[^\\[]+) \\[(?