code: func (l *RateLimiter) RegisterRequest(token string) error {
  	l.Lock()
  	defer l.Unlock()
  
  	bucketSetI, exists := l.rateLimits.Get(token)
  	var bucketSet *ratelimit.TokenBucketSet
  
  	if exists {
  		bucketSet = bucketSetI.(*ratelimit.TokenBucketSet)
  		bucketSet.Update(l.rates)
  	} else {
  		bucketSet = ratelimit.NewTokenBucketSet(l.rates, l.clock)
  		// We set ttl as 10 times rate period. E.g. if rate is 100 requests/second per client ip
  		// the counters for this ip will expire after 10 seconds of inactivity
  		err := l.rateLimits.Set(token, bucketSet, int(bucketSet.GetMaxPeriod()/time.Second)*10+1)
  		if err != nil {
  			return trace.Wrap(err)
  		}
  	}
  	delay, err := bucketSet.Consume(1)
  	if err != nil {
  		return err
  	}
  	if delay > 0 {
  		return &ratelimit.MaxRateError{}
  	}
  	return nil
  }
docs: // RegisterRequest increases number of requests for the provided token
  // Returns error if there are too many requests with the provided token