@Override
    public long getWindowSize(long durationMillis) {
        final long idealTimeslotSize = durationMillis / this.idealNumTimeslots;
        if (idealTimeslotSize < this.minTimeslot) {
            return this.minTimeslot;
        }
        if (idealTimeslotSize % this.minTimeslot == 0) {
            return idealTimeslotSize;
        } else {
            final long nearestMultipleOfMinTimeslotSize = MathUtils.roundToNearestMultipleOf(idealTimeslotSize, this.minTimeslot);
            return findOptimalWindowSize(durationMillis, nearestMultipleOfMinTimeslotSize);
        }
    }
<p>This implementation returns the window size that would generate the number of timeslots closest to 
<tt>idealNumTimeslots</tt> for a given <tt>range</tt>.
<p>Additionally, the window size is generated in multiples of
<tt>minTimeslot</tt>.

@param durationMillis range to calculate the time window over
@return size of the ideal time window
commons-timeseries/src/main/java/com/navercorp/pinpoint/common/timeseries/window/TimeWindowSlotCentricSampler.java