Package uk.ac.manchester.spinnaker.alloc
Class SpallocProperties.DBProperties
java.lang.Object
uk.ac.manchester.spinnaker.alloc.SpallocProperties.DBProperties
- Enclosing class:
- SpallocProperties
public static class SpallocProperties.DBProperties extends Object
Additional database configuration.
-
Constructor Summary
Constructors Constructor Description DBProperties(Duration timeout, boolean debugFailures, int analysisLimit, boolean performanceLog, boolean autoExplain, double performanceThreshold, int lockTries, Duration lockFailedDelay, Duration lockNoteThreshold, Duration lockWarnThreshold, boolean enableExpensiveTransactionDebugging)
-
Method Summary
Modifier and Type Method Description @javax.validation.constraints.Min(100L),@javax.validation.constraints.Max(1000L) int
getAnalysisLimit()
Amount of effort to spend on DB optimisation on application close.@NotNull Duration
getLockFailedDelay()
@NotNull Duration
getLockNoteThreshold()
@javax.validation.constraints.Positive int
getLockTries()
@NotNull Duration
getLockWarnThreshold()
@javax.validation.constraints.Positive double
getPerformanceThreshold()
@NotNull Duration
getTimeout()
boolean
isAutoExplain()
boolean
isDebugFailures()
boolean
isEnableExpensiveTransactionDebugging()
boolean
isPerformanceLog()
-
Constructor Details
-
DBProperties
public DBProperties(@DefaultValue("1s") Duration timeout, @DefaultValue("false") boolean debugFailures, @DefaultValue("400") int analysisLimit, @DefaultValue("false") boolean performanceLog, @DefaultValue("true") boolean autoExplain, @DefaultValue("1e6") double performanceThreshold, @DefaultValue("3") int lockTries, @DefaultValue("100ms") Duration lockFailedDelay, @DefaultValue("50ms") Duration lockNoteThreshold, @DefaultValue("100ms") Duration lockWarnThreshold, @DefaultValue("false") boolean enableExpensiveTransactionDebugging)- Parameters:
timeout
- How long to wait to get a database lock.debugFailures
- Whether to send details of SQL-related exceptions to users.analysisLimit
- Amount of effort to spend on DB optimisation on application close. See the SQLite documentation for meaning. Note that this is spent by every worker thread that touches the database.performanceLog
- Whether to collect and write query performance metrics to the log on termination.autoExplain
- If the performance log is enabled, also write the EXPLAIN of the code to the log on termination (for slow queries only).performanceThreshold
- Performance stats not reported for queries with a max less than this (in μs).lockTries
- Number of times to try to take the lock in a transaction.lockFailedDelay
- Delay after transaction failure before retrying.lockNoteThreshold
- Time delay before we issue a warning on transaction end.lockWarnThreshold
- Time delay before we issue a warning during the execution of a transaction.enableExpensiveTransactionDebugging
- Whether to determine the caller when doing transaction logging.
-
-
Method Details
-
getTimeout
- Returns:
- How long to wait to get a database lock.
-
isDebugFailures
public boolean isDebugFailures()- Returns:
- Whether to send details of SQL-related exceptions to users.
-
getAnalysisLimit
@Min(100L) @Max(1000L) public @javax.validation.constraints.Min(100L),@javax.validation.constraints.Max(1000L) int getAnalysisLimit()Amount of effort to spend on DB optimisation on application close. See the SQLite documentation for meaning. Note that this is spent by every worker thread that touches the database.- Returns:
- Amount of effort to spend on DB optimisation on application close.
- See Also:
- SQLite docs
-
isPerformanceLog
public final boolean isPerformanceLog()- Returns:
- Whether to collect and write query performance metrics to the log on termination. Note that this is checked both when recording performance (on each database query) and when the log writes happen (on termination).
-
isAutoExplain
public final boolean isAutoExplain()- Returns:
- Whether, if the performance log is enabled, to also write the EXPLAIN of the code to the log on termination (for slow queries only).
-
getPerformanceThreshold
- Returns:
- Performance stats are not reported for queries with a max less than this, in microseconds.
-
getLockTries
- Returns:
- Number of times to try to take the lock in a transaction.
-
getLockFailedDelay
- Returns:
- Delay after transaction failure before retrying.
-
getLockNoteThreshold
- Returns:
- Time delay before we issue a warning on transaction end.
-
getLockWarnThreshold
- Returns:
- Time delay before we issue a warning during the execution of a transaction.
-
isEnableExpensiveTransactionDebugging
public boolean isEnableExpensiveTransactionDebugging()- Returns:
- Whether to determine the caller when doing transaction logging.
-