private void updateAperture(int newValue,long now){
  int previous=targetAperture;
  targetAperture=newValue;
  targetAperture=Math.max(minAperture,targetAperture);
  int maxAperture=Math.min(this.maxAperture,activeSockets.size() + activeFactories.size());
  targetAperture=Math.min(maxAperture,targetAperture);
  lastApertureRefresh=now;
  pendings.reset((minPendings + maxPendings) / 2);
  if (targetAperture != previous) {
    logger.debug("Current pending={}, new target={}, previous target={}",pendings.value(),targetAperture,previous);
  }
}

private void updateAperture ( int newValue , long now ) { int previous = targetAperture ; targetAperture = newValue ; targetAperture = Math . max ( minAperture , targetAperture ) ; int maxAperture = Math . min ( this . maxAperture , activeSockets . size ( ) + activeFactories . size ( ) ) ; targetAperture = Math . min ( maxAperture , targetAperture ) ; lastApertureRefresh = now ; pendings . reset ( ( minPendings + maxPendings ) / 2 ) ; if ( targetAperture != previous ) { logger . debug ( "Current pending={}, new target={}, previous target={}" , pendings . value ( ) , targetAperture , previous ) ; } }
update the aperture value and ensure its value stays in the right range .
