code: private void updateReplicationMetrics(List<ReplicationWork> work) {
      for(ReplicationWork rw : work){
        DatanodeDescriptor[] targets = rw.targets;
        if (targets == null) continue;
        for (DatanodeDescriptor target : targets) {
          if (clusterMap.isOnSameRack(rw.srcNode, target)) {
            myFSMetrics.numLocalRackReplications.inc();
          } else {
            myFSMetrics.numAcrossRackReplications.inc();
          }
        }
      }
    }
docs: Update replication metrics
  
  @param work record for all scheduled replication