public void removeLagMetricForPartition(PartitionId partitionId) {
    if (partitionLags.containsKey(partitionId)) {
      registry.remove(MetricRegistry.name(ReplicaThread.class,
          String.format(MAX_LAG_FROM_PEERS_IN_BYTE_METRIC_NAME_TEMPLATE, partitionId.toPathString())));
    }
  }
Remove replication lag metric of given partition if it's present.
@param partitionId the given partition whose lag metric should be removed.
ambry-replication/src/main/java/com/github/ambry/replication/ReplicationMetrics.java