Class DefaultAutoTuneService
- java.lang.Object
-
- io.ebeaninternal.server.autotune.service.DefaultAutoTuneService
-
- All Implemented Interfaces:
io.ebean.AutoTune,io.ebeaninternal.server.autotune.AutoTuneService
public class DefaultAutoTuneService extends Object implements io.ebeaninternal.server.autotune.AutoTuneService
Implementation of the AutoTuneService which is comprised of profiling and query tuning.
-
-
Constructor Summary
Constructors Constructor Description DefaultAutoTuneService(io.ebeaninternal.api.SpiEbeanServer server, io.ebean.config.DatabaseConfig databaseConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollectProfiling()Ask for a System.gc() so that we gather node usage information.voidcollectProfiling(long waitMillis)voidreportProfiling()Output the profiling.voidshutdown()Shutdown the listener.voidstartup()Load the query tuning information from it's data store.booleantuneQuery(io.ebeaninternal.api.SpiQuery<?> query)Auto tune the query and enable profiling.
-
-
-
Constructor Detail
-
DefaultAutoTuneService
public DefaultAutoTuneService(io.ebeaninternal.api.SpiEbeanServer server, io.ebean.config.DatabaseConfig databaseConfig)
-
-
Method Detail
-
startup
public void startup()
Load the query tuning information from it's data store.- Specified by:
startupin interfaceio.ebeaninternal.server.autotune.AutoTuneService
-
shutdown
public void shutdown()
Shutdown the listener.We should try to collect the usage statistics by calling a System.gc(). This is necessary for use with short lived applications where garbage collection may not otherwise occur at all.
- Specified by:
shutdownin interfaceio.ebeaninternal.server.autotune.AutoTuneService
-
reportProfiling
public void reportProfiling()
Output the profiling.When profiling updates are applied to tuning at runtime this reports all tuning and profiling combined. When profiling is not applied at runtime then this reports the diff report with new and diff entries relative to the existing tuning.
- Specified by:
reportProfilingin interfaceio.ebean.AutoTune
-
collectProfiling
public void collectProfiling()
Ask for a System.gc() so that we gather node usage information.Really only want to do this sparingly but useful just prior to shutdown for short run application where garbage collection may otherwise not occur at all.
waitMillis will do a thread sleep to give the garbage collection a little time to do its thing assuming we are shutting down the VM.
If waitMillis is -1 then the defaultGarbageCollectionWait is used which defaults to 100 milliseconds.
- Specified by:
collectProfilingin interfaceio.ebean.AutoTune- Specified by:
collectProfilingin interfaceio.ebeaninternal.server.autotune.AutoTuneService
-
collectProfiling
public void collectProfiling(long waitMillis)
-
tuneQuery
public boolean tuneQuery(io.ebeaninternal.api.SpiQuery<?> query)
Auto tune the query and enable profiling.- Specified by:
tuneQueryin interfaceio.ebeaninternal.server.autotune.AutoTuneService
-
-