public class P2JQueryStatisticsConfiguration
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
P2JQueryStatisticsConfiguration.LoggingType
Enum denoting what should happen with a statement: should it just be executed or the intention is to
log things about it?
|
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.String,P2JQueryStatisticsConfiguration> |
configs
Map that includes a configuration for each given database.
|
private P2JLoggingDatabaseHelper |
dbHelper
The helper object to facilitate logging to H2 database
|
private static CentralLoggerFile |
fileLogger
The file logger, responsible for writing logs to files.
|
private static java.lang.String |
GLOBAL_DIR_PATH
Global directory path, used if a local one does not exist.
|
private boolean |
LOCATION
Flag that determines whether the log output should contain the location of the query or not.
|
private static CentralLogger |
LOG
Logger.
|
private static java.util.logging.Formatter |
LOG_FORMATTER
The log formatter.
|
private P2JQueryStatisticsConfiguration.LoggingType |
loggingType
The type of logging intended.
|
private double |
MIN_TIME_THRESHOLD
Only queries that are slower than this value will be logged.
|
private java.lang.String |
OUTPUT_DB
The file name for the h2 database that will receive the logging output .
|
private java.lang.String |
OUTPUT_FILE
The file that will receive the logging output.
|
private java.lang.String |
PASS_DB
The password for the h2 database that will receive the logging output .
|
private int |
PROCESSED_COMPONENTS
Display the results every "x" processed components.
|
private boolean |
STACK_TRACING
Flag that determines whether the log output should contain the stack trace or not.
|
private java.lang.String |
USER_DB
The user for the h2 database that will receive the logging output .
|
| Modifier | Constructor and Description |
|---|---|
private |
P2JQueryStatisticsConfiguration(java.lang.String databaseName)
Constructor that sets the logging configuration per-database.
|
| Modifier and Type | Method and Description |
|---|---|
static P2JQueryStatisticsConfiguration |
getConfiguration(java.lang.String databaseName)
Get the logging configuration of a specific database.
|
P2JLoggingDatabaseHelper |
getDbHelper()
Getter for the
dbHelper field. |
CentralLoggerFile |
getFileLogger()
Getter for the
fileLogger field. |
P2JQueryStatisticsConfiguration.LoggingType |
getLoggingType()
Getter for the
loggingType field. |
double |
getMinTimeThreshold()
Getter for the
MIN_TIME_THRESHOLD field. |
int |
getProcessedComponents()
Getter for the
PROCESSED_COMPONENTS field. |
boolean |
isLocationEnabled()
Getter for the
LOCATION field. |
boolean |
isStackTracingEnabled()
Getter for the
STACK_TRACING field. |
private static final java.util.Map<java.lang.String,P2JQueryStatisticsConfiguration> configs
private static final CentralLogger LOG
private static final java.util.logging.Formatter LOG_FORMATTER
private static final java.lang.String GLOBAL_DIR_PATH
private final P2JQueryStatisticsConfiguration.LoggingType loggingType
private static CentralLoggerFile fileLogger
private final boolean STACK_TRACING
private final boolean LOCATION
private final int PROCESSED_COMPONENTS
private final double MIN_TIME_THRESHOLD
private final java.lang.String OUTPUT_FILE
private final java.lang.String OUTPUT_DB
private final java.lang.String USER_DB
private final java.lang.String PASS_DB
private P2JLoggingDatabaseHelper dbHelper
private P2JQueryStatisticsConfiguration(java.lang.String databaseName)
databaseName - The name of the database in use.public static P2JQueryStatisticsConfiguration getConfiguration(java.lang.String databaseName)
databaseName - The name of the database in use.public P2JQueryStatisticsConfiguration.LoggingType getLoggingType()
loggingType field.public boolean isStackTracingEnabled()
STACK_TRACING field.STACK_TRACING.public boolean isLocationEnabled()
LOCATION field.LOCATION.public int getProcessedComponents()
PROCESSED_COMPONENTS field.PROCESSED_COMPONENTS.public double getMinTimeThreshold()
MIN_TIME_THRESHOLD field.MIN_TIME_THRESHOLD.public P2JLoggingDatabaseHelper getDbHelper()
dbHelper field.dbHelper.public CentralLoggerFile getFileLogger()
fileLogger field.fileLogger.