Class AbstractLoadMetric
- java.lang.Object
-
- org.jboss.modcluster.load.metric.impl.AbstractLoadMetric
-
- All Implemented Interfaces:
LoadMetric,LoadMetricMBean
- Direct Known Subclasses:
AbstractMBeanLoadMetric,ActiveSessionsLoadMetric,AverageSystemLoadMetric,BusyConnectorsLoadMetric,HeapMemoryUsageLoadMetric,ReceiveTrafficLoadMetric,RequestCountLoadMetric,SendTrafficLoadMetric
public abstract class AbstractLoadMetric extends Object implements LoadMetric
AbstractLoadMetricimplementation with basic mutators/accessors.- Author:
- Paul Ferraro
-
-
Field Summary
-
Fields inherited from interface org.jboss.modcluster.load.metric.LoadMetric
DEFAULT_CAPACITY, DEFAULT_WEIGHT
-
-
Constructor Summary
Constructors Constructor Description AbstractLoadMetric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetCapacity()Returns the load capacity of this metric.intgetWeight()Returns the "weight" of this metric, i.e.voidsetCapacity(double capacity)Sets the maximum capacity of this metric.voidsetWeight(int weight)Sets the weight of the metric relative to the other metrics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.modcluster.load.metric.LoadMetric
getLoad
-
-
-
-
Method Detail
-
getWeight
public int getWeight()
Description copied from interface:LoadMetricMBeanReturns the "weight" of this metric, i.e. significance of this load metric compared to the other metrics.- Specified by:
getWeightin interfaceLoadMetricMBean- Returns:
- the weight of the metric
-
setWeight
public void setWeight(int weight)
Description copied from interface:LoadMetricMBeanSets the weight of the metric relative to the other metrics. Defaults to 1.- Specified by:
setWeightin interfaceLoadMetricMBean- Parameters:
weight- weight of the metric.
-
getCapacity
public double getCapacity()
Description copied from interface:LoadMetricMBeanReturns the load capacity of this metric. Used to normalize the value returned byLoadMetric.getLoad(org.jboss.modcluster.container.Engine)expressed as a percentage of the capacity, such that: 0 <= (LoadMetric.getLoad(org.jboss.modcluster.container.Engine)/LoadMetricMBean.getCapacity()) < 1- Specified by:
getCapacityin interfaceLoadMetricMBean- Returns:
- the estimated capacity of this metric.
-
setCapacity
public void setCapacity(double capacity)
Description copied from interface:LoadMetricMBeanSets the maximum capacity of this metric. Used for metrics that do not have an implicit capacity and need to be configured. Defaults to 1.- Specified by:
setCapacityin interfaceLoadMetricMBean- Parameters:
capacity- non-negative capacity of the metric.
-
-