private float getPrimaryAverage() {
    if (primaryAverage == -1) {
      float totalWeight = 0;
      float totalPrimaryCount = 0;
      for (Member member : members.values()) {
        totalPrimaryCount += member.getPrimaryLoad();
        totalWeight += member.getWeight();
      }

      primaryAverage = totalPrimaryCount / totalWeight;
    }

    return primaryAverage;
  }
Calculate the target weighted number of primaries on each node.
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/model/PartitionedRegionLoadModel.java