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]
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:
- …
- SPLITWEB: no more web building! Watch the StatoolInfosWeb project.
## [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
```
### 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
Configuration template:

View file

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

View file

@ -1,4 +1,4 @@
product.name=statoolinfos
product.revision.major=0
product.revision.minor=5
product.revision.minor=6
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.
*
@ -19,16 +19,12 @@
package fr.devinsy.statoolinfos.cli;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class CLIUtils.
*/
public final class CLIUtils
{
private static Logger logger = LoggerFactory.getLogger(CLIUtils.class);
/**
* Instantiates a new statool infos CLI.
*/

View file

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

View file

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

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.
*
@ -217,6 +217,11 @@ public class Federation extends PathPropertyList
return result;
}
/**
* Gets the crawl journal.
*
* @return the crawl journal
*/
public CrawlJournal getCrawlJournal()
{
return this.crawlJournal;
@ -252,6 +257,11 @@ public class Federation extends PathPropertyList
return result;
}
/**
* Gets the input checks.
*
* @return the input checks
*/
public PropertyChecks getInputChecks()
{
return this.inputChecks;
@ -279,11 +289,21 @@ public class Federation extends PathPropertyList
return result;
}
/**
* Gets the input file.
*
* @return the input file
*/
public File getInputFile()
{
return this.inputFile;
}
/**
* Gets the input URL.
*
* @return the input URL
*/
public URL getInputURL()
{
return this.inputURL;
@ -336,6 +356,11 @@ public class Federation extends PathPropertyList
return result;
}
/**
* Gets the logo file name.
*
* @return the logo file name
*/
public String getLogoFileName()
{
return this.logoFileName;
@ -499,6 +524,11 @@ public class Federation extends PathPropertyList
return result;
}
/**
* Gets the organizations.
*
* @return the organizations
*/
public Organizations getOrganizations()
{
return this.organizations;
@ -819,11 +849,23 @@ public class Federation extends PathPropertyList
this.inputFile = inputFile;
}
/**
* Sets the input URL.
*
* @param inputURL
* the new input URL
*/
public void setInputURL(final URL inputURL)
{
this.inputURL = inputURL;
}
/**
* Sets the logo file name.
*
* @param logoFileName
* the new logo file name
*/
public void setLogoFileName(final String 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.
*
@ -23,8 +23,6 @@ import java.net.URL;
import java.time.LocalDateTime;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.checker.PropertyChecks;
import fr.devinsy.statoolinfos.properties.PathProperties;
@ -37,8 +35,6 @@ public class Metrics extends PathPropertyList
{
private static final long serialVersionUID = -1608084706095266037L;
private static Logger logger = LoggerFactory.getLogger(Metrics.class);
private String localFileNamePrefix;
private File inputFile;
private URL inputURL;
@ -99,16 +95,31 @@ public class Metrics extends PathPropertyList
return result;
}
/**
* Gets the input checks.
*
* @return the input checks
*/
public PropertyChecks getInputChecks()
{
return this.inputChecks;
}
/**
* Gets the input file.
*
* @return the input file
*/
public File getInputFile()
{
return this.inputFile;
}
/**
* Gets the input URL.
*
* @return the input URL
*/
public URL getInputURL()
{
return this.inputURL;
@ -144,6 +155,11 @@ public class Metrics extends PathPropertyList
return result;
}
/**
* Gets the local file name prefix.
*
* @return the local file name prefix
*/
public String getLocalFileNamePrefix()
{
return this.localFileNamePrefix;
@ -165,16 +181,34 @@ public class Metrics extends PathPropertyList
return result;
}
/**
* Sets the input file.
*
* @param inputFile
* the new input file
*/
public void setInputFile(final File inputFile)
{
this.inputFile = inputFile;
}
/**
* Sets the input URL.
*
* @param inputURL
* the new input URL
*/
public void setInputURL(final URL inputURL)
{
this.inputURL = inputURL;
}
/**
* Sets the local file name prefix.
*
* @param localFileNamePrefix
* the new local file name prefix
*/
public void setLocalFileNamePrefix(final String localFileNamePrefix)
{
this.localFileNamePrefix = localFileNamePrefix;

View file

@ -42,6 +42,8 @@ import fr.devinsy.statoolinfos.util.URLUtils;
*/
public class Organization extends PathPropertyList
{
private static final long serialVersionUID = -2709210934548224213L;
public enum Status
{
ACTIVE,
@ -60,8 +62,6 @@ public class Organization extends PathPropertyList
OTHER
}
private static final long serialVersionUID = -2709210934548224213L;
private Federation federation;
private Services services;
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.
*
@ -27,8 +27,6 @@ import java.time.YearMonth;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.checker.PropertyChecks;
import fr.devinsy.statoolinfos.crawl.CrawlJournal;
@ -45,8 +43,6 @@ public class Service extends PathPropertyList
{
private static final long serialVersionUID = 3629841771102288863L;
private static Logger logger = LoggerFactory.getLogger(Service.class);
public enum HostProviderType
{
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.
*
@ -50,8 +50,6 @@ import org.apache.tika.Tika;
import org.apache.tika.mime.MimeType;
import org.apache.tika.mime.MimeTypeException;
import org.apache.tika.mime.MimeTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils;
@ -61,8 +59,6 @@ import fr.devinsy.strings.StringsUtils;
*/
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_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
{
private static Logger logger = LoggerFactory.getLogger(CrawlCache.class);
public static enum DefaultLogoGenerator
{
CAT,
BIRD
}
private static Logger logger = LoggerFactory.getLogger(CrawlCache.class);
private File directory;
/**
@ -116,6 +116,11 @@ public class CrawlCache
}
}
/**
* Gets the directory.
*
* @return the directory
*/
public File getDirectory()
{
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.
*
@ -34,6 +34,8 @@ public class CrawlLog
*
* @param url
* the url
* @param parentUrl
* the parent url
* @param status
* the status
*/
@ -44,6 +46,11 @@ public class CrawlLog
this.status = status;
}
/**
* Gets the parent url.
*
* @return the parent url
*/
public URL getParentUrl()
{
return this.parentUrl;
@ -71,11 +78,21 @@ public class CrawlLog
return result;
}
/**
* Gets the status.
*
* @return the status
*/
public CrawlStatus getStatus()
{
return this.status;
}
/**
* Gets the url.
*
* @return the url
*/
public URL getUrl()
{
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.
*
@ -68,6 +68,8 @@ public class CrawlLogs extends ArrayList<CrawlLog>
*
* @param url
* the url
* @param parentUrl
* the parent url
* @param 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.
*
@ -18,6 +18,9 @@
*/
package fr.devinsy.statoolinfos.crawl;
/**
* The Enum CrawlStatus.
*/
public enum CrawlStatus
{
BADCHILDCLASS,
@ -31,6 +34,11 @@ public enum CrawlStatus
UPDATED,
URLNOTFOUND;
/**
* Checks if is error.
*
* @return true, if is error
*/
public boolean isError()
{
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.
*
@ -250,6 +250,8 @@ public class Crawler
*
* @param url
* the url
* @param parentURL
* the parent URL
* @return the file
*/
public File crawlLogo(final URL url, final URL parentURL)
@ -347,6 +349,7 @@ public class Crawler
*
* @return the crawl journal
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public CrawlJournal restoreJournal() throws IOException
{

View file

@ -22,8 +22,6 @@ import java.io.File;
import java.io.IOException;
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.Organization;
@ -39,8 +37,6 @@ import fr.devinsy.strings.StringSet;
*/
public class CSVFile
{
private static final Logger logger = LoggerFactory.getLogger(CSVFile.class);
public static final int MAX_LINE_SIZE = 4096;
public static final String SEPARATOR = ";";
@ -76,6 +72,8 @@ public class CSVFile
* the file
* @param source
* the source
* @param categories
* the categories
* @throws IOException
* Signals that an I/O exception has occurred.
*/
@ -151,6 +149,8 @@ public class CSVFile
* the out
* @param services
* the services
* @param categories
* the categories
* @throws IOException
* 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.
*
@ -29,16 +29,12 @@ import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class CSVWriter.
*/
public class CSVWriter implements SpreadsheetWriter
{
private static final Logger logger = LoggerFactory.getLogger(CSVWriter.class);
private char separator;
private PrintWriter out;
private boolean isNewline;

View file

@ -24,8 +24,6 @@ import java.io.UnsupportedEncodingException;
import org.apache.commons.lang3.StringUtils;
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.Federation;
@ -43,8 +41,6 @@ import fr.devinsy.strings.StringsUtils;
*/
public class JSONFile
{
private static final Logger logger = LoggerFactory.getLogger(JSONFile.class);
/**
* Escape.
*
@ -235,6 +231,8 @@ public class JSONFile
*
* @param service
* the service
* @param categories
* the categories
* @return the string list
*/
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.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.Categories;
import fr.devinsy.statoolinfos.core.Organizations;
import fr.devinsy.statoolinfos.core.Services;
@ -33,11 +30,9 @@ import fr.devinsy.statoolinfos.core.Services;
*/
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,
OPTIONAL
@ -75,6 +70,10 @@ public class ODSFile
* the file
* @param 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
{

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.
*
@ -28,16 +28,12 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.jopendocument.dom.spreadsheet.Sheet;
import org.jopendocument.dom.spreadsheet.SpreadSheet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class ODSWriter.
*/
public class ODSWriter implements SpreadsheetWriter
{
private static final Logger logger = LoggerFactory.getLogger(ODSWriter.class);
private File file;
private SpreadSheet workbook;
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.
*
@ -26,11 +26,31 @@ import java.io.IOException;
*/
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;
/**
* Write cell.
*
* @param content
* the content
*/
void writeCell(String content);
/**
* Write endpage.
*/
void writeEndpage();
/**
* Write end row.
*/
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.
*
@ -60,6 +60,8 @@ public class IpCounters extends HashMap<String, StringSet>
/**
* Gets the counters.
*
* @param prefix
* the prefix
* @return the counters
*/
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.
*
@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics;
import java.time.YearMonth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.properties.MonthValues;
import fr.devinsy.strings.StringList;
@ -31,8 +28,6 @@ import fr.devinsy.strings.StringList;
*/
public class Metric
{
private static Logger logger = LoggerFactory.getLogger(Metric.class);
public enum Type
{
MONTHS,
@ -51,6 +46,15 @@ public class 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)
{
@ -64,36 +68,81 @@ public class Metric
this.dayValues = new StringList();
}
/**
* Gets the day values.
*
* @return the day values
*/
public StringList getDayValues()
{
return this.dayValues;
}
/**
* Gets the description.
*
* @return the description
*/
public String getDescription()
{
return this.description;
}
/**
* Gets the month values.
*
* @return the month values
*/
public StringList getMonthValues()
{
return this.monthValues;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName()
{
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()
{
return this.startYear;
}
/**
* Gets the week values.
*
* @return the week values
*/
public StringList getWeekValues()
{
return this.weekValues;
}
/**
* Gets the year values.
*
* @return the year values
*/
public StringList getYearValues()
{
return this.yearValues;
@ -121,16 +170,34 @@ public class Metric
return result;
}
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(final String description)
{
this.description = description;
}
/**
* Sets the name.
*
* @param name
* the new name
*/
public void setName(final String name)
{
this.name = name;
}
/**
* Sets the start year.
*
* @param startYear
* the new start year
*/
public void setStartYear(final String startYear)
{
this.startYear = startYear;

View file

@ -18,16 +18,11 @@
*/
package fr.devinsy.statoolinfos.metrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class PathCounter.
*/
public class PathCounter
{
private static Logger logger = LoggerFactory.getLogger(PathCounter.class);
private String path;
private String timeMark;
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.metrics.etherpad.EtherpadProber;
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.HttpAccessLogs;
import fr.devinsy.statoolinfos.metrics.httperrorlog.HttpErrorLogAnalyzer;
@ -313,32 +312,6 @@ public class Prober
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.
*

View file

@ -18,16 +18,11 @@
*/
package fr.devinsy.statoolinfos.metrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class StringCounter.
*/
public class StringCounter
{
private static Logger logger = LoggerFactory.getLogger(StringCounter.class);
private String string;
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.
*
@ -25,16 +25,11 @@ import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.regex.Matcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class TimeMark.
*/
public class TimeMark
{
private static Logger logger = LoggerFactory.getLogger(TimeMark.class);
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.
*
@ -26,8 +26,6 @@ import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.threeten.extra.YearWeek;
/**
@ -35,8 +33,6 @@ import org.threeten.extra.YearWeek;
*/
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_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})$");

View file

@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.etherpad;
import java.io.IOException;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -35,8 +32,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogs;
*/
public class EtherpadHttpLogAnalyzer
{
private static Logger logger = LoggerFactory.getLogger(EtherpadHttpLogAnalyzer.class);
public static final Pattern USE_PATTERN = Pattern.compile("^GET /p/\\S+ .*$");
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.
*
@ -22,9 +22,6 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMark;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList;
@ -34,8 +31,6 @@ import fr.devinsy.strings.StringList;
*/
public class EtherpadLog
{
private static Logger logger = LoggerFactory.getLogger(EtherpadLog.class);
private LocalDateTime time;
private String level;
private String type;
@ -58,6 +53,11 @@ public class EtherpadLog
this.author = null;
}
/**
* Gets the author.
*
* @return the author
*/
public String getAuthor()
{
return this.author;
@ -78,26 +78,51 @@ public class EtherpadLog
return result;
}
/**
* Gets the event.
*
* @return the event
*/
public String getEvent()
{
return this.event;
}
/**
* Gets the ip.
*
* @return the ip
*/
public String getIp()
{
return this.ip;
}
/**
* Gets the level.
*
* @return the level
*/
public String getLevel()
{
return this.level;
}
/**
* Gets the padname.
*
* @return the padname
*/
public String getPadname()
{
return this.padname;
}
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime()
{
return this.time;
@ -128,6 +153,11 @@ public class EtherpadLog
return result;
}
/**
* Gets the type.
*
* @return the type
*/
public String getType()
{
return this.type;
@ -240,36 +270,78 @@ public class EtherpadLog
return result;
}
/**
* Sets the author.
*
* @param author
* the new author
*/
public void setAuthor(final String author)
{
this.author = author;
}
/**
* Sets the event.
*
* @param event
* the new event
*/
public void setEvent(final String event)
{
this.event = event;
}
/**
* Sets the ip.
*
* @param ip
* the new ip
*/
public void setIp(final String ip)
{
this.ip = ip;
}
/**
* Sets the level.
*
* @param level
* the new level
*/
public void setLevel(final String level)
{
this.level = level;
}
/**
* Sets the padname.
*
* @param padname
* the new padname
*/
public void setPadname(final String padname)
{
this.padname = padname;
}
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final LocalDateTime time)
{
this.time = time;
}
/**
* Sets the type.
*
* @param type
* the new type
*/
public void setType(final String 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.
*
@ -31,16 +31,12 @@ import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class GiteaAPI.
*/
public class GiteaAPI
{
private static Logger logger = LoggerFactory.getLogger(GiteaAPI.class);
private String url;
private String token;
private JSONArray users;
@ -49,6 +45,15 @@ public class GiteaAPI
/**
* 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
{
@ -58,15 +63,15 @@ public class GiteaAPI
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));
//
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));
//
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");
}
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.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList;
@ -37,8 +34,6 @@ import fr.devinsy.strings.StringList;
*/
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.*$");
private String ip;
@ -65,11 +60,21 @@ public class HttpAccessLog
this.userAgent = null;
}
/**
* Gets the body bytes sent.
*
* @return the body bytes sent
*/
public long getBodyBytesSent()
{
return this.bodyBytesSent;
}
/**
* Gets the date.
*
* @return the date
*/
public String getDate()
{
String result;
@ -80,6 +85,11 @@ public class HttpAccessLog
return result;
}
/**
* Gets the ip.
*
* @return the ip
*/
public String getIp()
{
return this.ip;
@ -115,31 +125,61 @@ public class HttpAccessLog
return result;
}
/**
* Gets the referer.
*
* @return the referer
*/
public String getReferer()
{
return this.referer;
}
/**
* Gets the remote user.
*
* @return the remote user
*/
public String getRemoteUser()
{
return this.remoteUser;
}
/**
* Gets the request.
*
* @return the request
*/
public String getRequest()
{
return this.request;
}
/**
* Gets the status.
*
* @return the status
*/
public HttpStatus getStatus()
{
return this.status;
}
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime()
{
return this.time.toLocalDateTime();
}
/**
* Gets the user agent.
*
* @return the user agent
*/
public UserAgent getUserAgent()
{
return this.userAgent;
@ -290,31 +330,67 @@ public class HttpAccessLog
return result;
}
/**
* Sets the body bytes sent.
*
* @param bodyBytesSent
* the new body bytes sent
*/
public void setBodyBytesSent(final long bodyBytesSent)
{
this.bodyBytesSent = bodyBytesSent;
}
/**
* Sets the ip.
*
* @param ip
* the new ip
*/
public void setIp(final String ip)
{
this.ip = ip;
}
/**
* Sets the referer.
*
* @param referer
* the new referer
*/
public void setReferer(final String referer)
{
this.referer = referer;
}
/**
* Sets the remote user.
*
* @param remoteUser
* the new remote user
*/
public void setRemoteUser(final String remoteUser)
{
this.remoteUser = remoteUser;
}
/**
* Sets the request.
*
* @param request
* the new request
*/
public void setRequest(final String request)
{
this.request = request;
}
/**
* Sets the status.
*
* @param status
* the new status
*/
public void setStatus(final HttpStatus status)
{
this.status = status;
@ -331,11 +407,23 @@ public class HttpAccessLog
this.time = ZonedDateTime.of(time, ZoneId.systemDefault());
}
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final ZonedDateTime time)
{
this.time = time;
}
/**
* Sets the user agent.
*
* @param userAgent
* the new user agent
*/
public void setUserAgent(final UserAgent userAgent)
{
this.userAgent = userAgent;

View file

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

View file

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

View file

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

View file

@ -22,9 +22,6 @@ import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.util.Files;
/**
@ -32,8 +29,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/
public class HttpAccessLogs implements Iterable<HttpAccessLog>
{
private static Logger logger = LoggerFactory.getLogger(HttpAccessLogs.class);
private Files source;
private String pattern;
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
* the source
* @param pattern
* the pattern
* @throws IOException
* Signals that an I/O exception has occurred.
*/
@ -117,6 +114,8 @@ public class HttpAccessLogs implements Iterable<HttpAccessLog>
* the source
* @param pattern
* the pattern
* @param datePattern
* the date pattern
* @param pathFilter
* the path filter
* @throws IOException

View file

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

View file

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

View file

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

View file

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

View file

@ -21,8 +21,6 @@ package fr.devinsy.statoolinfos.metrics.httpaccess;
import java.io.IOException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils;
@ -32,8 +30,6 @@ import fr.devinsy.strings.StringsUtils;
*/
public class UserAgentBotDetector
{
private static Logger logger = LoggerFactory.getLogger(UserAgentBotDetector.class);
private static final StringList startList = 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.YearMonth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.threeten.extra.YearWeek;
/**
* The Class PathCounter.
* The Class Visit.
*/
public class Visit
{
private static Logger logger = LoggerFactory.getLogger(Visit.class);
private LocalDateTime start;
private LocalDateTime end;

View file

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

View file

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

View file

@ -254,6 +254,7 @@ public class HttpErrorLogIterator implements Iterator<HttpErrorLog>
* the files
* @return true, if is apache http error log files
* @throws IOException
* Signals that an I/O exception has occurred.
*/
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.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The 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 NGINX_ERROR_PATTERN = Pattern.compile("^(?<time>\\S+\\s\\S+)\\s\\[(?<level>[^\\]]*)\\]\\s(?<message>.*)$");
@ -79,7 +74,11 @@ public class HttpErrorLogParser
*
* @param 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)
{

View file

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

View file

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

View file

@ -22,9 +22,6 @@ import java.io.File;
import java.io.IOException;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -37,8 +34,6 @@ import fr.devinsy.statoolinfos.metrics.util.DatafilesProber;
*/
public class LibreQRProber
{
private static Logger logger = LoggerFactory.getLogger(LibreQRProber.class);
/**
* 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.
*
@ -24,9 +24,6 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList;
@ -35,9 +32,7 @@ import fr.devinsy.strings.StringList;
*/
public class MinetestLog
{
private static Logger logger = LoggerFactory.getLogger(MinetestLog.class);
// Cpm [2a01:e0a:22:ce10::adc5:a] joins game. List of players: Cpm
// Cpm [fc00: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 NICK_PATTERN = Pattern
.compile(
@ -59,6 +54,11 @@ public class MinetestLog
this.message = null;
}
/**
* Gets the date.
*
* @return the date
*/
public String getDate()
{
String result;
@ -92,16 +92,31 @@ public class MinetestLog
return result;
}
/**
* Gets the level.
*
* @return the level
*/
public MinetestLogLevel getLevel()
{
return this.level;
}
/**
* Gets the message.
*
* @return the message
*/
public String getMessage()
{
return this.message;
}
/**
* Gets the module.
*
* @return the module
*/
public String getModule()
{
return this.module;
@ -138,6 +153,11 @@ public class MinetestLog
return result;
}
/**
* Gets the time.
*
* @return the time
*/
public LocalDateTime getTime()
{
return this.time;
@ -206,21 +226,45 @@ public class MinetestLog
return result;
}
/**
* Sets the level.
*
* @param level
* the new level
*/
public void setLevel(final MinetestLogLevel level)
{
this.level = level;
}
/**
* Sets the message.
*
* @param message
* the new message
*/
public void setMessage(final String message)
{
this.message = message;
}
/**
* Sets the module.
*
* @param module
* the new module
*/
public void setModule(final String module)
{
this.module = module;
}
/**
* Sets the time.
*
* @param time
* the new time
*/
public void setTime(final LocalDateTime 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.
*
@ -92,6 +92,16 @@ public class MinetestLogAnalyzer
return result;
}
/**
* Gets the error count.
*
* @return the error count
*/
public int getErrorCount()
{
return this.errorCount;
}
/**
* Probe.
*
@ -261,6 +271,7 @@ public class MinetestLogAnalyzer
*
* @param source
* the source
* @return the path counters
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws StatoolInfosException

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics.mumble;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -31,8 +28,6 @@ import fr.devinsy.statoolinfos.metrics.PathCounters;
*/
public class MumbleDatabaseAnalyzer
{
private static Logger logger = LoggerFactory.getLogger(MumbleDatabaseAnalyzer.class);
/**
* 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.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.metrics.TimeMarkUtils;
import fr.devinsy.strings.StringList;
@ -35,8 +32,6 @@ import fr.devinsy.strings.StringList;
*/
public class MumbleLog
{
private static Logger logger = LoggerFactory.getLogger(MumbleLog.class);
// 1 => <8:neox(-1)> 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;
}
/**
* Gets the error count.
*
* @return the error count
*/
public int getErrorCount()
{
return this.errorCount;
}
/**
* Probe.
*

View file

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

View file

@ -23,8 +23,6 @@ import java.io.IOException;
import java.time.LocalDate;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -37,8 +35,6 @@ import fr.devinsy.statoolinfos.util.FilesUtils;
*/
public class NextcloudDataAnalyzer
{
private static Logger logger = LoggerFactory.getLogger(NextcloudDataAnalyzer.class);
/**
* 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.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -36,8 +33,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/
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 CREATE_PATTERN = Pattern.compile("POST / .*");

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -23,8 +23,6 @@ import java.io.IOException;
import java.time.LocalDate;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
@ -36,8 +34,6 @@ import fr.devinsy.statoolinfos.metrics.TimeMark;
*/
public class XmppDataAnalyzer
{
private static Logger logger = LoggerFactory.getLogger(XmppDataAnalyzer.class);
/**
* 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.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.UserCounters;
@ -36,8 +33,6 @@ import fr.devinsy.statoolinfos.util.Files;
*/
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 CREATE_PATTERN = Pattern.compile("POST / .*");

View file

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

View file

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

View file

@ -18,13 +18,12 @@
*/
package fr.devinsy.statoolinfos.properties;
import org.apache.commons.lang3.StringUtils;
import fr.devinsy.statoolinfos.core.Category;
/**
* The Class PathPropertySpecs.
*/
@SuppressWarnings("all")
public class MetricSpecs
{
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.
*
@ -127,11 +127,21 @@ public class MonthValues extends HashMap<YearMonth, Double>
return result;
}
/**
* Gets the description.
*
* @return the description
*/
public String getDescription()
{
return this.description;
}
/**
* Gets the label.
*
* @return the label
*/
public String getLabel()
{
return this.label;
@ -233,7 +243,6 @@ public class MonthValues extends HashMap<YearMonth, Double>
{
YearMonth result;
YearMonth endTarget;
if (end == null)
{
result = YearMonth.now();
@ -271,11 +280,23 @@ public class MonthValues extends HashMap<YearMonth, Double>
return result;
}
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(final String description)
{
this.description = description;
}
/**
* Sets the label.
*
* @param label
* the new label
*/
public void setLabel(final String 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;
@ -20,6 +35,12 @@ public class PathPropertyComparator implements Comparator<PathProperty>
private Sorting sorting;
/**
* Instantiates a new path property comparator.
*
* @param sorting
* the sorting
*/
public PathPropertyComparator(final Sorting sorting)
{
//

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.properties;
import java.util.Hashtable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringSet;
@ -31,8 +28,6 @@ import fr.devinsy.strings.StringSet;
*/
public class PathPropertySet
{
private static final Logger logger = LoggerFactory.getLogger(PathPropertySet.class);
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.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList;
import fr.devinsy.strings.StringsUtils;
@ -43,8 +41,6 @@ import fr.devinsy.strings.StringsUtils;
*/
public class PathPropertyUtils
{
private static final Logger logger = LoggerFactory.getLogger(PathPropertyUtils.class);
/**
* Checks if is property line.
*

View file

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

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.
*
@ -18,16 +18,11 @@
*/
package fr.devinsy.statoolinfos.stats.ip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class IpStat.
*/
public final class IpStat
{
private static Logger logger = LoggerFactory.getLogger(IpStat.class);
private String value;
private long count;
@ -43,16 +38,29 @@ public final class IpStat
this.count = 0;
}
/**
* Gets the count.
*
* @return the count
*/
public long getCount()
{
return this.count;
}
/**
* Gets the value.
*
* @return the value
*/
public String getValue()
{
return this.value;
}
/**
* Inc.
*/
public void inc()
{
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;

View file

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

View file

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

View file

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

View file

@ -19,8 +19,6 @@
package fr.devinsy.statoolinfos.stats.properties;
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.PathPropertyList;
@ -30,8 +28,6 @@ import fr.devinsy.statoolinfos.properties.PathPropertyList;
*/
public class PropertyStats
{
private static Logger logger = LoggerFactory.getLogger(PropertyStats.class);
private int fileCount;
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.
*
@ -43,26 +43,51 @@ public class HostProviderTypeStats
this.unknownCount = 0;
}
/**
* Gets the home count.
*
* @return the home count
*/
public long getHomeCount()
{
return this.homeCount;
}
/**
* Gets the hosted bay count.
*
* @return the hosted bay count
*/
public long getHostedBayCount()
{
return this.hostedBayCount;
}
/**
* Gets the hosted server count.
*
* @return the hosted server count
*/
public long getHostedServerCount()
{
return this.hostedServerCount;
}
/**
* Gets the outsourced count.
*
* @return the outsourced count
*/
public long getOutsourcedCount()
{
return this.outsourcedCount;
}
/**
* Gets the unknown count.
*
* @return the unknown count
*/
public long getUnknownCount()
{
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.
*
@ -45,31 +45,61 @@ public class HostServerTypeStats
this.unknownCount = 0;
}
/**
* Gets the cloud count.
*
* @return the cloud count
*/
public long getCloudCount()
{
return this.cloudCount;
}
/**
* Gets the nano count.
*
* @return the nano count
*/
public long getNanoCount()
{
return this.nanoCount;
}
/**
* Gets the physical count.
*
* @return the physical count
*/
public long getPhysicalCount()
{
return this.physicalCount;
}
/**
* Gets the shared count.
*
* @return the shared count
*/
public long getSharedCount()
{
return this.sharedCount;
}
/**
* Gets the unknown count.
*
* @return the unknown count
*/
public long getUnknownCount()
{
return this.unknownCount;
}
/**
* Gets the virtual count.
*
* @return the virtual count
*/
public long getVirtualCount()
{
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;

View file

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

View file

@ -18,9 +18,6 @@
*/
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.HttpStatusCategory;
import fr.devinsy.statoolinfos.stats.visitor.VisitorStat;
@ -31,8 +28,6 @@ import fr.devinsy.statoolinfos.stats.visitor.VisitorStatSet;
*/
public final class UserAgentStat
{
private static Logger logger = LoggerFactory.getLogger(UserAgentStat.class);
private String userAgent;
private long logCount;
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;

View file

@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.stats.useragent;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 Logger logger = LoggerFactory.getLogger(UserAgentStatSet.class);
/**
* Instantiates a new user agents.
*/

View file

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

View file

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

View file

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

View file

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

View file

@ -18,9 +18,6 @@
*/
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.HttpStatusCategory;
@ -29,8 +26,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpStatusCategory;
*/
public final class VisitorStator
{
private static Logger logger = LoggerFactory.getLogger(VisitorStator.class);
private long logCount;
private VisitorStatSet visitors;

View file

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

View file

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

View file

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

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