code: func getBucketSize(request *restful.Request) (time.Duration, error) {
  	rawSize := request.QueryParameter("bucket")
  	if rawSize == "" {
  		return 0, nil
  	}
  
  	if len(rawSize) < 2 {
  		return 0, fmt.Errorf("unable to parse bucket size: %q is too short to be a duration", rawSize)
  	}
  	var multiplier time.Duration
  	var num string
  
  	switch rawSize[len(rawSize)-1] {
  	case 's':
  		// could be s or ms
  		if len(rawSize) < 3 || rawSize[len(rawSize)-2] != 'm' {
  			multiplier = time.Second
  			num = rawSize[:len(rawSize)-1]
  		} else {
  			multiplier = time.Millisecond
  			num = rawSize[:len(rawSize)-2]
  		}
  	case 'h':
  		multiplier = time.Hour
  		num = rawSize[:len(rawSize)-1]
  	case 'd':
  		multiplier = 24 * time.Hour
  		num = rawSize[:len(rawSize)-1]
  	case 'm':
  		multiplier = time.Minute
  		num = rawSize[:len(rawSize)-1]
  	default:
  		return 0, fmt.Errorf("unable to parse bucket size: %q has no known duration suffix", rawSize)
  	}
  
  	parsedNum, err := strconv.ParseUint(num, 10, 64)
  	if err != nil {
  		return 0, err
  	}
  
  	return time.Duration(parsedNum) * multiplier, nil
  }
docs: // getBucketSize parses the bucket size specifier into a