jojochuang commented on code in PR #6782:
URL: https://github.com/apache/ozone/pull/6782#discussion_r1635867157
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/CSMMetrics.java:
##########
@@ -61,26 +63,39 @@ public class CSMMetrics {
private @Metric MutableCounterLong numDataCacheMiss;
private @Metric MutableCounterLong numDataCacheHit;
private @Metric MutableCounterLong numEvictedCacheCount;
+ private @Metric MutableCounterLong pendingApplyTransactions;
private @Metric MutableRate applyTransactionNs;
private @Metric MutableRate writeStateMachineDataNs;
+ private @Metric MutableRate untilApplyTransactionNs;
+ private @Metric MutableRate startTransactionCompleteNs;
- public CSMMetrics() {
+ public CSMMetrics(RaftGroupId gid) {
+ this.gid = gid;
int numCmdTypes = ContainerProtos.Type.values().length;
this.opsLatencyMs = new MutableRate[numCmdTypes];
+ this.opsQueueingDelay = new MutableRate[numCmdTypes];
this.registry = new MetricsRegistry(CSMMetrics.class.getSimpleName());
for (int i = 0; i < numCmdTypes; i++) {
opsLatencyMs[i] = registry.newRate(
ContainerProtos.Type.forNumber(i + 1).toString() + "Ms",
ContainerProtos.Type.forNumber(i + 1) + " op");
+ opsQueueingDelay[i] = registry.newRate(
+ "queueingDelay" + ContainerProtos.Type.forNumber(i + 1),
+ ContainerProtos.Type.forNumber(i + 1) + " op");
}
}
public static CSMMetrics create(RaftGroupId gid) {
MetricsSystem ms = DefaultMetricsSystem.instance();
return ms.register(SOURCE_NAME + gid.toString(),
Review Comment:
CSMMetrics is unregistered when the corresponding ContainerStateMachine is
closed.
Maybe we should make a singleton CSMMetrics for a DataNode.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]