code: func NewSampler(sampleRate float64) (*Sampler, error) {
  	if sampleRate <= 0.0 || sampleRate >= 1.0 {
  		return nil, fmt.Errorf("invalid sample rate %f", sampleRate)
  	}
  	return &Sampler{numTried: atomic.NewInt32(0), sampleEvery: int32(1.0 / sampleRate)}, nil
  }
docs: // NewSampler creates a new sampler with a sample rate.