Compare commits

...

7 commits

124 changed files with 934 additions and 691 deletions

View file

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View file

@ -6,11 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
Changes for metrics:
- … - …
## [0.?.?] -
Changes for metrics:
- PARAMETER MULTI TODO
- Refactored HttpError TODO
- GSL service is no longer targeted.
- Added categories file from CHATONS stats workgroup with Angie from Framasoft, MrFlo and Cpm.
Changes for web building: Changes for web building:
- … - SPLITWEB: no more web building! Watch the StatoolInfosWeb project.
## [0.5.1] 2023-05-09 ## [0.5.1] 2023-05-09

View file

@ -186,16 +186,6 @@ conf.probe.gitea.database.password=
conf.probe.target=/srv/statoolinfos/well-known/statoolinfos/foo.bar.org-metrics.properties conf.probe.target=/srv/statoolinfos/well-known/statoolinfos/foo.bar.org-metrics.properties
``` ```
### GSL metrics
Configuration template:
```
conf.probe.types=GSL
conf.probe.gsl.stats=/foo/bar/stats.properties
conf.probe.target=/srv/statoolinfos/well-known/statoolinfos/foo.bar.org-metrics.properties
```
### LibreQR metrics ### LibreQR metrics
Configuration template: Configuration template:

View file

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Tue May 09 18:35:03 CEST 2023 #Tue May 09 18:35:03 CEST 2023
build.number=2 build.number=0

View file

@ -1,4 +1,4 @@
product.name=statoolinfos product.name=statoolinfos
product.revision.major=0 product.revision.major=0
product.revision.minor=5 product.revision.minor=6
product.revision.snapshot= product.revision.snapshot=

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2023 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -19,16 +19,12 @@
package fr.devinsy.statoolinfos.cli; package fr.devinsy.statoolinfos.cli;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class CLIUtils. * The Class CLIUtils.
*/ */
public final class CLIUtils public final class CLIUtils
{ {
private static Logger logger = LoggerFactory.getLogger(CLIUtils.class);
/** /**
* Instantiates a new statool infos CLI. * Instantiates a new statool infos CLI.
*/ */

View file

@ -39,6 +39,11 @@ public class Category
/** /**
* Instantiates a new category. * Instantiates a new category.
*
* @param name
* the name
* @param description
* the description
*/ */
public Category(final String name, final String description) public Category(final String name, final String description)
{ {
@ -64,6 +69,11 @@ public class Category
this.logoPath = DEFAULT_LOGO_PATH; this.logoPath = DEFAULT_LOGO_PATH;
} }
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() public String getDescription()
{ {
return this.description; return this.description;
@ -91,11 +101,21 @@ public class Category
return result; return result;
} }
/**
* Gets the name.
*
* @return the name
*/
public String getName() public String getName()
{ {
return this.name; return this.name;
} }
/**
* Gets the softwares.
*
* @return the softwares
*/
public StringList getSoftwares() public StringList getSoftwares()
{ {
return this.softwares; return this.softwares;
@ -173,6 +193,12 @@ public class Category
return result; return result;
} }
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(final String description) public void setDescription(final String description)
{ {
this.description = description; this.description = description;
@ -196,6 +222,12 @@ public class Category
} }
} }
/**
* Sets the name.
*
* @param name
* the new name
*/
public void setName(final String name) public void setName(final String name)
{ {
this.name = name; this.name = name;

View file

@ -209,8 +209,6 @@ public class Factory
* @return the configuration * @return the configuration
* @throws StatoolInfosException * @throws StatoolInfosException
* the statool infos exception * the statool infos exception
* @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static Configuration loadConfiguration(final File configurationFile) throws StatoolInfosException public static Configuration loadConfiguration(final File configurationFile) throws StatoolInfosException
{ {
@ -431,8 +429,15 @@ public class Factory
/** /**
* Load service. * Load service.
* *
* @param inputURL
* the input URL
* @param cache
* the cache
* @param organization
* the organization
* @return the service * @return the service
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static Service loadService(final URL inputURL, final CrawlCache cache, final Organization organization) throws IOException public static Service loadService(final URL inputURL, final CrawlCache cache, final Organization organization) throws IOException
{ {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -217,6 +217,11 @@ public class Federation extends PathPropertyList
return result; return result;
} }
/**
* Gets the crawl journal.
*
* @return the crawl journal
*/
public CrawlJournal getCrawlJournal() public CrawlJournal getCrawlJournal()
{ {
return this.crawlJournal; return this.crawlJournal;
@ -252,6 +257,11 @@ public class Federation extends PathPropertyList
return result; return result;
} }
/**
* Gets the input checks.
*
* @return the input checks
*/
public PropertyChecks getInputChecks() public PropertyChecks getInputChecks()
{ {
return this.inputChecks; return this.inputChecks;
@ -279,11 +289,21 @@ public class Federation extends PathPropertyList
return result; return result;
} }
/**
* Gets the input file.
*
* @return the input file
*/
public File getInputFile() public File getInputFile()
{ {
return this.inputFile; return this.inputFile;
} }
/**
* Gets the input URL.
*
* @return the input URL
*/
public URL getInputURL() public URL getInputURL()
{ {
return this.inputURL; return this.inputURL;
@ -336,6 +356,11 @@ public class Federation extends PathPropertyList
return result; return result;
} }
/**
* Gets the logo file name.
*
* @return the logo file name
*/
public String getLogoFileName() public String getLogoFileName()
{ {
return this.logoFileName; return this.logoFileName;
@ -499,6 +524,11 @@ public class Federation extends PathPropertyList
return result; return result;
} }
/**
* Gets the organizations.
*
* @return the organizations
*/
public Organizations getOrganizations() public Organizations getOrganizations()
{ {
return this.organizations; return this.organizations;
@ -819,11 +849,23 @@ public class Federation extends PathPropertyList
this.inputFile = inputFile; this.inputFile = inputFile;
} }
/**
* Sets the input URL.
*
* @param inputURL
* the new input URL
*/
public void setInputURL(final URL inputURL) public void setInputURL(final URL inputURL)
{ {
this.inputURL = inputURL; this.inputURL = inputURL;
} }
/**
* Sets the logo file name.
*
* @param logoFileName
* the new logo file name
*/
public void setLogoFileName(final String logoFileName) public void setLogoFileName(final String logoFileName)
{ {
this.logoFileName = logoFileName; this.logoFileName = logoFileName;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -23,8 +23,6 @@ import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.checker.PropertyChecks; import fr.devinsy.statoolinfos.checker.PropertyChecks;
import fr.devinsy.statoolinfos.properties.PathProperties; import fr.devinsy.statoolinfos.properties.PathProperties;
@ -37,8 +35,6 @@ public class Metrics extends PathPropertyList
{ {
private static final long serialVersionUID = -1608084706095266037L; private static final long serialVersionUID = -1608084706095266037L;
private static Logger logger = LoggerFactory.getLogger(Metrics.class);
private String localFileNamePrefix; private String localFileNamePrefix;
private File inputFile; private File inputFile;
private URL inputURL; private URL inputURL;
@ -99,16 +95,31 @@ public class Metrics extends PathPropertyList
return result; return result;
} }
/**
* Gets the input checks.
*
* @return the input checks
*/
public PropertyChecks getInputChecks() public PropertyChecks getInputChecks()
{ {
return this.inputChecks; return this.inputChecks;
} }
/**
* Gets the input file.
*
* @return the input file
*/
public File getInputFile() public File getInputFile()
{ {
return this.inputFile; return this.inputFile;
} }
/**
* Gets the input URL.
*
* @return the input URL
*/
public URL getInputURL() public URL getInputURL()
{ {
return this.inputURL; return this.inputURL;
@ -144,6 +155,11 @@ public class Metrics extends PathPropertyList
return result; return result;
} }
/**
* Gets the local file name prefix.
*
* @return the local file name prefix
*/
public String getLocalFileNamePrefix() public String getLocalFileNamePrefix()
{ {
return this.localFileNamePrefix; return this.localFileNamePrefix;
@ -165,16 +181,34 @@ public class Metrics extends PathPropertyList
return result; return result;
} }
/**
* Sets the input file.
*
* @param inputFile
* the new input file
*/
public void setInputFile(final File inputFile) public void setInputFile(final File inputFile)
{ {
this.inputFile = inputFile; this.inputFile = inputFile;
} }
/**
* Sets the input URL.
*
* @param inputURL
* the new input URL
*/
public void setInputURL(final URL inputURL) public void setInputURL(final URL inputURL)
{ {
this.inputURL = inputURL; this.inputURL = inputURL;
} }
/**
* Sets the local file name prefix.
*
* @param localFileNamePrefix
* the new local file name prefix
*/
public void setLocalFileNamePrefix(final String localFileNamePrefix) public void setLocalFileNamePrefix(final String localFileNamePrefix)
{ {
this.localFileNamePrefix = localFileNamePrefix; this.localFileNamePrefix = localFileNamePrefix;

View file

@ -42,6 +42,8 @@ import fr.devinsy.statoolinfos.util.URLUtils;
*/ */
public class Organization extends PathPropertyList public class Organization extends PathPropertyList
{ {
private static final long serialVersionUID = -2709210934548224213L;
public enum Status public enum Status
{ {
ACTIVE, ACTIVE,
@ -60,8 +62,6 @@ public class Organization extends PathPropertyList
OTHER OTHER
} }
private static final long serialVersionUID = -2709210934548224213L;
private Federation federation; private Federation federation;
private Services services; private Services services;
private File inputFile; private File inputFile;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -27,8 +27,6 @@ import java.time.YearMonth;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.checker.PropertyChecks; import fr.devinsy.statoolinfos.checker.PropertyChecks;
import fr.devinsy.statoolinfos.crawl.CrawlJournal; import fr.devinsy.statoolinfos.crawl.CrawlJournal;
@ -45,8 +43,6 @@ public class Service extends PathPropertyList
{ {
private static final long serialVersionUID = 3629841771102288863L; private static final long serialVersionUID = 3629841771102288863L;
private static Logger logger = LoggerFactory.getLogger(Service.class);
public enum HostProviderType public enum HostProviderType
{ {
HOME, HOME,

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -50,8 +50,6 @@ import org.apache.tika.Tika;
import org.apache.tika.mime.MimeType; import org.apache.tika.mime.MimeType;
import org.apache.tika.mime.MimeTypeException; import org.apache.tika.mime.MimeTypeException;
import org.apache.tika.mime.MimeTypes; import org.apache.tika.mime.MimeTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils; import fr.devinsy.strings.StringsUtils;
@ -61,8 +59,6 @@ import fr.devinsy.strings.StringsUtils;
*/ */
public class StatoolInfosUtils public class StatoolInfosUtils
{ {
private static Logger logger = LoggerFactory.getLogger(StatoolInfosUtils.class);
public static final DateTimeFormatter PATTERN_SHORTDATE = DateTimeFormatter.ofPattern("dd/MM/yyyy", Locale.FRANCE); public static final DateTimeFormatter PATTERN_SHORTDATE = DateTimeFormatter.ofPattern("dd/MM/yyyy", Locale.FRANCE);
public static final DateTimeFormatter PATTERN_LONGDATE = DateTimeFormatter.ofPattern("dd/MM/yyyy HH':'mm", Locale.FRANCE); public static final DateTimeFormatter PATTERN_LONGDATE = DateTimeFormatter.ofPattern("dd/MM/yyyy HH':'mm", Locale.FRANCE);

View file

@ -46,14 +46,14 @@ import fr.devinsy.statoolinfos.util.URLUtils;
*/ */
public class CrawlCache public class CrawlCache
{ {
private static Logger logger = LoggerFactory.getLogger(CrawlCache.class);
public static enum DefaultLogoGenerator public static enum DefaultLogoGenerator
{ {
CAT, CAT,
BIRD BIRD
} }
private static Logger logger = LoggerFactory.getLogger(CrawlCache.class);
private File directory; private File directory;
/** /**
@ -116,6 +116,11 @@ public class CrawlCache
} }
} }
/**
* Gets the directory.
*
* @return the directory
*/
public File getDirectory() public File getDirectory()
{ {
return this.directory; return this.directory;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -34,6 +34,8 @@ public class CrawlLog
* *
* @param url * @param url
* the url * the url
* @param parentUrl
* the parent url
* @param status * @param status
* the status * the status
*/ */
@ -44,6 +46,11 @@ public class CrawlLog
this.status = status; this.status = status;
} }
/**
* Gets the parent url.
*
* @return the parent url
*/
public URL getParentUrl() public URL getParentUrl()
{ {
return this.parentUrl; return this.parentUrl;
@ -71,11 +78,21 @@ public class CrawlLog
return result; return result;
} }
/**
* Gets the status.
*
* @return the status
*/
public CrawlStatus getStatus() public CrawlStatus getStatus()
{ {
return this.status; return this.status;
} }
/**
* Gets the url.
*
* @return the url
*/
public URL getUrl() public URL getUrl()
{ {
return this.url; return this.url;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -68,6 +68,8 @@ public class CrawlLogs extends ArrayList<CrawlLog>
* *
* @param url * @param url
* the url * the url
* @param parentUrl
* the parent url
* @param status * @param status
* the status * the status
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -18,6 +18,9 @@
*/ */
package fr.devinsy.statoolinfos.crawl; package fr.devinsy.statoolinfos.crawl;
/**
* The Enum CrawlStatus.
*/
public enum CrawlStatus public enum CrawlStatus
{ {
BADCHILDCLASS, BADCHILDCLASS,
@ -31,6 +34,11 @@ public enum CrawlStatus
UPDATED, UPDATED,
URLNOTFOUND; URLNOTFOUND;
/**
* Checks if is error.
*
* @return true, if is error
*/
public boolean isError() public boolean isError()
{ {
boolean result; boolean result;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2023 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -250,6 +250,8 @@ public class Crawler
* *
* @param url * @param url
* the url * the url
* @param parentURL
* the parent URL
* @return the file * @return the file
*/ */
public File crawlLogo(final URL url, final URL parentURL) public File crawlLogo(final URL url, final URL parentURL)
@ -347,6 +349,7 @@ public class Crawler
* *
* @return the crawl journal * @return the crawl journal
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public CrawlJournal restoreJournal() throws IOException public CrawlJournal restoreJournal() throws IOException
{ {

View file

@ -22,8 +22,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.Categories; import fr.devinsy.statoolinfos.core.Categories;
import fr.devinsy.statoolinfos.core.Organization; import fr.devinsy.statoolinfos.core.Organization;
@ -39,8 +37,6 @@ import fr.devinsy.strings.StringSet;
*/ */
public class CSVFile public class CSVFile
{ {
private static final Logger logger = LoggerFactory.getLogger(CSVFile.class);
public static final int MAX_LINE_SIZE = 4096; public static final int MAX_LINE_SIZE = 4096;
public static final String SEPARATOR = ";"; public static final String SEPARATOR = ";";
@ -76,6 +72,8 @@ public class CSVFile
* the file * the file
* @param source * @param source
* the source * the source
* @param categories
* the categories
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
@ -151,6 +149,8 @@ public class CSVFile
* the out * the out
* @param services * @param services
* the services * the services
* @param categories
* the categories
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2023 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -29,16 +29,12 @@ import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class CSVWriter. * The Class CSVWriter.
*/ */
public class CSVWriter implements SpreadsheetWriter public class CSVWriter implements SpreadsheetWriter
{ {
private static final Logger logger = LoggerFactory.getLogger(CSVWriter.class);
private char separator; private char separator;
private PrintWriter out; private PrintWriter out;
private boolean isNewline; private boolean isNewline;

View file

@ -24,8 +24,6 @@ import java.io.UnsupportedEncodingException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.Categories; import fr.devinsy.statoolinfos.core.Categories;
import fr.devinsy.statoolinfos.core.Federation; import fr.devinsy.statoolinfos.core.Federation;
@ -43,8 +41,6 @@ import fr.devinsy.strings.StringsUtils;
*/ */
public class JSONFile public class JSONFile
{ {
private static final Logger logger = LoggerFactory.getLogger(JSONFile.class);
/** /**
* Escape. * Escape.
* *
@ -235,6 +231,8 @@ public class JSONFile
* *
* @param service * @param service
* the service * the service
* @param categories
* the categories
* @return the string list * @return the string list
*/ */
public static StringList toJSON(final Service service, final Categories categories) public static StringList toJSON(final Service service, final Categories categories)

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.io;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.Categories; import fr.devinsy.statoolinfos.core.Categories;
import fr.devinsy.statoolinfos.core.Organizations; import fr.devinsy.statoolinfos.core.Organizations;
import fr.devinsy.statoolinfos.core.Services; import fr.devinsy.statoolinfos.core.Services;
@ -33,11 +30,9 @@ import fr.devinsy.statoolinfos.core.Services;
*/ */
public class ODSFile public class ODSFile
{ {
private static final Logger logger = LoggerFactory.getLogger(ODSFile.class); public static final int MAX_LINE_SIZE = 1024;
public static final int MAX_LINE_SIZE = 1024;; protected enum Status
protected enum Status
{ {
MANDATORY, MANDATORY,
OPTIONAL OPTIONAL
@ -75,6 +70,10 @@ public class ODSFile
* the file * the file
* @param source * @param source
* the source * the source
* @param categories
* the categories
* @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static void save(final File file, final Services source, final Categories categories) throws IOException public static void save(final File file, final Services source, final Categories categories) throws IOException
{ {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -28,16 +28,12 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.jopendocument.dom.spreadsheet.Sheet; import org.jopendocument.dom.spreadsheet.Sheet;
import org.jopendocument.dom.spreadsheet.SpreadSheet; import org.jopendocument.dom.spreadsheet.SpreadSheet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class ODSWriter. * The Class ODSWriter.
*/ */
public class ODSWriter implements SpreadsheetWriter public class ODSWriter implements SpreadsheetWriter
{ {
private static final Logger logger = LoggerFactory.getLogger(ODSWriter.class);
private File file; private File file;
private SpreadSheet workbook; private SpreadSheet workbook;
private Sheet currentSheet; private Sheet currentSheet;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -26,11 +26,31 @@ import java.io.IOException;
*/ */
public interface SpreadsheetWriter public interface SpreadsheetWriter
{ {
/**
* Close.
*
* @throws FileNotFoundException
* the file not found exception
* @throws IOException
* Signals that an I/O exception has occurred.
*/
void close() throws FileNotFoundException, IOException; void close() throws FileNotFoundException, IOException;
/**
* Write cell.
*
* @param content
* the content
*/
void writeCell(String content); void writeCell(String content);
/**
* Write endpage.
*/
void writeEndpage(); void writeEndpage();
/**
* Write end row.
*/
void writeEndRow(); void writeEndRow();
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -60,6 +60,8 @@ public class IpCounters extends HashMap<String, StringSet>
/** /**
* Gets the counters. * Gets the counters.
* *
* @param prefix
* the prefix
* @return the counters * @return the counters
*/ */
public PathCounters getCounters(final String prefix) public PathCounters getCounters(final String prefix)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics;
import java.time.YearMonth; import java.time.YearMonth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.properties.MonthValues; import fr.devinsy.statoolinfos.properties.MonthValues;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -31,8 +28,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class Metric public class Metric
{ {
private static Logger logger = LoggerFactory.getLogger(Metric.class);
public enum Type public enum Type
{ {
MONTHS, MONTHS,
@ -51,6 +46,15 @@ public class Metric
/** /**
* Instantiates a new metric. * Instantiates a new metric.
*
* @param path
* the path
* @param name
* the name
* @param description
* the description
* @param startYear
* the start year
*/ */
public Metric(final String path, final String name, final String description, final String startYear) public Metric(final String path, final String name, final String description, final String startYear)
{ {
@ -64,36 +68,81 @@ public class Metric
this.dayValues = new StringList(); this.dayValues = new StringList();
} }
/**
* Gets the day values.
*
* @return the day values
*/
public StringList getDayValues() public StringList getDayValues()
{ {
return this.dayValues; return this.dayValues;
} }
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() public String getDescription()
{ {
return this.description; return this.description;
} }
/**
* Gets the month values.
*
* @return the month values
*/
public StringList getMonthValues() public StringList getMonthValues()
{ {
return this.monthValues; return this.monthValues;
} }
/**
* Gets the name.
*
* @return the name
*/
public String getName() public String getName()
{ {
return this.name; return this.name;
} }
/**
* Gets the path.
*
* @return the path
*/
public String getPath()
{
return this.path;
}
/**
* Gets the start year.
*
* @return the start year
*/
public String getStartYear() public String getStartYear()
{ {
return this.startYear; return this.startYear;
} }
/**
* Gets the week values.
*
* @return the week values
*/
public StringList getWeekValues() public StringList getWeekValues()
{ {
return this.weekValues; return this.weekValues;
} }
/**
* Gets the year values.
*
* @return the year values
*/
public StringList getYearValues() public StringList getYearValues()
{ {
return this.yearValues; return this.yearValues;
@ -121,16 +170,34 @@ public class Metric
return result; return result;
} }
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(final String description) public void setDescription(final String description)
{ {
this.description = description; this.description = description;
} }
/**
* Sets the name.
*
* @param name
* the new name
*/
public void setName(final String name) public void setName(final String name)
{ {
this.name = name; this.name = name;
} }
/**
* Sets the start year.
*
* @param startYear
* the new start year
*/
public void setStartYear(final String startYear) public void setStartYear(final String startYear)
{ {
this.startYear = startYear; this.startYear = startYear;

View file

@ -18,16 +18,11 @@
*/ */
package fr.devinsy.statoolinfos.metrics; package fr.devinsy.statoolinfos.metrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class PathCounter. * The Class PathCounter.
*/ */
public class PathCounter public class PathCounter
{ {
private static Logger logger = LoggerFactory.getLogger(PathCounter.class);
private String path; private String path;
private String timeMark; private String timeMark;
private long counter; private long counter;

View file

@ -42,7 +42,6 @@ import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.core.StatoolInfosUtils; import fr.devinsy.statoolinfos.core.StatoolInfosUtils;
import fr.devinsy.statoolinfos.metrics.etherpad.EtherpadProber; import fr.devinsy.statoolinfos.metrics.etherpad.EtherpadProber;
import fr.devinsy.statoolinfos.metrics.gitea.GiteaProber; import fr.devinsy.statoolinfos.metrics.gitea.GiteaProber;
import fr.devinsy.statoolinfos.metrics.gsl.GSLProber;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogAnalyzer; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogAnalyzer;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogs; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogs;
import fr.devinsy.statoolinfos.metrics.httperrorlog.HttpErrorLogAnalyzer; import fr.devinsy.statoolinfos.metrics.httperrorlog.HttpErrorLogAnalyzer;
@ -313,32 +312,6 @@ public class Prober
return result; return result;
} }
/**
* Probe GSL.
*
* @param configuration
* the configuration
* @return the path counters
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws StatoolInfosException
* the statool infos exception
*/
public static PathCounters probeGSL(final Configuration configuration) throws IOException, StatoolInfosException
{
PathCounters result;
logger.info("== Probing GSL.");
File statsFile = configuration.getAsFile("conf.probe.gsl.stats");
logger.info("statsfile=[{}]", statsFile);
result = GSLProber.probe(statsFile);
//
return result;
}
/** /**
* Probe htt access log. * Probe htt access log.
* *

View file

@ -18,16 +18,11 @@
*/ */
package fr.devinsy.statoolinfos.metrics; package fr.devinsy.statoolinfos.metrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class StringCounter. * The Class StringCounter.
*/ */
public class StringCounter public class StringCounter
{ {
private static Logger logger = LoggerFactory.getLogger(StringCounter.class);
private String string; private String string;
private long counter; private long counter;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -25,16 +25,11 @@ import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class TimeMark. * The Class TimeMark.
*/ */
public class TimeMark public class TimeMark
{ {
private static Logger logger = LoggerFactory.getLogger(TimeMark.class);
private String value; private String value;
/** /**

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2022-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -26,8 +26,6 @@ import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.threeten.extra.YearWeek; import org.threeten.extra.YearWeek;
/** /**
@ -35,8 +33,6 @@ import org.threeten.extra.YearWeek;
*/ */
public class TimeMarkUtils public class TimeMarkUtils
{ {
private static Logger logger = LoggerFactory.getLogger(TimeMarkUtils.class);
public static final Pattern YEAR_PATTERN = Pattern.compile("^(?<year>\\d{4})$"); public static final Pattern YEAR_PATTERN = Pattern.compile("^(?<year>\\d{4})$");
public static final Pattern YEAR_MONTH_PATTERN = Pattern.compile("^(?<year>\\d{4})-(?<month>\\d{2})$"); public static final Pattern YEAR_MONTH_PATTERN = Pattern.compile("^(?<year>\\d{4})-(?<month>\\d{2})$");
public static final Pattern YEAR_WEEK_PATTERN = Pattern.compile("^(?<year>\\d{4})-W(?<week>\\d{2})$"); public static final Pattern YEAR_WEEK_PATTERN = Pattern.compile("^(?<year>\\d{4})-W(?<week>\\d{2})$");

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.etherpad;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters; import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -35,8 +32,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogs;
*/ */
public class EtherpadHttpLogAnalyzer public class EtherpadHttpLogAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(EtherpadHttpLogAnalyzer.class);
public static final Pattern USE_PATTERN = Pattern.compile("^GET /p/\\S+ .*$"); public static final Pattern USE_PATTERN = Pattern.compile("^GET /p/\\S+ .*$");
private PathCounters counters; private PathCounters counters;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2022-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -22,9 +22,6 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMark; import fr.devinsy.statoolinfos.metrics.TimeMark;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -34,8 +31,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class EtherpadLog public class EtherpadLog
{ {
private static Logger logger = LoggerFactory.getLogger(EtherpadLog.class);
private LocalDateTime time; private LocalDateTime time;
private String level; private String level;
private String type; private String type;
@ -58,6 +53,11 @@ public class EtherpadLog
this.author = null; this.author = null;
} }
/**
* Gets the author.
*
* @return the author
*/
public String getAuthor() public String getAuthor()
{ {
return this.author; return this.author;
@ -78,26 +78,51 @@ public class EtherpadLog
return result; return result;
} }
/**
* Gets the event.
*
* @return the event
*/
public String getEvent() public String getEvent()
{ {
return this.event; return this.event;
} }
/**
* Gets the ip.
*
* @return the ip
*/
public String getIp() public String getIp()
{ {
return this.ip; return this.ip;
} }
/**
* Gets the level.
*
* @return the level
*/
public String getLevel() public String getLevel()
{ {
return this.level; return this.level;
} }
/**
* Gets the padname.
*
* @return the padname
*/
public String getPadname() public String getPadname()
{ {
return this.padname; return this.padname;
} }
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime() public LocalDateTime getTime()
{ {
return this.time; return this.time;
@ -128,6 +153,11 @@ public class EtherpadLog
return result; return result;
} }
/**
* Gets the type.
*
* @return the type
*/
public String getType() public String getType()
{ {
return this.type; return this.type;
@ -240,36 +270,78 @@ public class EtherpadLog
return result; return result;
} }
/**
* Sets the author.
*
* @param author
* the new author
*/
public void setAuthor(final String author) public void setAuthor(final String author)
{ {
this.author = author; this.author = author;
} }
/**
* Sets the event.
*
* @param event
* the new event
*/
public void setEvent(final String event) public void setEvent(final String event)
{ {
this.event = event; this.event = event;
} }
/**
* Sets the ip.
*
* @param ip
* the new ip
*/
public void setIp(final String ip) public void setIp(final String ip)
{ {
this.ip = ip; this.ip = ip;
} }
/**
* Sets the level.
*
* @param level
* the new level
*/
public void setLevel(final String level) public void setLevel(final String level)
{ {
this.level = level; this.level = level;
} }
/**
* Sets the padname.
*
* @param padname
* the new padname
*/
public void setPadname(final String padname) public void setPadname(final String padname)
{ {
this.padname = padname; this.padname = padname;
} }
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final LocalDateTime time) public void setTime(final LocalDateTime time)
{ {
this.time = time; this.time = time;
} }
/**
* Sets the type.
*
* @param type
* the new type
*/
public void setType(final String type) public void setType(final String type)
{ {
this.type = type; this.type = type;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2022-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -31,16 +31,12 @@ import org.json.simple.JSONArray;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser; import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException; import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class GiteaAPI. * The Class GiteaAPI.
*/ */
public class GiteaAPI public class GiteaAPI
{ {
private static Logger logger = LoggerFactory.getLogger(GiteaAPI.class);
private String url; private String url;
private String token; private String token;
private JSONArray users; private JSONArray users;
@ -49,6 +45,15 @@ public class GiteaAPI
/** /**
* Instantiates a new gitea API. * Instantiates a new gitea API.
*
* @param url
* the url
* @param token
* the token
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws ParseException
* the parse exception
*/ */
public GiteaAPI(final String url, final String token) throws IOException, ParseException public GiteaAPI(final String url, final String token) throws IOException, ParseException
{ {
@ -58,15 +63,15 @@ public class GiteaAPI
this.token = token; this.token = token;
// //
String json = IOUtils.toString(new URL(this.url + "/api/v1/admin/users?limit=100000&token=" + token), Charset.defaultCharset()); String json = IOUtils.toString(new URL(this.url + "/api/v1/admin/users?limit=100000&token=" + this.token), Charset.defaultCharset());
this.users = (JSONArray) (new JSONParser().parse(json)); this.users = (JSONArray) (new JSONParser().parse(json));
// //
json = IOUtils.toString(new URL(this.url + "/api/v1/admin/orgs?limit=100000&token=" + token), Charset.defaultCharset()); json = IOUtils.toString(new URL(this.url + "/api/v1/admin/orgs?limit=100000&token=" + this.token), Charset.defaultCharset());
this.organizations = (JSONArray) (new JSONParser().parse(json)); this.organizations = (JSONArray) (new JSONParser().parse(json));
// //
json = IOUtils.toString(new URL(this.url + "/api/v1/repos/search?limit=100000&token=" + token), Charset.defaultCharset()); json = IOUtils.toString(new URL(this.url + "/api/v1/repos/search?limit=100000&token=" + this.token), Charset.defaultCharset());
this.repositories = (JSONArray) ((JSONObject) (new JSONParser().parse(json))).get("data"); this.repositories = (JSONArray) ((JSONObject) (new JSONParser().parse(json))).get("data");
} }
catch (IOException exception) catch (IOException exception)

View file

@ -1,165 +0,0 @@
/*
* Copyright (C) 2022 Christian Pierre MOMON <christian@momon.org>
*
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.devinsy.statoolinfos.metrics.gsl;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.strings.StringList;
/**
* The Class GSLProber.
*/
public class GSLProber
{
private static Logger logger = LoggerFactory.getLogger(GSLProber.class);
/**
* Instantiates a new GSL prober.
*/
private GSLProber()
{
}
/**
* Probe.
*
* @param statsFile
* the stats file
* @return the path counters
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws StatoolInfosException
* the statool infos exception
*/
public static PathCounters probe(final File statsFile) throws IOException, StatoolInfosException
{
PathCounters result;
result = new PathCounters();
//
Properties properties = new Properties();
properties.load(new FileReader(statsFile));
StringList timemarks = result.getNowTimeMarks();
// metrics.gsl.articles =
String value = properties.getProperty("gsl.articles");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.articles", timemarks);
}
// metrics.gsl.articles.pages=
value = properties.getProperty("gsl.articles.pages");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.articles.pages", timemarks);
}
// metrics.gsl.articles.posts=
value = properties.getProperty("gsl.articles.posts");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.articles.posts", timemarks);
}
// metrics.gsl.authors =
value = properties.getProperty("gsl.authors");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.authors", timemarks);
}
// gsl.articles.tags
value = properties.getProperty("gsl.tags");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.tags", timemarks);
}
// gsl.articles.words
value = properties.getProperty("gsl.words");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.words", timemarks);
}
// gsl.articles.quotes
value = properties.getProperty("gsl.quotes");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.quotes", timemarks);
}
// gsl.articles.paragraphs
value = properties.getProperty("gsl.paragraphs");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.paragraphs", timemarks);
}
// gsl.articles.links
value = properties.getProperty("gsl.links");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.links", timemarks);
}
// gsl.articles.links.online
value = properties.getProperty("gsl.online");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.online", timemarks);
}
// gsl.articles.lists
value = properties.getProperty("gsl.lists");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.lists", timemarks);
}
// gsl.articles.lists.items
value = properties.getProperty("gsl.items");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.items", timemarks);
}
// gsl_articles.images
value = properties.getProperty("gsl.images");
if (NumberUtils.isDigits(value))
{
result.set(Long.valueOf(value), "metrics.gsl.authors", timemarks);
}
//
return result;
}
}

View file

@ -25,9 +25,6 @@ import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -37,8 +34,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class HttpAccessLog public class HttpAccessLog
{ {
private static Logger logger = LoggerFactory.getLogger(HttpAccessLog.class);
public static final Pattern ASSET_PATTERN = Pattern.compile("^.*\\.(avi|css|gif|ico|jpeg|jpg|js|mp3|mp4|ogg|png|svg|wav) HTTP.*$"); public static final Pattern ASSET_PATTERN = Pattern.compile("^.*\\.(avi|css|gif|ico|jpeg|jpg|js|mp3|mp4|ogg|png|svg|wav) HTTP.*$");
private String ip; private String ip;
@ -65,11 +60,21 @@ public class HttpAccessLog
this.userAgent = null; this.userAgent = null;
} }
/**
* Gets the body bytes sent.
*
* @return the body bytes sent
*/
public long getBodyBytesSent() public long getBodyBytesSent()
{ {
return this.bodyBytesSent; return this.bodyBytesSent;
} }
/**
* Gets the date.
*
* @return the date
*/
public String getDate() public String getDate()
{ {
String result; String result;
@ -80,6 +85,11 @@ public class HttpAccessLog
return result; return result;
} }
/**
* Gets the ip.
*
* @return the ip
*/
public String getIp() public String getIp()
{ {
return this.ip; return this.ip;
@ -115,31 +125,61 @@ public class HttpAccessLog
return result; return result;
} }
/**
* Gets the referer.
*
* @return the referer
*/
public String getReferer() public String getReferer()
{ {
return this.referer; return this.referer;
} }
/**
* Gets the remote user.
*
* @return the remote user
*/
public String getRemoteUser() public String getRemoteUser()
{ {
return this.remoteUser; return this.remoteUser;
} }
/**
* Gets the request.
*
* @return the request
*/
public String getRequest() public String getRequest()
{ {
return this.request; return this.request;
} }
/**
* Gets the status.
*
* @return the status
*/
public HttpStatus getStatus() public HttpStatus getStatus()
{ {
return this.status; return this.status;
} }
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime() public LocalDateTime getTime()
{ {
return this.time.toLocalDateTime(); return this.time.toLocalDateTime();
} }
/**
* Gets the user agent.
*
* @return the user agent
*/
public UserAgent getUserAgent() public UserAgent getUserAgent()
{ {
return this.userAgent; return this.userAgent;
@ -290,31 +330,67 @@ public class HttpAccessLog
return result; return result;
} }
/**
* Sets the body bytes sent.
*
* @param bodyBytesSent
* the new body bytes sent
*/
public void setBodyBytesSent(final long bodyBytesSent) public void setBodyBytesSent(final long bodyBytesSent)
{ {
this.bodyBytesSent = bodyBytesSent; this.bodyBytesSent = bodyBytesSent;
} }
/**
* Sets the ip.
*
* @param ip
* the new ip
*/
public void setIp(final String ip) public void setIp(final String ip)
{ {
this.ip = ip; this.ip = ip;
} }
/**
* Sets the referer.
*
* @param referer
* the new referer
*/
public void setReferer(final String referer) public void setReferer(final String referer)
{ {
this.referer = referer; this.referer = referer;
} }
/**
* Sets the remote user.
*
* @param remoteUser
* the new remote user
*/
public void setRemoteUser(final String remoteUser) public void setRemoteUser(final String remoteUser)
{ {
this.remoteUser = remoteUser; this.remoteUser = remoteUser;
} }
/**
* Sets the request.
*
* @param request
* the new request
*/
public void setRequest(final String request) public void setRequest(final String request)
{ {
this.request = request; this.request = request;
} }
/**
* Sets the status.
*
* @param status
* the new status
*/
public void setStatus(final HttpStatus status) public void setStatus(final HttpStatus status)
{ {
this.status = status; this.status = status;
@ -331,11 +407,23 @@ public class HttpAccessLog
this.time = ZonedDateTime.of(time, ZoneId.systemDefault()); this.time = ZonedDateTime.of(time, ZoneId.systemDefault());
} }
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final ZonedDateTime time) public void setTime(final ZonedDateTime time)
{ {
this.time = time; this.time = time;
} }
/**
* Sets the user agent.
*
* @param userAgent
* the new user agent
*/
public void setUserAgent(final UserAgent userAgent) public void setUserAgent(final UserAgent userAgent)
{ {
this.userAgent = userAgent; this.userAgent = userAgent;

View file

@ -23,8 +23,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.IpCounters; import fr.devinsy.statoolinfos.metrics.IpCounters;
@ -36,8 +34,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class HttpAccessLogAnalyzer public class HttpAccessLogAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(HttpAccessLogAnalyzer.class);
private int ignoredLineCount; private int ignoredLineCount;
private int errorCount; private int errorCount;
private PathCounters counters; private PathCounters counters;

View file

@ -18,7 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.metrics.httpaccess; package fr.devinsy.statoolinfos.metrics.httpaccess;
import java.time.LocalDateTime;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException; import java.time.format.DateTimeParseException;
@ -26,16 +25,11 @@ import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class HttpAccessLogParser. * The Class HttpAccessLogParser.
*/ */
public class HttpAccessLogParser public class HttpAccessLogParser
{ {
private static Logger logger = LoggerFactory.getLogger(HttpAccessLogParser.class);
// log_format combined '$remote_addr - $remote_user [$time_local] ' // log_format combined '$remote_addr - $remote_user [$time_local] '
// '"$request" $status $body_bytes_sent ' // '"$request" $status $body_bytes_sent '
// '"$http_referer" "$http_user_agent"'; // '"$http_referer" "$http_user_agent"';
@ -106,7 +100,11 @@ public class HttpAccessLogParser
* *
* @param line * @param line
* the line * the line
* @return the http log * @param pattern
* the pattern
* @param dateTimeFormatter
* the date time formatter
* @return the http access log
*/ */
public static HttpAccessLog parseLog(final String line, final Pattern pattern, final DateTimeFormatter dateTimeFormatter) public static HttpAccessLog parseLog(final String line, final Pattern pattern, final DateTimeFormatter dateTimeFormatter)
{ {
@ -115,9 +113,6 @@ public class HttpAccessLogParser
Matcher matcher = pattern.matcher(line); Matcher matcher = pattern.matcher(line);
if (matcher.matches()) if (matcher.matches())
{ {
ZonedDateTime a = ZonedDateTime.now();
LocalDateTime b = a.toLocalDateTime();
result = new HttpAccessLog(); result = new HttpAccessLog();
result.setIp(matcher.group("remoteAddress")); result.setIp(matcher.group("remoteAddress"));
result.setRemoteUser(matcher.group("remoteUser")); result.setRemoteUser(matcher.group("remoteUser"));

View file

@ -18,16 +18,11 @@
*/ */
package fr.devinsy.statoolinfos.metrics.httpaccess; package fr.devinsy.statoolinfos.metrics.httpaccess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class HttpAccesLogStat. * The Class HttpAccesLogStat.
*/ */
public class HttpAccessLogStat public class HttpAccessLogStat
{ {
private static Logger logger = LoggerFactory.getLogger(HttpAccessLogStat.class);
private int hitCount; private int hitCount;
private int hitIpv4Count; private int hitIpv4Count;
private int hitIpv6Count; private int hitIpv6Count;

View file

@ -22,9 +22,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.util.Files; import fr.devinsy.statoolinfos.util.Files;
/** /**
@ -32,8 +29,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/ */
public class HttpAccessLogs implements Iterable<HttpAccessLog> public class HttpAccessLogs implements Iterable<HttpAccessLog>
{ {
private static Logger logger = LoggerFactory.getLogger(HttpAccessLogs.class);
private Files source; private Files source;
private String pattern; private String pattern;
private String datePattern; private String datePattern;
@ -98,10 +93,12 @@ public class HttpAccessLogs implements Iterable<HttpAccessLog>
} }
/** /**
* Instantiates a new http log iterator. * Instantiates a new http access logs.
* *
* @param source * @param source
* the source * the source
* @param pattern
* the pattern
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
@ -117,6 +114,8 @@ public class HttpAccessLogs implements Iterable<HttpAccessLog>
* the source * the source
* @param pattern * @param pattern
* the pattern * the pattern
* @param datePattern
* the date pattern
* @param pathFilter * @param pathFilter
* the path filter * the path filter
* @throws IOException * @throws IOException

View file

@ -18,16 +18,11 @@
*/ */
package fr.devinsy.statoolinfos.metrics.httpaccess; package fr.devinsy.statoolinfos.metrics.httpaccess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class HttpStatus. * The Class HttpStatus.
*/ */
public class HttpStatus public class HttpStatus
{ {
private static Logger logger = LoggerFactory.getLogger(HttpStatus.class);
private int code; private int code;
private String message; private String message;
private String description; private String description;
@ -35,6 +30,13 @@ public class HttpStatus
/** /**
* Instantiates a new http status. * Instantiates a new http status.
*
* @param code
* the code
* @param message
* the message
* @param description
* the description
*/ */
public HttpStatus(final int code, final String message, final String description) public HttpStatus(final int code, final String message, final String description)
{ {
@ -44,41 +46,85 @@ public class HttpStatus
this.category = HttpStatusCategory.of(code); this.category = HttpStatusCategory.of(code);
} }
/**
* Gets the category.
*
* @return the category
*/
public HttpStatusCategory getCategory() public HttpStatusCategory getCategory()
{ {
return this.category; return this.category;
} }
/**
* Gets the code.
*
* @return the code
*/
public int getCode() public int getCode()
{ {
return this.code; return this.code;
} }
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() public String getDescription()
{ {
return this.description; return this.description;
} }
/**
* Gets the message.
*
* @return the message
*/
public String getMessage() public String getMessage()
{ {
return this.message; return this.message;
} }
/**
* Sets the category.
*
* @param category
* the new category
*/
public void setCategory(final HttpStatusCategory category) public void setCategory(final HttpStatusCategory category)
{ {
this.category = category; this.category = category;
} }
/**
* Sets the code.
*
* @param code
* the new code
*/
public void setCode(final int code) public void setCode(final int code)
{ {
this.code = code; this.code = code;
} }
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(final String description) public void setDescription(final String description)
{ {
this.description = description; this.description = description;
} }
/**
* Sets the message.
*
* @param message
* the new message
*/
public void setMessage(final String message) public void setMessage(final String message)
{ {
this.message = message; this.message = message;

View file

@ -30,6 +30,13 @@ public enum HttpStatusCategory
SERVER_ERROR, SERVER_ERROR,
INVALID; INVALID;
/**
* Checks if is client error.
*
* @param httpCode
* the http code
* @return true, if is client error
*/
public static boolean isClientError(final int httpCode) public static boolean isClientError(final int httpCode)
{ {
boolean result; boolean result;
@ -43,6 +50,8 @@ public enum HttpStatusCategory
/** /**
* Checks if is informational. * Checks if is informational.
* *
* @param httpCode
* the http code
* @return true, if is informational * @return true, if is informational
*/ */
public static boolean isInformational(final int httpCode) public static boolean isInformational(final int httpCode)
@ -55,6 +64,13 @@ public enum HttpStatusCategory
return result; return result;
} }
/**
* Checks if is redirection.
*
* @param httpCode
* the http code
* @return true, if is redirection
*/
public static boolean isRedirection(final int httpCode) public static boolean isRedirection(final int httpCode)
{ {
boolean result; boolean result;
@ -65,6 +81,13 @@ public enum HttpStatusCategory
return result; return result;
} }
/**
* Checks if is server error.
*
* @param httpCode
* the http code
* @return true, if is server error
*/
public static boolean isServerError(final int httpCode) public static boolean isServerError(final int httpCode)
{ {
boolean result; boolean result;

View file

@ -21,23 +21,18 @@ package fr.devinsy.statoolinfos.metrics.httpaccess;
import java.util.HashMap; import java.util.HashMap;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class HttpStatusTable. * The Class HttpStatusTable.
*/ */
public class HttpStatusTable public class HttpStatusTable
{ {
public static final Pattern HTTP_CODE_PATTERN = Pattern.compile("\\d{3}");
private static class SingletonHolder private static class SingletonHolder
{ {
private static final HttpStatusTable instance = new HttpStatusTable(); private static final HttpStatusTable instance = new HttpStatusTable();
} }
private static Logger logger = LoggerFactory.getLogger(HttpStatusTable.class);
public static final Pattern HTTP_CODE_PATTERN = Pattern.compile("\\d{3}");
private HashMap<Integer, HttpStatus> codes; private HashMap<Integer, HttpStatus> codes;
/** /**

View file

@ -19,8 +19,6 @@
package fr.devinsy.statoolinfos.metrics.httpaccess; package fr.devinsy.statoolinfos.metrics.httpaccess;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils; import fr.devinsy.strings.StringsUtils;
@ -30,8 +28,6 @@ import fr.devinsy.strings.StringsUtils;
*/ */
public class UserAgent public class UserAgent
{ {
private static Logger logger = LoggerFactory.getLogger(UserAgent.class);
private String source; private String source;
/** /**

View file

@ -21,8 +21,6 @@ package fr.devinsy.statoolinfos.metrics.httpaccess;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils; import fr.devinsy.strings.StringsUtils;
@ -32,8 +30,6 @@ import fr.devinsy.strings.StringsUtils;
*/ */
public class UserAgentBotDetector public class UserAgentBotDetector
{ {
private static Logger logger = LoggerFactory.getLogger(UserAgentBotDetector.class);
private static final StringList startList = new StringList(); private static final StringList startList = new StringList();
private static final StringList containList = new StringList(); private static final StringList containList = new StringList();

View file

@ -23,17 +23,13 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.YearMonth; import java.time.YearMonth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.threeten.extra.YearWeek; import org.threeten.extra.YearWeek;
/** /**
* The Class PathCounter. * The Class Visit.
*/ */
public class Visit public class Visit
{ {
private static Logger logger = LoggerFactory.getLogger(Visit.class);
private LocalDateTime start; private LocalDateTime start;
private LocalDateTime end; private LocalDateTime end;

View file

@ -22,9 +22,6 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -39,8 +36,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class HttpErrorLog public class HttpErrorLog
{ {
private static Logger logger = LoggerFactory.getLogger(HttpErrorLog.class);
private LocalDateTime time; private LocalDateTime time;
private String level; private String level;
private String message; private String message;
@ -54,6 +49,11 @@ public class HttpErrorLog
this.level = null; this.level = null;
} }
/**
* Gets the date.
*
* @return the date
*/
public String getDate() public String getDate()
{ {
String result; String result;
@ -64,16 +64,31 @@ public class HttpErrorLog
return result; return result;
} }
/**
* Gets the level.
*
* @return the level
*/
public String getLevel() public String getLevel()
{ {
return this.level; return this.level;
} }
/**
* Gets the message.
*
* @return the message
*/
public String getMessage() public String getMessage()
{ {
return this.message; return this.message;
} }
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime() public LocalDateTime getTime()
{ {
return this.time; return this.time;
@ -142,16 +157,34 @@ public class HttpErrorLog
return result; return result;
} }
/**
* Sets the level.
*
* @param level
* the new level
*/
public void setLevel(final String level) public void setLevel(final String level)
{ {
this.level = level; this.level = level;
} }
/**
* Sets the message.
*
* @param message
* the new message
*/
public void setMessage(final String message) public void setMessage(final String message)
{ {
this.message = message; this.message = message;
} }
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final LocalDateTime time) public void setTime(final LocalDateTime time)
{ {
this.time = time; this.time = time;

View file

@ -21,8 +21,6 @@ package fr.devinsy.statoolinfos.metrics.httperrorlog;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -33,8 +31,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class HttpErrorLogAnalyzer public class HttpErrorLogAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(HttpErrorLogAnalyzer.class);
private PathCounters counters; private PathCounters counters;
/** /**

View file

@ -254,6 +254,7 @@ public class HttpErrorLogIterator implements Iterator<HttpErrorLog>
* the files * the files
* @return true, if is apache http error log files * @return true, if is apache http error log files
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static boolean isApacheHttpErrorLogFiles(final Files files) throws IOException public static boolean isApacheHttpErrorLogFiles(final Files files) throws IOException
{ {

View file

@ -25,16 +25,11 @@ import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class HttpErrorLogParser. * The Class HttpErrorLogParser.
*/ */
public class HttpErrorLogParser public class HttpErrorLogParser
{ {
private static Logger logger = LoggerFactory.getLogger(HttpErrorLogParser.class);
public static final Pattern APACHE_ERROR_PATTERN = Pattern.compile("^\\[(?<time>[^\\]]+)\\]\\s\\[(?<level>[^\\]]*)\\]\\s(?<message>.*)$"); public static final Pattern APACHE_ERROR_PATTERN = Pattern.compile("^\\[(?<time>[^\\]]+)\\]\\s\\[(?<level>[^\\]]*)\\]\\s(?<message>.*)$");
public static final Pattern NGINX_ERROR_PATTERN = Pattern.compile("^(?<time>\\S+\\s\\S+)\\s\\[(?<level>[^\\]]*)\\]\\s(?<message>.*)$"); public static final Pattern NGINX_ERROR_PATTERN = Pattern.compile("^(?<time>\\S+\\s\\S+)\\s\\[(?<level>[^\\]]*)\\]\\s(?<message>.*)$");
@ -79,7 +74,11 @@ public class HttpErrorLogParser
* *
* @param line * @param line
* the line * the line
* @return the http log * @param pattern
* the pattern
* @param dateTimeFormatter
* the date time formatter
* @return the http error log
*/ */
public static HttpErrorLog parseLog(final String line, final Pattern pattern, final DateTimeFormatter dateTimeFormatter) public static HttpErrorLog parseLog(final String line, final Pattern pattern, final DateTimeFormatter dateTimeFormatter)
{ {

View file

@ -22,9 +22,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.util.Files; import fr.devinsy.statoolinfos.util.Files;
/** /**
@ -32,8 +29,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/ */
public class HttpErrorLogs implements Iterable<HttpErrorLog> public class HttpErrorLogs implements Iterable<HttpErrorLog>
{ {
private static Logger logger = LoggerFactory.getLogger(HttpErrorLogs.class);
private Files source; private Files source;
private String pattern; private String pattern;
private String datePattern; private String datePattern;

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics.jitsi;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -31,8 +28,6 @@ import fr.devinsy.statoolinfos.metrics.PathCounters;
*/ */
public class JitsiProber public class JitsiProber
{ {
private static Logger logger = LoggerFactory.getLogger(JitsiProber.class);
/** /**
* Instantiates a new jitsi prober. * Instantiates a new jitsi prober.
*/ */

View file

@ -22,9 +22,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters; import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -37,8 +34,6 @@ import fr.devinsy.statoolinfos.metrics.util.DatafilesProber;
*/ */
public class LibreQRProber public class LibreQRProber
{ {
private static Logger logger = LoggerFactory.getLogger(LibreQRProber.class);
/** /**
* Instantiates a new privatebin prober. * Instantiates a new privatebin prober.
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -24,9 +24,6 @@ import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -35,9 +32,7 @@ import fr.devinsy.strings.StringList;
*/ */
public class MinetestLog public class MinetestLog
{ {
private static Logger logger = LoggerFactory.getLogger(MinetestLog.class); // Cpm [fc00:e0a:22:ce10::adc5:a] joins game. List of players: Cpm
// Cpm [2a01:e0a:22:ce10::adc5:a] joins game. List of players: Cpm
public static final Pattern JOIN_PATTERN = Pattern.compile("^(?<nickname>\\S+) \\[(?<ip>.+)\\] joins game\\..*$"); public static final Pattern JOIN_PATTERN = Pattern.compile("^(?<nickname>\\S+) \\[(?<ip>.+)\\] joins game\\..*$");
public static final Pattern NICK_PATTERN = Pattern public static final Pattern NICK_PATTERN = Pattern
.compile( .compile(
@ -59,6 +54,11 @@ public class MinetestLog
this.message = null; this.message = null;
} }
/**
* Gets the date.
*
* @return the date
*/
public String getDate() public String getDate()
{ {
String result; String result;
@ -92,16 +92,31 @@ public class MinetestLog
return result; return result;
} }
/**
* Gets the level.
*
* @return the level
*/
public MinetestLogLevel getLevel() public MinetestLogLevel getLevel()
{ {
return this.level; return this.level;
} }
/**
* Gets the message.
*
* @return the message
*/
public String getMessage() public String getMessage()
{ {
return this.message; return this.message;
} }
/**
* Gets the module.
*
* @return the module
*/
public String getModule() public String getModule()
{ {
return this.module; return this.module;
@ -138,6 +153,11 @@ public class MinetestLog
return result; return result;
} }
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime() public LocalDateTime getTime()
{ {
return this.time; return this.time;
@ -206,21 +226,45 @@ public class MinetestLog
return result; return result;
} }
/**
* Sets the level.
*
* @param level
* the new level
*/
public void setLevel(final MinetestLogLevel level) public void setLevel(final MinetestLogLevel level)
{ {
this.level = level; this.level = level;
} }
/**
* Sets the message.
*
* @param message
* the new message
*/
public void setMessage(final String message) public void setMessage(final String message)
{ {
this.message = message; this.message = message;
} }
/**
* Sets the module.
*
* @param module
* the new module
*/
public void setModule(final String module) public void setModule(final String module)
{ {
this.module = module; this.module = module;
} }
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final LocalDateTime time) public void setTime(final LocalDateTime time)
{ {
this.time = time; this.time = time;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2023 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -92,6 +92,16 @@ public class MinetestLogAnalyzer
return result; return result;
} }
/**
* Gets the error count.
*
* @return the error count
*/
public int getErrorCount()
{
return this.errorCount;
}
/** /**
* Probe. * Probe.
* *
@ -261,6 +271,7 @@ public class MinetestLogAnalyzer
* *
* @param source * @param source
* the source * the source
* @return the path counters
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
* @throws StatoolInfosException * @throws StatoolInfosException

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics.mumble;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -31,8 +28,6 @@ import fr.devinsy.statoolinfos.metrics.PathCounters;
*/ */
public class MumbleDatabaseAnalyzer public class MumbleDatabaseAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(MumbleDatabaseAnalyzer.class);
/** /**
* Instantiates a new http access log prober. * Instantiates a new http access log prober.
*/ */

View file

@ -24,9 +24,6 @@ import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -35,8 +32,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class MumbleLog public class MumbleLog
{ {
private static Logger logger = LoggerFactory.getLogger(MumbleLog.class);
// 1 => <8:neox(-1)> Authenticated // 1 => <8:neox(-1)> Authenticated
public static final Pattern NICK_PATTERN = Pattern.compile("^\\d+ => <\\d+:(?<nick>\\S+)\\(-?\\d+\\)> Authenticated$"); public static final Pattern NICK_PATTERN = Pattern.compile("^\\d+ => <\\d+:(?<nick>\\S+)\\(-?\\d+\\)> Authenticated$");

View file

@ -98,6 +98,16 @@ public class MumbleLogAnalyzer
return result; return result;
} }
/**
* Gets the error count.
*
* @return the error count
*/
public int getErrorCount()
{
return this.errorCount;
}
/** /**
* Probe. * Probe.
* *

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics.mumble;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -31,8 +28,6 @@ import fr.devinsy.statoolinfos.metrics.PathCounters;
*/ */
public class MumbleProber public class MumbleProber
{ {
private static Logger logger = LoggerFactory.getLogger(MumbleProber.class);
/** /**
* Instantiates a new minetest prober. * Instantiates a new minetest prober.
*/ */

View file

@ -23,8 +23,6 @@ import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -37,8 +35,6 @@ import fr.devinsy.statoolinfos.util.FilesUtils;
*/ */
public class NextcloudDataAnalyzer public class NextcloudDataAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(NextcloudDataAnalyzer.class);
/** /**
* Instantiates a new http access log prober. * Instantiates a new http access log prober.
*/ */

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.nextcloud;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters; import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -36,8 +33,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/ */
public class NextcloudHttpLogAnalyzer public class NextcloudHttpLogAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(NextcloudHttpLogAnalyzer.class);
public static final Pattern USE_PATTERN = Pattern.compile("GET /temp/\\w+\\.png.*"); public static final Pattern USE_PATTERN = Pattern.compile("GET /temp/\\w+\\.png.*");
public static final Pattern CREATE_PATTERN = Pattern.compile("POST / .*"); public static final Pattern CREATE_PATTERN = Pattern.compile("POST / .*");

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.nextcloud;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.util.FilesUtils; import fr.devinsy.statoolinfos.util.FilesUtils;
@ -33,8 +30,6 @@ import fr.devinsy.statoolinfos.util.FilesUtils;
*/ */
public class NextcloudProber public class NextcloudProber
{ {
private static Logger logger = LoggerFactory.getLogger(NextcloudProber.class);
/** /**
* Instantiates a new nextcloud prober. * Instantiates a new nextcloud prober.
*/ */

View file

@ -22,9 +22,6 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
/** /**
@ -32,8 +29,6 @@ import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
*/ */
public class PrivatebinPatchLog public class PrivatebinPatchLog
{ {
private static Logger logger = LoggerFactory.getLogger(PrivatebinPatchLog.class);
private LocalDateTime time; private LocalDateTime time;
private PrivatebinLogAction action; private PrivatebinLogAction action;
private String id; private String id;

View file

@ -22,8 +22,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounter; import fr.devinsy.statoolinfos.metrics.PathCounter;
@ -39,8 +37,6 @@ import fr.devinsy.statoolinfos.util.FilesUtils;
*/ */
public class PrivatebinProber public class PrivatebinProber
{ {
private static Logger logger = LoggerFactory.getLogger(PrivatebinProber.class);
/** /**
* Instantiates a new privatebin prober. * Instantiates a new privatebin prober.
*/ */

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics.util;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.util.sql.SQLDatabase; import fr.devinsy.statoolinfos.util.sql.SQLDatabase;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -32,8 +29,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class DatabaseProber public class DatabaseProber
{ {
private static Logger logger = LoggerFactory.getLogger(DatabaseProber.class);
/** /**
* Instantiates a new database prober. * Instantiates a new database prober.
*/ */

View file

@ -22,8 +22,6 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.util.FilesUtils; import fr.devinsy.statoolinfos.util.FilesUtils;
@ -34,8 +32,6 @@ import fr.devinsy.strings.StringList;
*/ */
public class DatafilesProber public class DatafilesProber
{ {
private static Logger logger = LoggerFactory.getLogger(DatafilesProber.class);
/** /**
* Instantiates a new datafiles prober. * Instantiates a new datafiles prober.
*/ */

View file

@ -23,8 +23,6 @@ import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -36,8 +34,6 @@ import fr.devinsy.statoolinfos.metrics.TimeMark;
*/ */
public class XmppDataAnalyzer public class XmppDataAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(XmppDataAnalyzer.class);
/** /**
* Instantiates a new http access log prober. * Instantiates a new http access log prober.
*/ */

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.xmpp;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters; import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -36,8 +33,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/ */
public class XmppHttpLogAnalyzer public class XmppHttpLogAnalyzer
{ {
private static Logger logger = LoggerFactory.getLogger(XmppHttpLogAnalyzer.class);
public static final Pattern USE_PATTERN = Pattern.compile("GET /temp/\\w+\\.png.*"); public static final Pattern USE_PATTERN = Pattern.compile("GET /temp/\\w+\\.png.*");
public static final Pattern CREATE_PATTERN = Pattern.compile("POST / .*"); public static final Pattern CREATE_PATTERN = Pattern.compile("POST / .*");

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.xmpp;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.util.FilesUtils; import fr.devinsy.statoolinfos.util.FilesUtils;
@ -33,8 +30,6 @@ import fr.devinsy.statoolinfos.util.FilesUtils;
*/ */
public class XmppProber public class XmppProber
{ {
private static Logger logger = LoggerFactory.getLogger(XmppProber.class);
/** /**
* Instantiates a new xmpp prober. * Instantiates a new xmpp prober.
*/ */

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.properties;
import java.util.Hashtable; import java.util.Hashtable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringSet; import fr.devinsy.strings.StringSet;
@ -31,8 +28,6 @@ import fr.devinsy.strings.StringSet;
*/ */
public class MetricDirectory public class MetricDirectory
{ {
private static final Logger logger = LoggerFactory.getLogger(MetricDirectory.class);
private Hashtable<String, String> data; private Hashtable<String, String> data;
/** /**

View file

@ -18,13 +18,12 @@
*/ */
package fr.devinsy.statoolinfos.properties; package fr.devinsy.statoolinfos.properties;
import org.apache.commons.lang3.StringUtils;
import fr.devinsy.statoolinfos.core.Category; import fr.devinsy.statoolinfos.core.Category;
/** /**
* The Class PathPropertySpecs. * The Class PathPropertySpecs.
*/ */
@SuppressWarnings("all")
public class MetricSpecs public class MetricSpecs
{ {
public enum Type public enum Type

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -127,11 +127,21 @@ public class MonthValues extends HashMap<YearMonth, Double>
return result; return result;
} }
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() public String getDescription()
{ {
return this.description; return this.description;
} }
/**
* Gets the label.
*
* @return the label
*/
public String getLabel() public String getLabel()
{ {
return this.label; return this.label;
@ -233,7 +243,6 @@ public class MonthValues extends HashMap<YearMonth, Double>
{ {
YearMonth result; YearMonth result;
YearMonth endTarget;
if (end == null) if (end == null)
{ {
result = YearMonth.now(); result = YearMonth.now();
@ -271,11 +280,23 @@ public class MonthValues extends HashMap<YearMonth, Double>
return result; return result;
} }
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(final String description) public void setDescription(final String description)
{ {
this.description = description; this.description = description;
} }
/**
* Sets the label.
*
* @param label
* the new label
*/
public void setLabel(final String label) public void setLabel(final String label)
{ {
this.label = label; this.label = label;

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.properties; package fr.devinsy.statoolinfos.properties;
@ -20,6 +35,12 @@ public class PathPropertyComparator implements Comparator<PathProperty>
private Sorting sorting; private Sorting sorting;
/**
* Instantiates a new path property comparator.
*
* @param sorting
* the sorting
*/
public PathPropertyComparator(final Sorting sorting) public PathPropertyComparator(final Sorting sorting)
{ {
// //

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.properties;
import java.util.Hashtable; import java.util.Hashtable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringSet; import fr.devinsy.strings.StringSet;
@ -31,8 +28,6 @@ import fr.devinsy.strings.StringSet;
*/ */
public class PathPropertySet public class PathPropertySet
{ {
private static final Logger logger = LoggerFactory.getLogger(PathPropertySet.class);
private Hashtable<String, String> data; private Hashtable<String, String> data;
/** /**

View file

@ -32,8 +32,6 @@ import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils; import fr.devinsy.strings.StringsUtils;
@ -43,8 +41,6 @@ import fr.devinsy.strings.StringsUtils;
*/ */
public class PathPropertyUtils public class PathPropertyUtils
{ {
private static final Logger logger = LoggerFactory.getLogger(PathPropertyUtils.class);
/** /**
* Checks if is property line. * Checks if is property line.
* *

View file

@ -242,7 +242,6 @@ public class YearValues extends HashMap<Year, Double>
{ {
Year result; Year result;
Year endTarget;
if (end == null) if (end == null)
{ {
result = Year.now(); result = Year.now();

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.stats.categories; package fr.devinsy.statoolinfos.stats.categories;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -18,16 +18,11 @@
*/ */
package fr.devinsy.statoolinfos.stats.ip; package fr.devinsy.statoolinfos.stats.ip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class IpStat. * The Class IpStat.
*/ */
public final class IpStat public final class IpStat
{ {
private static Logger logger = LoggerFactory.getLogger(IpStat.class);
private String value; private String value;
private long count; private long count;
@ -43,16 +38,29 @@ public final class IpStat
this.count = 0; this.count = 0;
} }
/**
* Gets the count.
*
* @return the count
*/
public long getCount() public long getCount()
{ {
return this.count; return this.count;
} }
/**
* Gets the value.
*
* @return the value
*/
public String getValue() public String getValue()
{ {
return this.value; return this.value;
} }
/**
* Inc.
*/
public void inc() public void inc()
{ {
this.count += 1; this.count += 1;

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.stats.ip; package fr.devinsy.statoolinfos.stats.ip;

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.stats.ip;
import java.util.HashMap; import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class IpStatSet. * The Class IpStatSet.
*/ */
@ -30,8 +27,6 @@ public final class IpStatSet extends HashMap<String, IpStat>
{ {
private static final long serialVersionUID = -8411746796941831991L; private static final long serialVersionUID = -8411746796941831991L;
private static Logger logger = LoggerFactory.getLogger(IpStatSet.class);
/** /**
* Instantiates a new ip stats. * Instantiates a new ip stats.
*/ */

View file

@ -18,9 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.stats.ip; package fr.devinsy.statoolinfos.stats.ip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
/** /**
@ -28,8 +25,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
*/ */
public final class IpStator public final class IpStator
{ {
private static Logger logger = LoggerFactory.getLogger(IpStator.class);
private long logCount; private long logCount;
private IpStatSet ips; private IpStatSet ips;
@ -42,6 +37,11 @@ public final class IpStator
this.ips = new IpStatSet(); this.ips = new IpStatSet();
} }
/**
* Gets the ips.
*
* @return the ips
*/
public IpStats getIps() public IpStats getIps()
{ {
IpStats result; IpStats result;
@ -52,6 +52,11 @@ public final class IpStator
return result; return result;
} }
/**
* Gets the log count.
*
* @return the log count
*/
public long getLogCount() public long getLogCount()
{ {
return this.logCount; return this.logCount;

View file

@ -21,16 +21,12 @@ package fr.devinsy.statoolinfos.stats.ip;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class IpStats. * The Class IpStats.
*/ */
public final class IpStats extends ArrayList<IpStat> public final class IpStats extends ArrayList<IpStat>
{ {
private static final long serialVersionUID = -2725108375443481335L; private static final long serialVersionUID = -2725108375443481335L;
private static Logger logger = LoggerFactory.getLogger(IpStats.class);
/** /**
* Instantiates a new ip user agent stats. * Instantiates a new ip user agent stats.

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.stats.properties; package fr.devinsy.statoolinfos.stats.properties;

View file

@ -19,8 +19,6 @@
package fr.devinsy.statoolinfos.stats.properties; package fr.devinsy.statoolinfos.stats.properties;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.properties.PathProperty; import fr.devinsy.statoolinfos.properties.PathProperty;
import fr.devinsy.statoolinfos.properties.PathPropertyList; import fr.devinsy.statoolinfos.properties.PathPropertyList;
@ -30,8 +28,6 @@ import fr.devinsy.statoolinfos.properties.PathPropertyList;
*/ */
public class PropertyStats public class PropertyStats
{ {
private static Logger logger = LoggerFactory.getLogger(PropertyStats.class);
private int fileCount; private int fileCount;
private PropertyStatSet stats; private PropertyStatSet stats;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -43,26 +43,51 @@ public class HostProviderTypeStats
this.unknownCount = 0; this.unknownCount = 0;
} }
/**
* Gets the home count.
*
* @return the home count
*/
public long getHomeCount() public long getHomeCount()
{ {
return this.homeCount; return this.homeCount;
} }
/**
* Gets the hosted bay count.
*
* @return the hosted bay count
*/
public long getHostedBayCount() public long getHostedBayCount()
{ {
return this.hostedBayCount; return this.hostedBayCount;
} }
/**
* Gets the hosted server count.
*
* @return the hosted server count
*/
public long getHostedServerCount() public long getHostedServerCount()
{ {
return this.hostedServerCount; return this.hostedServerCount;
} }
/**
* Gets the outsourced count.
*
* @return the outsourced count
*/
public long getOutsourcedCount() public long getOutsourcedCount()
{ {
return this.outsourcedCount; return this.outsourcedCount;
} }
/**
* Gets the unknown count.
*
* @return the unknown count
*/
public long getUnknownCount() public long getUnknownCount()
{ {
return this.unknownCount; return this.unknownCount;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -45,31 +45,61 @@ public class HostServerTypeStats
this.unknownCount = 0; this.unknownCount = 0;
} }
/**
* Gets the cloud count.
*
* @return the cloud count
*/
public long getCloudCount() public long getCloudCount()
{ {
return this.cloudCount; return this.cloudCount;
} }
/**
* Gets the nano count.
*
* @return the nano count
*/
public long getNanoCount() public long getNanoCount()
{ {
return this.nanoCount; return this.nanoCount;
} }
/**
* Gets the physical count.
*
* @return the physical count
*/
public long getPhysicalCount() public long getPhysicalCount()
{ {
return this.physicalCount; return this.physicalCount;
} }
/**
* Gets the shared count.
*
* @return the shared count
*/
public long getSharedCount() public long getSharedCount()
{ {
return this.sharedCount; return this.sharedCount;
} }
/**
* Gets the unknown count.
*
* @return the unknown count
*/
public long getUnknownCount() public long getUnknownCount()
{ {
return this.unknownCount; return this.unknownCount;
} }
/**
* Gets the virtual count.
*
* @return the virtual count
*/
public long getVirtualCount() public long getVirtualCount()
{ {
return this.virtualCount; return this.virtualCount;

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.stats.softwares; package fr.devinsy.statoolinfos.stats.softwares;

View file

@ -20,16 +20,12 @@ package fr.devinsy.statoolinfos.stats.useragent;
import java.util.HashSet; import java.util.HashSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class IpSet. * The Class IpSet.
*/ */
public final class IpSet extends HashSet<String> public final class IpSet extends HashSet<String>
{ {
private static final long serialVersionUID = 8883849089810229045L; private static final long serialVersionUID = 8883849089810229045L;
private static Logger logger = LoggerFactory.getLogger(IpSet.class);
/** /**
* Instantiates a new ip set. * Instantiates a new ip set.

View file

@ -18,9 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.stats.useragent; package fr.devinsy.statoolinfos.stats.useragent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpStatusCategory; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpStatusCategory;
import fr.devinsy.statoolinfos.stats.visitor.VisitorStat; import fr.devinsy.statoolinfos.stats.visitor.VisitorStat;
@ -31,8 +28,6 @@ import fr.devinsy.statoolinfos.stats.visitor.VisitorStatSet;
*/ */
public final class UserAgentStat public final class UserAgentStat
{ {
private static Logger logger = LoggerFactory.getLogger(UserAgentStat.class);
private String userAgent; private String userAgent;
private long logCount; private long logCount;
private IpSet ips; private IpSet ips;

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.stats.useragent; package fr.devinsy.statoolinfos.stats.useragent;

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.stats.useragent;
import java.util.HashMap; import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
/** /**
@ -32,8 +29,6 @@ public final class UserAgentStatSet extends HashMap<String, UserAgentStat>
{ {
private static final long serialVersionUID = -7943808966632477322L; private static final long serialVersionUID = -7943808966632477322L;
private static Logger logger = LoggerFactory.getLogger(UserAgentStatSet.class);
/** /**
* Instantiates a new user agents. * Instantiates a new user agents.
*/ */

View file

@ -18,9 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.stats.useragent; package fr.devinsy.statoolinfos.stats.useragent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
/** /**
@ -28,8 +25,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
*/ */
public final class UserAgentStator public final class UserAgentStator
{ {
private static Logger logger = LoggerFactory.getLogger(UserAgentStator.class);
private long logCount; private long logCount;
private UserAgentStatSet userAgents; private UserAgentStatSet userAgents;

View file

@ -21,16 +21,12 @@ package fr.devinsy.statoolinfos.stats.useragent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class UserAgentStats. * The Class UserAgentStats.
*/ */
public final class UserAgentStats extends ArrayList<UserAgentStat> public final class UserAgentStats extends ArrayList<UserAgentStat>
{ {
private static final long serialVersionUID = -6389473662022565639L; private static final long serialVersionUID = -6389473662022565639L;
private static Logger logger = LoggerFactory.getLogger(UserAgentStats.class);
/** /**
* Instantiates a new user agent stats. * Instantiates a new user agent stats.

View file

@ -18,9 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.stats.visitor; package fr.devinsy.statoolinfos.stats.visitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.httpaccess.Visits; import fr.devinsy.statoolinfos.metrics.httpaccess.Visits;
/** /**
@ -28,8 +25,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.Visits;
*/ */
public final class VisitorStat public final class VisitorStat
{ {
private static Logger logger = LoggerFactory.getLogger(VisitorStat.class);
private String ip; private String ip;
private String userAgent; private String userAgent;
private long logCount; private long logCount;

View file

@ -1,5 +1,20 @@
/* /*
* Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/ */
package fr.devinsy.statoolinfos.stats.visitor; package fr.devinsy.statoolinfos.stats.visitor;

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.stats.visitor;
import java.util.HashMap; import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.stats.useragent.UserAgentStat; import fr.devinsy.statoolinfos.stats.useragent.UserAgentStat;
/** /**
@ -31,7 +28,6 @@ import fr.devinsy.statoolinfos.stats.useragent.UserAgentStat;
public final class VisitorStatSet extends HashMap<String, VisitorStat> public final class VisitorStatSet extends HashMap<String, VisitorStat>
{ {
private static final long serialVersionUID = -3123113539922160408L; private static final long serialVersionUID = -3123113539922160408L;
private static Logger logger = LoggerFactory.getLogger(VisitorStatSet.class);
/** /**
* Instantiates a new visitor stat set. * Instantiates a new visitor stat set.

View file

@ -18,9 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.stats.visitor; package fr.devinsy.statoolinfos.stats.visitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLog;
import fr.devinsy.statoolinfos.metrics.httpaccess.HttpStatusCategory; import fr.devinsy.statoolinfos.metrics.httpaccess.HttpStatusCategory;
@ -29,8 +26,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpStatusCategory;
*/ */
public final class VisitorStator public final class VisitorStator
{ {
private static Logger logger = LoggerFactory.getLogger(VisitorStator.class);
private long logCount; private long logCount;
private VisitorStatSet visitors; private VisitorStatSet visitors;

View file

@ -21,16 +21,12 @@ package fr.devinsy.statoolinfos.stats.visitor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The Class VisitorStats. * The Class VisitorStats.
*/ */
public final class VisitorStats extends ArrayList<VisitorStat> public final class VisitorStats extends ArrayList<VisitorStat>
{ {
private static final long serialVersionUID = 8866450468875949301L; private static final long serialVersionUID = 8866450468875949301L;
private static Logger logger = LoggerFactory.getLogger(VisitorStats.class);
/** /**
* Instantiates a new visitor stats. * Instantiates a new visitor stats.

View file

@ -18,9 +18,6 @@
*/ */
package fr.devinsy.statoolinfos.uptime; package fr.devinsy.statoolinfos.uptime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.Service; import fr.devinsy.statoolinfos.core.Service;
/** /**
@ -28,8 +25,6 @@ import fr.devinsy.statoolinfos.core.Service;
*/ */
public class ServiceUptime extends Uptime public class ServiceUptime extends Uptime
{ {
private static Logger logger = LoggerFactory.getLogger(ServiceUptime.class);
private Service service; private Service service;
/** /**

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.uptime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.Service; import fr.devinsy.statoolinfos.core.Service;
import fr.devinsy.statoolinfos.core.Services; import fr.devinsy.statoolinfos.core.Services;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
@ -34,7 +31,6 @@ import fr.devinsy.strings.StringList;
public class ServiceUptimes extends ArrayList<ServiceUptime> public class ServiceUptimes extends ArrayList<ServiceUptime>
{ {
private static final long serialVersionUID = -4077776702697960767L; private static final long serialVersionUID = -4077776702697960767L;
private static Logger logger = LoggerFactory.getLogger(ServiceUptimes.class);
/** /**
* Instantiates a new service uptimes. * Instantiates a new service uptimes.

Some files were not shown because too many files have changed in this diff Show more