Ivan Zlenko created HDDS-13555:
----------------------------------
Summary: Remove redundant field for metrics registry
Key: HDDS-13555
URL: https://issues.apache.org/jira/browse/HDDS-13555
Project: Apache Ozone
Issue Type: Improvement
Reporter: Ivan Zlenko
Right now we always maintain a field for metrics registry, though it feels like
it is completely redundant here.
We need to refactor this place, to clean up smelly code.
Example of such field could be found in XceiverClientMetrics.class:
{code:java}
public class XceiverClientMetrics implements MetricsSource {
public static final String SOURCE_NAME = XceiverClientMetrics.class
.getSimpleName();
private @Metric MutableCounterLong pendingOps;
private @Metric MutableCounterLong totalOps;
private @Metric MutableCounterLong ecReconstructionTotal;
private @Metric MutableCounterLong ecReconstructionFailsTotal;
private EnumMap<ContainerProtos.Type, MutableCounterLong> pendingOpsArray;
private EnumMap<ContainerProtos.Type, MutableCounterLong> opsArray;
private EnumMap<ContainerProtos.Type, PerformanceMetrics> containerOpsLatency;
private MetricsRegistry registry;
private int[] intervals;
public XceiverClientMetrics() {
OzoneConfiguration conf = new OzoneConfiguration();
intervals =
conf.getInts(OzoneConfigKeys.OZONE_XCEIVER_CLIENT_METRICS_PERCENTILES_INTERVALS_SECONDS_KEY);
init();
}
public void init() {
this.registry = new MetricsRegistry(SOURCE_NAME);
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]