Skip to content
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 @@ -121,7 +121,7 @@ public boolean completeAddReplica(ContainerID containerID,
boolean completed = completeOp(ADD, containerID, target, replicaIndex);
if (isMetricsNotNull() && completed) {
if (replicaIndex > 0) {
replicationMetrics.incrEcReplicationCmdsCompletedTotal();
replicationMetrics.incrEcReplicasCreatedTotal();
} else if (replicaIndex == 0) {
replicationMetrics.incrNumReplicationCmdsCompleted();
}
Expand All @@ -143,7 +143,7 @@ public boolean completeDeleteReplica(ContainerID containerID,
boolean completed = completeOp(DELETE, containerID, target, replicaIndex);
if (isMetricsNotNull() && completed) {
if (replicaIndex > 0) {
replicationMetrics.incrEcDeletionCmdsCompletedTotal();
replicationMetrics.incrEcReplicasDeletedTotal();
} else if (replicaIndex == 0) {
replicationMetrics.incrNumDeletionCmdsCompleted();
}
Expand Down Expand Up @@ -214,13 +214,13 @@ public void removeExpiredEntries(long expiryMilliSeconds) {
private void updateTimeoutMetrics(ContainerReplicaOp op) {
if (op.getOpType() == ADD && isMetricsNotNull()) {
if (op.getReplicaIndex() > 0) {
replicationMetrics.incrEcReplicationCmdsTimeoutTotal();
replicationMetrics.incrEcReplicaCreateTimeoutTotal();
} else if (op.getReplicaIndex() == 0) {
replicationMetrics.incrNumReplicationCmdsTimeout();
}
} else if (op.getOpType() == DELETE && isMetricsNotNull()) {
if (op.getReplicaIndex() > 0) {
replicationMetrics.incrEcDeletionCmdsTimeoutTotal();
replicationMetrics.incrEcReplicaDeleteTimeoutTotal();
} else if (op.getReplicaIndex() == 0) {
replicationMetrics.incrNumDeletionCmdsTimeout();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,23 @@ public final class ReplicationManagerMetrics implements MetricsSource {
@Metric("Number of EC Replication commands sent.")
private MutableCounterLong ecReplicationCmdsSentTotal;

@Metric("Number of EC Deletion commands timeout.")
@Metric("Number of EC Replica Deletion commands sent.")
private MutableCounterLong ecDeletionCmdsSentTotal;

@Metric("Number of EC Replication commands completed.")
private MutableCounterLong ecReplicationCmdsCompletedTotal;

@Metric("Number of EC Deletion commands completed.")
private MutableCounterLong ecDeletionCmdsCompletedTotal;

@Metric("Number of EC Deletion commands completed.")
@Metric("Number of EC Reconstruction commands sent.")
private MutableCounterLong ecReconstructionCmdsSentTotal;

@Metric("Number of EC Replication commands timeout.")
private MutableCounterLong ecReplicationCmdsTimeoutTotal;
@Metric("Number of EC replicas successfully created by Replication Manager.")
private MutableCounterLong ecReplicasCreatedTotal;

@Metric("Number of EC replicas successfully deleted by Replication Manager.")
private MutableCounterLong ecReplicasDeletedTotal;

@Metric("Number of EC Deletion commands timeout.")
private MutableCounterLong ecDeletionCmdsTimeoutTotal;
@Metric("Number of EC replicas scheduled to be created which timed out.")
private MutableCounterLong ecReplicaCreateTimeoutTotal;

@Metric("Number of EC replicas scheduled for delete which timed out.")
private MutableCounterLong ecReplicaDeleteTimeoutTotal;

public ReplicationManagerMetrics(ReplicationManager manager) {
this.registry = new MetricsRegistry(METRICS_SOURCE_NAME);
Expand Down Expand Up @@ -219,11 +218,11 @@ public void getMetrics(MetricsCollector collector, boolean all) {
deletionTime.snapshot(builder, all);
ecReplicationCmdsSentTotal.snapshot(builder, all);
ecDeletionCmdsSentTotal.snapshot(builder, all);
ecReplicationCmdsCompletedTotal.snapshot(builder, all);
ecDeletionCmdsCompletedTotal.snapshot(builder, all);
ecReplicasCreatedTotal.snapshot(builder, all);
ecReplicasDeletedTotal.snapshot(builder, all);
ecReconstructionCmdsSentTotal.snapshot(builder, all);
ecReplicationCmdsTimeoutTotal.snapshot(builder, all);
ecDeletionCmdsTimeoutTotal.snapshot(builder, all);
ecReplicaCreateTimeoutTotal.snapshot(builder, all);
ecReplicasDeletedTotal.snapshot(builder, all);
}

public void unRegister() {
Expand Down Expand Up @@ -361,12 +360,12 @@ public void incrEcDeletionCmdsSentTotal() {
this.ecDeletionCmdsSentTotal.incr();
}

public void incrEcReplicationCmdsCompletedTotal() {
this.ecReplicationCmdsCompletedTotal.incr();
public void incrEcReplicasCreatedTotal() {
this.ecReplicasCreatedTotal.incr();
}

public void incrEcDeletionCmdsCompletedTotal() {
this.ecDeletionCmdsCompletedTotal.incr();
public void incrEcReplicasDeletedTotal() {
this.ecReplicasDeletedTotal.incr();
}

public void incrEcReconstructionCmdsSentTotal() {
Expand All @@ -383,8 +382,8 @@ public long getEcDeletion() {
.getPendingOpCount(ContainerReplicaOp.PendingOpType.DELETE);
}

public void incrEcReplicationCmdsTimeoutTotal() {
this.ecReplicationCmdsTimeoutTotal.incr();
public void incrEcReplicaCreateTimeoutTotal() {
this.ecReplicaCreateTimeoutTotal.incr();
}

public long getEcDeletionCmdsSentTotal() {
Expand All @@ -399,23 +398,23 @@ public long getEcReplicationCmdsSentTotal() {
return ecReplicationCmdsSentTotal.value();
}

public void incrEcDeletionCmdsTimeoutTotal() {
this.ecDeletionCmdsTimeoutTotal.incr();
public void incrEcReplicaDeleteTimeoutTotal() {
this.ecReplicaDeleteTimeoutTotal.incr();
}

public long getEcReplicationCmdsTimeoutTotal() {
return ecReplicationCmdsTimeoutTotal.value();
public long getEcReplicaCreateTimeoutTotal() {
return ecReplicaCreateTimeoutTotal.value();
}

public long getEcDeletionCmdsTimeoutTotal() {
return ecDeletionCmdsTimeoutTotal.value();
public long getEcReplicaDeleteTimeoutTotal() {
return ecReplicaDeleteTimeoutTotal.value();
}

public long getEcReplicationCmdsCompletedTotal() {
return ecReplicationCmdsCompletedTotal.value();
public long getEcReplicasCreatedTotal() {
return ecReplicasCreatedTotal.value();
}

public long getEcDeletionCmdsCompletedTotal() {
return ecDeletionCmdsCompletedTotal.value();
public long getEcReplicasDeletedTotal() {
return ecReplicasDeletedTotal.value();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ public void testReplicationMetrics() {
pendingOps.removeExpiredEntries(1000);

// Two Delete and Replication command should be timeout
Assertions.assertEquals(metrics.getEcReplicationCmdsTimeoutTotal(), 2);
Assertions.assertEquals(metrics.getEcDeletionCmdsTimeoutTotal(), 2);
Assertions.assertEquals(metrics.getEcReplicaCreateTimeoutTotal(), 2);
Assertions.assertEquals(metrics.getEcReplicaDeleteTimeoutTotal(), 2);

pendingOps.scheduleDeleteReplica(new ContainerID(3), dn1, 2);
pendingOps.scheduleAddReplica(new ContainerID(3), dn1, 3);
Expand All @@ -262,8 +262,8 @@ public void testReplicationMetrics() {
pendingOps.completeDeleteReplica(new ContainerID(4), dn2, 2);
pendingOps.completeAddReplica(new ContainerID(4), dn3, 4);

Assertions.assertEquals(metrics.getEcReplicationCmdsCompletedTotal(), 2);
Assertions.assertEquals(metrics.getEcDeletionCmdsCompletedTotal(), 2);
Assertions.assertEquals(metrics.getEcReplicasCreatedTotal(), 2);
Assertions.assertEquals(metrics.getEcReplicasDeletedTotal(), 2);

pendingOps.completeDeleteReplica(new ContainerID(3), dn1, 2);
pendingOps.completeAddReplica(new ContainerID(2), dn1, 3);
Expand Down