Class Event

  • All Implemented Interfaces:
    Telemetry

    public final class Event
    extends java.lang.Object
    implements Telemetry
    An Event is ad hoc set of key-value pairs with an associated timestamp, recorded in the New Relic Metric API.
    • Constructor Summary

      Constructors 
      Constructor Description
      Event​(Event other)
      Copy constructor for events.
      Event​(java.lang.String eventType, Attributes attributes)
      Create an event with System.currentTimeMillis as the timestamp.
      Event​(java.lang.String eventType, Attributes attributes, long timestamp)
      Create an event with the given timestamp as the timestamp, in ms since unix epoch.
    • Constructor Detail

      • Event

        public Event​(java.lang.String eventType,
                     Attributes attributes,
                     long timestamp)
        Create an event with the given timestamp as the timestamp, in ms since unix epoch.
        Parameters:
        eventType - The type of event.
        attributes - The key-value pairs that make up the event.
      • Event

        public Event​(Event other)
        Copy constructor for events.
        Parameters:
        other - The event to copy
      • Event

        public Event​(java.lang.String eventType,
                     Attributes attributes)
        Create an event with System.currentTimeMillis as the timestamp.
        Parameters:
        eventType - The type of event.
        attributes - The key-value pairs that make up the event.
    • Method Detail

      • getEventType

        public java.lang.String getEventType()
      • getAttributes

        public Attributes getAttributes()
      • getTimestamp

        public long getTimestamp()
      • 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