Package org.apache.pekko.cluster.metrics
Class CapacityMetricsSelector
java.lang.Object
org.apache.pekko.cluster.metrics.CapacityMetricsSelector
- All Implemented Interfaces:
Serializable,MetricsSelector
- Direct Known Subclasses:
CpuMetricsSelector$,HeapMetricsSelector$,MixMetricsSelectorBase,SystemLoadAverageMetricsSelector$
A MetricsSelector producing weights from remaining capacity.
The weights are typically proportional to the remaining capacity.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncapacity(scala.collection.immutable.Set<NodeMetrics> nodeMetrics) Remaining capacity for each node.Converts the capacity values to weights.weights(scala.collection.immutable.Set<NodeMetrics> nodeMetrics) The weights per address, based on the capacity produced by the nodeMetrics.
-
Constructor Details
-
CapacityMetricsSelector
public CapacityMetricsSelector()
-
-
Method Details
-
capacity
public abstract scala.collection.immutable.Map<Address,Object> capacity(scala.collection.immutable.Set<NodeMetrics> nodeMetrics) Remaining capacity for each node. The value is between 0.0 and 1.0, where 0.0 means no remaining capacity (full utilization) and 1.0 means full remaining capacity (zero utilization). -
weights
public scala.collection.immutable.Map<Address,Object> weights(scala.collection.immutable.Map<Address, Object> capacity) Converts the capacity values to weights. The node with lowest capacity gets weight 1 (lowest usable capacity is 1%) and other nodes gets weights proportional to their capacity compared to the node with lowest capacity. -
weights
public scala.collection.immutable.Map<Address,Object> weights(scala.collection.immutable.Set<NodeMetrics> nodeMetrics) The weights per address, based on the capacity produced by the nodeMetrics.- Specified by:
weightsin interfaceMetricsSelector
-