Package uk.ac.manchester.spinnaker.alloc
Class SpallocProperties.DBProperties
java.lang.Object
uk.ac.manchester.spinnaker.alloc.SpallocProperties.DBProperties
- Enclosing class:
- SpallocProperties
Additional database configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionDBProperties
(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 TypeMethodDescription@jakarta.validation.constraints.Min(100L),@jakarta.validation.constraints.Max(1000L) int
Amount of effort to spend on DB optimisation on application close.@NotNull Duration
@NotNull Duration
@jakarta.validation.constraints.Positive int
@NotNull Duration
final @jakarta.validation.constraints.Positive double
@NotNull Duration
final boolean
boolean
boolean
final boolean
-
Constructor Details
-
DBProperties
@ConstructorBinding 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 @jakarta.validation.constraints.Min(100L),@jakarta.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:
-
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
@Positive public final @jakarta.validation.constraints.Positive double getPerformanceThreshold()- Returns:
- Performance stats are not reported for queries with a max less than this, in microseconds.
-
getLockTries
@Positive public @jakarta.validation.constraints.Positive int 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.
-