code: func NewAdaptiveSampler(maxSamplingRate, sampleSize int) Sampler {
  	if maxSamplingRate <= 0 {
  		panic("maxSamplingRate must be greater than 0")
  	}
  	if sampleSize <= 0 {
  		panic("sample size must be greater than 0")
  	}
  	return &adaptiveSampler{
  		lastRate:        adaptiveUpperBoundInt, // samples all until initial count reaches sample size
  		maxSamplingRate: maxSamplingRate,
  		sampleSize:      uint32(sampleSize),
  		start:           time.Now(),
  	}
  }
docs: // NewAdaptiveSampler computes the interval for sampling for tracing middleware.
  // it can also be used by non-web go routines to trace internal API calls.
  //
  // maxSamplingRate is the desired maximum sampling rate in requests per second.
  //
  // sampleSize sets the number of requests between two adjustments of the
  // sampling rate when MaxSamplingRate is set. the sample rate cannot be adjusted
  // until the sample size is reached at least once.