Module io.ebean.api

Class AutoTuneConfig

java.lang.Object
io.ebean.config.AutoTuneConfig

public class AutoTuneConfig extends Object
Defines the AutoTune behaviour for a Database.
  • 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

      public String getQueryTuningFile()
      Return the name of the file that holds the query tuning information.
    • setQueryTuningFile

      public void setQueryTuningFile(String queryTuningFile)
      Set the name of the file that holds the query tuning information.
    • getProfilingFile

      public String getProfilingFile()
      Return the name of the file that profiling information is written to.
    • setProfilingFile

      public void setProfilingFile(String profilingFile)
      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

      public AutoTuneMode getMode()
      Return the mode used when autoTune has not been explicit defined on a query.
    • setMode

      public void setMode(AutoTuneMode mode)
      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

      public void loadSettings(PropertiesWrapper p)
      Load the settings from the properties file.