code: public Map<PoolInfo, Long> getTypePoolInfoAveFirstWaitMs(ResourceType type) {
      Map<PoolInfo, WaitCount> poolInfoWaitCount =
          new HashMap<PoolInfo, WaitCount>();
      for (Session session : sessions.values()) {
        synchronized (session) {
          if (!session.isDeleted()) {
            Long wait = session.getTypeFirstWaitMs(type);
            if (wait == null) {
              continue;
            }
  
            WaitCount waitCount = poolInfoWaitCount.get(session.getPoolInfo());
            if (waitCount == null) {
              poolInfoWaitCount.put(session.getPoolInfo(),
                                    new WaitCount(wait));
            } else {
              waitCount.addWaitMsecs(wait);
            }
          }
        }
      }
      Map<PoolInfo, Long> poolInfoWaitMs =
          new HashMap<PoolInfo, Long>(poolInfoWaitCount.size());
      for (Map.Entry<PoolInfo, WaitCount> entry : poolInfoWaitCount.entrySet()) {
        poolInfoWaitMs.put(entry.getKey(), entry.getValue().getAverageWait());
      }
      return poolInfoWaitMs;
    }
docs: Get a map of pool infos to average wait times for first
  resource of a resource type.
  @param type Resource type
  @return Map of pools into average first resource time