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
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the load capacity of this metric.int
Returns the "weight" of this metric, i.e.void
setCapacity
(double capacity) Sets the maximum capacity of this metric.void
setWeight
(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
-
Constructor Details
-
AbstractLoadMetric
public AbstractLoadMetric()
-
-
Method Details
-
getWeight
public int getWeight()Description copied from interface:LoadMetricMBean
Returns the "weight" of this metric, i.e. significance of this load metric compared to the other metrics.- Specified by:
getWeight
in interfaceLoadMetricMBean
- Returns:
- the weight of the metric
-
setWeight
public void setWeight(int weight) Description copied from interface:LoadMetricMBean
Sets the weight of the metric relative to the other metrics. Defaults to 1.- Specified by:
setWeight
in interfaceLoadMetricMBean
- Parameters:
weight
- weight of the metric.
-
getCapacity
public double getCapacity()Description copied from interface:LoadMetricMBean
Returns 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:
getCapacity
in interfaceLoadMetricMBean
- Returns:
- the estimated capacity of this metric.
-
setCapacity
public void setCapacity(double capacity) Description copied from interface:LoadMetricMBean
Sets 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:
setCapacity
in interfaceLoadMetricMBean
- Parameters:
capacity
- non-negative capacity of the metric.
-