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
Abstract
LoadMetric implementation 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 -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the load capacity of this metric.intReturns the "weight" of this metric, i.e. significance of this load metric compared to the other metrics.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, waitMethods inherited from interface org.jboss.modcluster.load.metric.LoadMetric
getLoad
-
Constructor Details
-
AbstractLoadMetric
public AbstractLoadMetric()
-
-
Method Details
-
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.
-