@ThreadSafe public class BrokerResourceMetric extends Object
metricName
which tracks a given BrokerResourceStats
snapshot from the goalName
's optimization run.
The metric itself can change throughout this object's lifecycle (become null, have a different broker id or different value),
and this object takes care of cleaning up any stale metrics.Modifier and Type | Class and Description |
---|---|
static class |
BrokerResourceMetric.Builder |
Modifier and Type | Method and Description |
---|---|
void |
updateResource(BrokerResourceStats resource)
Updates the
BrokerResourceStats this metric should track with the latest value. |
public void updateResource(BrokerResourceStats resource)
BrokerResourceStats
this metric should track with the latest value.
If it is a new metric, deletes the old metric and registers the new one.
A new metric is defined as a metric that represents a different BrokerResourceStats.brokerId
.resource
- - nullable, the latest broker resource to register