java.lang.Object
io.ebean.config.AutoTuneConfig
Defines the AutoTune behaviour for a Database.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the time in millis to wait after a system gc to collect profiling information.getMode()
Return the mode used when autoTune has not been explicit defined on a query.int
Return the base number of queries to profile before changing to profile only a percentage of following queries (profileRate).Return the name of the file that profiling information is written to.double
Return the rate (%) of queries to be profiled after the 'base' amount of profiling.int
Return the frequency in seconds the profiling should be collected and automatically applied to the tuning.Return the name of the file that holds the query tuning information.boolean
isActive()
Return true if we are profiling or query tuning.boolean
Return true if profiling information should be collected.boolean
Return true if the queries are being tuned.boolean
Return true if the version property should be added when the query is tuned.boolean
Return true if triggering garbage collection should be skipped on shutdown.boolean
Return true if profile reporting should be skipped on shutdown.void
Load the settings from the properties file.void
setGarbageCollectionWait
(int garbageCollectionWait) Set the time in millis to wait after a System.gc() to collect profiling information.void
setMode
(AutoTuneMode mode) Set the mode used when autoTune has not been explicit defined on a query.void
setProfiling
(boolean profiling) Set to true if profiling information should be collected.void
setProfilingBase
(int profilingBase) Set the based number of queries to profile.void
setProfilingFile
(String profilingFile) Set the name of the file that profiling information is written to.void
setProfilingRate
(double profilingRate) Set the rate (%) of queries to be profiled after the 'base' amount of profiling.void
setProfilingUpdateFrequency
(int profilingUpdateFrequency) Set the frequency in seconds the profiling should be collected and automatically applied to the tuning.void
setQueryTuning
(boolean queryTuning) Set to true if the queries should be tuned by autoTune.void
setQueryTuningAddVersion
(boolean queryTuningAddVersion) Set to true to force the version property to be always added by the query tuning.void
setQueryTuningFile
(String queryTuningFile) Set the name of the file that holds the query tuning information.void
setSkipGarbageCollectionOnShutdown
(boolean skipGarbageCollectionOnShutdown) Set to true if triggering garbage collection should be skipped on shutdown.void
setSkipProfileReportingOnShutdown
(boolean skipProfileReportingOnShutdown) Set to true if profile reporting should be skipped on shutdown.
-
Constructor Details
-
AutoTuneConfig
public AutoTuneConfig()
-
-
Method Details
-
isActive
public boolean isActive()Return true if we are profiling or query tuning. If we are not doing either then we don't need a CallStack. -
getQueryTuningFile
Return the name of the file that holds the query tuning information. -
setQueryTuningFile
Set the name of the file that holds the query tuning information. -
getProfilingFile
Return the name of the file that profiling information is written to. -
setProfilingFile
Set the name of the file that profiling information is written to. -
getProfilingUpdateFrequency
public int getProfilingUpdateFrequency()Return the frequency in seconds the profiling should be collected and automatically applied to the tuning. -
setProfilingUpdateFrequency
public void setProfilingUpdateFrequency(int profilingUpdateFrequency) Set the frequency in seconds the profiling should be collected and automatically applied to the tuning. -
getMode
Return the mode used when autoTune has not been explicit defined on a query. -
setMode
Set the mode used when autoTune has not been explicit defined on a query. -
isQueryTuning
public boolean isQueryTuning()Return true if the queries are being tuned. -
setQueryTuning
public void setQueryTuning(boolean queryTuning) Set to true if the queries should be tuned by autoTune. -
isQueryTuningAddVersion
public boolean isQueryTuningAddVersion()Return true if the version property should be added when the query is tuned.If this is false then the version property will be added when profiling detects that the bean is possibly going to be modified.
-
setQueryTuningAddVersion
public void setQueryTuningAddVersion(boolean queryTuningAddVersion) Set to true to force the version property to be always added by the query tuning.If this is false then the version property will be added when profiling detects that the bean is possibly going to be modified.
Generally this is not expected to be turned on.
-
isProfiling
public boolean isProfiling()Return true if profiling information should be collected. -
setProfiling
public void setProfiling(boolean profiling) Set to true if profiling information should be collected.The profiling information is collected and then used to generate the tuned queries for autoTune.
-
getProfilingBase
public int getProfilingBase()Return the base number of queries to profile before changing to profile only a percentage of following queries (profileRate). -
setProfilingBase
public void setProfilingBase(int profilingBase) Set the based number of queries to profile. -
getProfilingRate
public double getProfilingRate()Return the rate (%) of queries to be profiled after the 'base' amount of profiling. -
setProfilingRate
public void setProfilingRate(double profilingRate) Set the rate (%) of queries to be profiled after the 'base' amount of profiling. -
getGarbageCollectionWait
public int getGarbageCollectionWait()Return the time in millis to wait after a system gc to collect profiling information.The profiling information is collected on object finalise. As such we generally don't want to trigger GC (let the JVM do its thing) but on shutdown the autoTune manager will trigger System.gc() and then wait (default 100 millis) to hopefully collect profiling information - especially for short run unit tests.
-
setGarbageCollectionWait
public void setGarbageCollectionWait(int garbageCollectionWait) Set the time in millis to wait after a System.gc() to collect profiling information. -
isSkipGarbageCollectionOnShutdown
public boolean isSkipGarbageCollectionOnShutdown()Return true if triggering garbage collection should be skipped on shutdown. You might set this when System.GC() slows a application shutdown too much. -
setSkipGarbageCollectionOnShutdown
public void setSkipGarbageCollectionOnShutdown(boolean skipGarbageCollectionOnShutdown) Set to true if triggering garbage collection should be skipped on shutdown. You might set this when System.GC() slows a application shutdown too much. -
isSkipProfileReportingOnShutdown
public boolean isSkipProfileReportingOnShutdown()Return true if profile reporting should be skipped on shutdown. -
setSkipProfileReportingOnShutdown
public void setSkipProfileReportingOnShutdown(boolean skipProfileReportingOnShutdown) Set to true if profile reporting should be skipped on shutdown. -
loadSettings
Load the settings from the properties file.
-