code: func (b *eventBatch) add(event wrappedEvent, size int) bool {
  	addBytes := size + perEventBytes
  
  	// verify we are still within service limits
  	switch {
  	case len(b.batch)+1 > maximumLogEventsPerPut:
  		return false
  	case b.bytes+addBytes > maximumBytesPerPut:
  		return false
  	}
  
  	b.bytes += addBytes
  	b.batch = append(b.batch, event)
  
  	return true
  }
docs: // add adds an event to the batch of events accounting for the
  // necessary overhead for an event to be logged. An error will be
  // returned if the event cannot be added to the batch due to service
  // limits.
  //
  // Warning: this method is not threadsafe and must not be used
  // concurrently.