public void endPrimaryTransfer(long start, boolean success, boolean isRebalance) {
    long ts = clock.getTime();
    stats.incLong(primaryTransfersInProgressId, -1);
    if (clock.isEnabled()) {
      stats.incLong(primaryTransferTimeId, ts - start);
    }
    if (success) {
      stats.incLong(primaryTransfersCompletedId, 1);
    } else {
      stats.incLong(primaryTransfersFailedId, 1);
    }
    if (isRebalance) {
      endRebalancePrimaryTransfer(start, ts, success);
    }
  }
This method sets the end time for update and updates the counters
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java