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 LoadMetric
s.- Author:
- Paul Ferraro, Radoslav Husar
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
static final int
static final int
-
Constructor Summary
ConstructorDescriptionDynamicLoadBalanceFactorProvider
(Set<LoadMetric> metrics) DynamicLoadBalanceFactorProvider
(Set<LoadMetric> metrics, int initialLoad) -
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the exponential decay factor.int
Returns the history count.int
getLoadBalanceFactor
(Engine engine) Returns the load metrics registered with this providervoid
setDecayFactor
(float decayFactor) Sets the exponential decay factor to be applied to historical load values.void
setHistory
(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:DynamicLoadBalanceFactorProviderMBean
Returns the load metrics registered with this provider- Specified by:
getMetrics
in interfaceDynamicLoadBalanceFactorProviderMBean
- Returns:
- a collection of load metrics
-
getLoadBalanceFactor
- Specified by:
getLoadBalanceFactor
in interfaceLoadBalanceFactorProvider
-
getDecayFactor
public float getDecayFactor()Description copied from interface:DynamicLoadBalanceFactorProviderMBean
Returns the exponential decay factor.- Specified by:
getDecayFactor
in interfaceDynamicLoadBalanceFactorProviderMBean
- Returns:
- a positive integer
-
setDecayFactor
public void setDecayFactor(float decayFactor) Description copied from interface:DynamicLoadBalanceFactorProviderMBean
Sets the exponential decay factor to be applied to historical load values.- Specified by:
setDecayFactor
in interfaceDynamicLoadBalanceFactorProviderMBean
- Parameters:
decayFactor
- the new decay factor
-
getHistory
public int getHistory()Description copied from interface:DynamicLoadBalanceFactorProviderMBean
Returns the history count.- Specified by:
getHistory
in interfaceDynamicLoadBalanceFactorProviderMBean
- Returns:
- a positive integer
-
setHistory
public void setHistory(int history) Description copied from interface:DynamicLoadBalanceFactorProviderMBean
Sets the number of historical load values to consider when calculating the load balance factor.- Specified by:
setHistory
in interfaceDynamicLoadBalanceFactorProviderMBean
-