Package org.jboss.modcluster.load.impl
Class DynamicLoadBalanceFactorProvider
java.lang.Object
org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider
- All Implemented Interfaces:
DynamicLoadBalanceFactorProviderMBean,LoadBalanceFactorProvider
public class DynamicLoadBalanceFactorProvider
extends Object
implements LoadBalanceFactorProvider, DynamicLoadBalanceFactorProviderMBean
LoadBalanceFactorProvider implementation that periodically aggregates load from a set of LoadMetrics.- Author:
- Paul Ferraro, Radoslav Husar
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionDynamicLoadBalanceFactorProvider(Set<LoadMetric> metrics) DynamicLoadBalanceFactorProvider(Set<LoadMetric> metrics, int initialLoad) -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the exponential decay factor.intReturns the history count.intgetLoadBalanceFactor(Engine engine) Returns the load metrics registered with this providervoidsetDecayFactor(float decayFactor) Sets the exponential decay factor to be applied to historical load values.voidsetHistory(int history) Sets the number of historical load values to consider when calculating the load balance factor.
-
Field Details
-
DEFAULT_INITIAL_LOAD
public static final int DEFAULT_INITIAL_LOAD- See Also:
-
DEFAULT_DECAY_FACTOR
public static final float DEFAULT_DECAY_FACTOR- See Also:
-
DEFAULT_HISTORY
public static final int DEFAULT_HISTORY- See Also:
-
-
Constructor Details
-
DynamicLoadBalanceFactorProvider
-
DynamicLoadBalanceFactorProvider
-
-
Method Details
-
getMetrics
Description copied from interface:DynamicLoadBalanceFactorProviderMBeanReturns the load metrics registered with this provider- Specified by:
getMetricsin interfaceDynamicLoadBalanceFactorProviderMBean- Returns:
- a collection of load metrics
-
getLoadBalanceFactor
- Specified by:
getLoadBalanceFactorin interfaceLoadBalanceFactorProvider
-
getDecayFactor
public float getDecayFactor()Description copied from interface:DynamicLoadBalanceFactorProviderMBeanReturns the exponential decay factor.- Specified by:
getDecayFactorin interfaceDynamicLoadBalanceFactorProviderMBean- Returns:
- a positive integer
-
setDecayFactor
public void setDecayFactor(float decayFactor) Description copied from interface:DynamicLoadBalanceFactorProviderMBeanSets the exponential decay factor to be applied to historical load values.- Specified by:
setDecayFactorin interfaceDynamicLoadBalanceFactorProviderMBean- Parameters:
decayFactor- the new decay factor
-
getHistory
public int getHistory()Description copied from interface:DynamicLoadBalanceFactorProviderMBeanReturns the history count.- Specified by:
getHistoryin interfaceDynamicLoadBalanceFactorProviderMBean- Returns:
- a positive integer
-
setHistory
public void setHistory(int history) Description copied from interface:DynamicLoadBalanceFactorProviderMBeanSets the number of historical load values to consider when calculating the load balance factor.- Specified by:
setHistoryin interfaceDynamicLoadBalanceFactorProviderMBean
-