Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11779. Add DN metrics to show deletion progress #7552

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public final class BlockDeletingServiceMetrics {
@Metric(about = "The total number of DeleteBlockTransaction received")
private MutableCounterLong receivedTransactionCount;

@Metric(about = "The total number of DeleteBlockTransaction" +
" that is a retry Transaction")
@Metric(about = "The total number of DeleteBlockTransaction that is a retry Transaction")
private MutableCounterLong receivedRetryTransactionCount;

@Metric(about = "The total number of Container received to be processed")
Expand All @@ -74,10 +73,15 @@ public final class BlockDeletingServiceMetrics {
@Metric(about = "The total number of Container chosen to be deleted.")
private MutableGaugeLong totalContainerChosenCount;

@Metric(about = "The total number of transactions which failed due" +
" to container lock wait timeout.")
@Metric(about = "The total number of transactions which failed due to container lock wait timeout.")
private MutableGaugeLong totalLockTimeoutTransactionCount;

@Metric(about = "The number of delete block transactions successful.")
private MutableCounterLong processedTransactionSuccessCount;

@Metric(about = "The number of delete block transactions failed.")
private MutableGaugeLong processedTransactionFailCount;

private BlockDeletingServiceMetrics() {
}

Expand Down Expand Up @@ -112,6 +116,14 @@ public void incrFailureCount() {
this.failureCount.incr();
}

public void incrProcessedTransactionSuccessCount(long count) {
processedTransactionSuccessCount.incr(count);
}

public void incrProcessedTransactionFailCount(long count) {
processedTransactionFailCount.incr(count);
}

public void incrReceivedTransactionCount(long count) {
receivedTransactionCount.incr(count);
}
Expand Down Expand Up @@ -184,6 +196,14 @@ public long getTotalLockTimeoutTransactionCount() {
return totalLockTimeoutTransactionCount.value();
}

public long getProcessedTransactionSuccessCount() {
return processedTransactionSuccessCount.value();
}

public long getProcessedTransactionFailCount() {
return processedTransactionFailCount.value();
}

@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
Expand All @@ -202,6 +222,10 @@ public String toString() {
+ receivedTransactionCount.value()).append("\t")
.append("receivedRetryTransactionCount = "
+ receivedRetryTransactionCount.value()).append("\t")
.append("processedTransactionSuccessCount = "
+ processedTransactionSuccessCount.value()).append("\t")
.append("processedTransactionFailCount = "
+ processedTransactionFailCount.value()).append("\t")
.append("receivedContainerCount = "
+ receivedContainerCount.value()).append("\t")
.append("receivedBlockCount = "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,14 @@ private void processCmd(DeleteCmdInfo cmd) {
LOG.debug("Sending following block deletion ACK to SCM");
for (DeleteBlockTransactionResult result : blockDeletionACK
.getResultsList()) {
boolean success = result.getSuccess();
LOG.debug("TxId = {} : ContainerId = {} : {}",
result.getTxID(), result.getContainerID(), result.getSuccess());
result.getTxID(), result.getContainerID(), success);
if (success) {
blockDeleteMetrics.incrProcessedTransactionSuccessCount(1);
} else {
blockDeleteMetrics.incrProcessedTransactionFailCount(1);
}
}
}
}
Expand Down
Loading