Class EventBuffer

    • Constructor Summary

      Constructors 
      Constructor Description
      EventBuffer​(Attributes commonAttributes)
      Create a new buffer with the provided common set of attributes.
    • Constructor Detail

      • EventBuffer

        public EventBuffer​(Attributes commonAttributes)
        Create a new buffer with the provided common set of attributes.
        Parameters:
        commonAttributes - These attributes will be appended (by the New Relic backend) to every Event in this buffer.
    • Method Detail

      • addEvent

        public void addEvent​(Event event)
        Append a Event to this buffer, to be sent in the next EventBatch.
        Parameters:
        event - The new Event instance to be sent.
      • createBatch

        public EventBatch createBatch()
        Creates a new EventBatch from the contents of this buffer, then clears the contents of this buffer.

        Events added to this buffer by other threads during this method call will either be added to the EventBatch being created, or will be saved for the next EventBatch.

        Returns:
        A new EventBatch with an immutable collection of Events.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object