private synchronized ConnectionStats getStats(ServerLocationAndMemberId location) {
    ConnectionStats stats = statMap.get(location);
    if (stats == null) {
      PoolImpl pool = (PoolImpl) PoolManager.find(poolName);
      if (pool != null) {
        if (pool.getGatewaySender() != null) {
          String statName = pool.getGatewaySender().getId() + "-" + location.toString();
          stats = new ConnectionStats(ds, "GatewaySender", statName, poolStats);
        }
      }
      if (stats == null) {
        String statName = poolName + "-" + location.toString();
        stats = new ConnectionStats(ds, "Client", statName, poolStats);
      }
      statMap.put(location, stats);
    }

    return stats;
  }
Used by Endpoint only, when the reference count for this endpoint reaches 0
geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java