# File lib/new_relic/agent/custom_event_aggregator.rb, line 21
      def record(type, attributes)
        unless attributes.is_a? Hash
          raise ArgumentError, "Expected Hash but got #{attributes.class}"
        end

        type = @type_strings[type]
        unless type =~ EVENT_TYPE_REGEX
          note_dropped_event(type)
          return false
        end

        event = [
          { TYPE => type, TIMESTAMP => Time.now.to_i },
          AttributeProcessing.flatten_and_coerce(attributes)
        ]

        stored = @lock.synchronize do
          @buffer.append(event)
        end
        stored
      end