ChenSammi commented on a change in pull request #2438: URL: https://github.com/apache/ozone/pull/2438#discussion_r675270682
########## File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/ScmBlockDeletingServiceMetrics.java ########## @@ -0,0 +1,179 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.hadoop.hdds.scm.block; + +import org.apache.hadoop.metrics2.MetricsSystem; +import org.apache.hadoop.metrics2.annotation.Metric; +import org.apache.hadoop.metrics2.annotation.Metrics; +import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; +import org.apache.hadoop.metrics2.lib.MutableCounterLong; + +/** + * Metrics related to Block Deleting Service running in SCM. + */ +@Metrics(name = "ScmBlockDeletingService Metrics", about = "Metrics related to " + + "background block deleting service in SCM", context = "SCM") +public final class ScmBlockDeletingServiceMetrics { + + private static ScmBlockDeletingServiceMetrics instance; + public static final String SOURCE_NAME = + SCMBlockDeletingService.class.getSimpleName(); + + /** + * Without command retry and command loss, for a brand new cluster. + * deleteTxSent = deleteTxSuccess + deleteTxFailure + * deleteTxCreated = deleteTxCompleted + * deleteTxSent = deleteTxCreated * replication factor + * deleteTxCmdSent = deleteTxCmdSuccess + deleteTxCmdFailure + * + * With command retry and command loss. + * deleteTxSent >= deleteTxSuccess + deleteTxFailure + * deleteTxCreated = deleteTxCompleted + * deleteTxSent >= deleteTxCreated * replication factor + * deleteTxCmdSent >= deleteTxCmdSuccess + deleteTxCmdFailure + */ Review comment: Now I get your point. The statement here I added is for the delete commands all completed case, just as the metrics check at the end of the related UT. For a running system, you are right, when new transactions are comming, deleteTxCreated will be greater than deleteTxCompleted, and deleteTxSent will be greater than deleteTxSuccess + deleteTxFailure. I will add more explain here to avoid further confusing. -- 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]
