public class CpuUsageStrategyFactory extends ArrayBasedStrategyFactory
| Modifier and Type | Field and Description |
|---|---|
protected int |
lowCpuUsage
lowCpuUsage ~= zero CPU usage
|
protected int |
sampleCount
This strategy compares number of 'sampleCount' random node.
|
protected Transporter |
transporter |
preferLocalbroker, logger, name| Constructor and Description |
|---|
CpuUsageStrategyFactory() |
CpuUsageStrategyFactory(boolean preferLocal) |
CpuUsageStrategyFactory(boolean preferLocal,
int sampleCount,
int lowCpuUsage) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Endpoint> |
create() |
int |
getLowCpuUsage() |
int |
getSampleCount() |
void |
setLowCpuUsage(int lowCpuUsage) |
void |
setSampleCount(int sampleCount) |
void |
started(ServiceBroker broker)
Initializes strategy instance.
|
isPreferLocal, setPreferLocalgetBroker, getLogger, getName, stoppedprotected int sampleCount
protected int lowCpuUsage
protected Transporter transporter
public CpuUsageStrategyFactory()
public CpuUsageStrategyFactory(boolean preferLocal)
public CpuUsageStrategyFactory(boolean preferLocal,
int sampleCount,
int lowCpuUsage)
public void started(ServiceBroker broker) throws java.lang.Exception
started in class MoleculerComponentbroker - parent ServiceBrokerjava.lang.Exceptionpublic <T extends Endpoint> Strategy<T> create()
create in class StrategyFactorypublic int getSampleCount()
public void setSampleCount(int sampleCount)
public int getLowCpuUsage()
public void setLowCpuUsage(int lowCpuUsage)