Class DefaultAutoTuneService
- All Implemented Interfaces:
io.ebean.AutoTune,io.ebeaninternal.server.autotune.AutoTuneService
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAutoTuneService(io.ebeaninternal.api.SpiEbeanServer server, io.ebean.DatabaseBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptionvoidAsk for a System.gc() so that we gather node usage information.voidcollectProfiling(long waitMillis) voidOutput 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 Details
-
DefaultAutoTuneService
public DefaultAutoTuneService(io.ebeaninternal.api.SpiEbeanServer server, io.ebean.DatabaseBuilder builder)
-
-
Method Details
-
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
-