code: func (sb *StatsdBuffer) flush() (err error) {
  	n := len(sb.events)
  	if n == 0 {
  		return nil
  	}
  	if err := sb.statsd.SendEvents(sb.events); err != nil {
  		sb.Logger.Println(err)
  		return err
  	}
  	sb.events = make(map[string]event.Event)
  
  	return nil
  }
docs: // send the events to StatsD and reset them.
  // This function is NOT thread-safe, so it must only be invoked synchronously
  // from within the collector() goroutine