Package ai.djl.serving.wlm.util
Class WlmConfigManager
- java.lang.Object
-
- ai.djl.serving.wlm.util.WlmConfigManager
-
public final class WlmConfigManager extends java.lang.ObjectThis manages some configurations used by theWorkLoadManager.
-
-
Constructor Summary
Constructors Constructor Description WlmConfigManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBatchSize()Returns the default batchSize for workers.intgetDefaultMaxWorkers(ModelInfo<?,?> modelInfo, ai.djl.Device device, int target)Returns the default maximum number of workers for a new registered model.intgetDefaultMinWorkers(ModelInfo<?,?> modelInfo, ai.djl.Device device, int minWorkers, int maxWorkers)Returns the default minimum number of workers for a new registered model.static WlmConfigManagergetInstance()Returns the singletonConfigManagerinstance.intgetJobQueueSize()Returns the default job queue size.intgetMaxBatchDelay()Returns the default maxBatchDelay for the working queue.intgetMaxIdleTime()Returns the default max idle time for workers.booleanisDebug()Returns if debug is enabled.voidsetBatchSize(int batchSize)Sets the default batchSize for workers.voidsetJobQueueSize(int jobQueueSize)Sets the default job queue size.voidsetMaxBatchDelay(int maxBatchDelay)Sets the default maxBatchDelay for the working queue.voidsetMaxIdleTime(int maxIdleTime)Sets the default max idle time for workers.
-
-
-
Method Detail
-
getInstance
public static WlmConfigManager getInstance()
Returns the singletonConfigManagerinstance.- Returns:
- the singleton
ConfigManagerinstance
-
isDebug
public boolean isDebug()
Returns if debug is enabled.- Returns:
trueif debug is enabled
-
getJobQueueSize
public int getJobQueueSize()
Returns the default job queue size.- Returns:
- the default job queue size
-
setJobQueueSize
public void setJobQueueSize(int jobQueueSize)
Sets the default job queue size.- Parameters:
jobQueueSize- the new default job queue size
-
getMaxIdleTime
public int getMaxIdleTime()
Returns the default max idle time for workers.- Returns:
- the default max idle time
-
setMaxIdleTime
public void setMaxIdleTime(int maxIdleTime)
Sets the default max idle time for workers.- Parameters:
maxIdleTime- the new default max idle time
-
getBatchSize
public int getBatchSize()
Returns the default batchSize for workers.- Returns:
- the default max idle time
-
setBatchSize
public void setBatchSize(int batchSize)
Sets the default batchSize for workers.- Parameters:
batchSize- the new default batchSize
-
getMaxBatchDelay
public int getMaxBatchDelay()
Returns the default maxBatchDelay for the working queue.- Returns:
- the default max batch delay
-
setMaxBatchDelay
public void setMaxBatchDelay(int maxBatchDelay)
Sets the default maxBatchDelay for the working queue.- Parameters:
maxBatchDelay- the new default maxBatchDelay
-
getDefaultMinWorkers
public int getDefaultMinWorkers(ModelInfo<?,?> modelInfo, ai.djl.Device device, int minWorkers, int maxWorkers)
Returns the default minimum number of workers for a new registered model.- Parameters:
modelInfo- theModelInfodevice- the device that model loaded onminWorkers- the minimum number of workers of a new registered modelmaxWorkers- the maximum number of workers of a new registered model- Returns:
- the calculated minimum number of workers for a new registered model
-
getDefaultMaxWorkers
public int getDefaultMaxWorkers(ModelInfo<?,?> modelInfo, ai.djl.Device device, int target)
Returns the default maximum number of workers for a new registered model.- Parameters:
modelInfo- theModelInfodevice- the device that model loaded ontarget- the target number of worker- Returns:
- the default number of workers for a new registered model
-
-