code: public static ScalingPolicy byDataRate(int targetKBps, int scaleFactor, int minNumSegments) {
          Preconditions.checkArgument(targetKBps > 0, "KBps should be > 0.");
          Preconditions.checkArgument(scaleFactor > 0, "Scale factor should be > 0. Otherwise use fixed scaling policy.");
          Preconditions.checkArgument(minNumSegments > 0, "Minimum number of segments should be > 0.");
          return new ScalingPolicy(ScaleType.BY_RATE_IN_KBYTES_PER_SEC, targetKBps, scaleFactor, minNumSegments);
      }
docs: Create a scaling policy to configure a stream to scale up and down according
  to byte rate. Pravega scales a stream segment up in the case that one of these
  conditions holds:
  - The two-minute rate is greater than 5x the target rate
  - The five-minute rate is greater than 2x the target rate
  - The ten-minute rate is greater than the target rate
  
  It scales a segment down (merges with a neighbor segment) in the case that
  both these conditions hold:
  - The two-, five-, ten-minute rate is smaller than the target rate
  - The twenty-minute rate is smaller than half of the target rate
  
  We additionally consider a cool-down period during which the segment is not
  considered for scaling. This period is determined by the configuration
  parameter autoScale.cooldownInSeconds; the default value is 10 minutes.
  
  The scale factor bounds the number of new segments that can be created upon
  a scaling event. In the case the controller computes the number of splits
  to be greater than the scale factor for a given scale-up event, the number
  of splits for the event is going to be equal to the scale factor.
  
  The policy is configured with a minimum number of segments for a stream,
  independent of the number of scale down events.
  
  @param targetKBps Target rate in kilo bytes per second to enable scaling events
  per segment.
  @param scaleFactor Maximum number of splits of a segment for a scale-up event.
  @param minNumSegments Minimum number of segments that a stream can have
  independent of the number of scale down events.
  @return Scaling policy object.