Interface Data

  • All Known Implementing Classes:
    AbstractData, ActionData, CustomData, CustomValue, EventData, PageLoadTimingData, RequestData, TimerData, TransactionData

    public interface Data

    The Data interface defines the minimum functionality any data record must implement to be recordable by the XLT engine. Typically, the XLT engine already collects sufficient data (e.g. error and run time values). However, it may be necessary to log other important values as well. For this, a new data record type needs to be created, either by implementing this interface or - preferably - by extending from one of the already existing data record types.

    Such a data record class must obey the following rules:

    • it must have a name
    • it must have a time stamp
    • it must be serializable to a comma-separated list of values
    • it must be able to reconstruct its state from a comma-separated list of values
    • in order to tell one type of data record from the other, the first entry in the value list must be a type code (e.g. "MyRecordType" or simple "M")

    Note that the type codes "A", "C", "E", "J", "R", and "T" are already used by the XLT engine.

    The data record can be logged using the DataManager.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static char DELIMITER
      The delimiter character (a comma) used to separate single values in a data record.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void baseValuesFromCSV​(SimpleArrayList<XltCharBuffer> result, XltCharBuffer src)
      Recreates a partial state of this object by reading the data from a buffer s and parsing it as comma-delimited line.
      java.lang.String getAgentName()
      Returns the name of the agent that produced this data record.
      java.lang.String getName()
      Returns the name of this data record.
      long getTime()
      Returns the time when the event occurred that this data record was created for.
      java.lang.String getTransactionName()
      Returns the name of the transaction that produced this data record.
      char getTypeCode()
      Returns the type code of this data record.
      void remainingValuesFromCSV​(SimpleArrayList<XltCharBuffer> result)
      Recreates the full state of the object by parsing the remaining data of the passed list.
      void setAgentName​(java.lang.String agentName)
      Sets the name of the agent that produced this data record.
      void setName​(java.lang.String name)
      Sets the name of this data record.
      void setTime​(long time)
      Sets the time when this record's event occurred.
      void setTransactionName​(java.lang.String transactionName)
      Sets the name of the transaction that produced this data record.
      java.lang.StringBuilder toCSV()
      Returns the state of this object as a StringBuilder reflecting a list of values separated by the DELIMITER constant.
    • Field Detail

      • DELIMITER

        static final char DELIMITER
        The delimiter character (a comma) used to separate single values in a data record.
        See Also:
        Constant Field Values
    • Method Detail

      • baseValuesFromCSV

        void baseValuesFromCSV​(SimpleArrayList<XltCharBuffer> result,
                               XltCharBuffer src)
        Recreates a partial state of this object by reading the data from a buffer s and parsing it as comma-delimited line. The result is an empty reusable object that is here for speed not functionality. The data will be internally stored and only the most essential state will be recreated first, because later we might filter things out anyway, so why waste cycles. The passed list must be empty and it will be mutated to hold the full parse result.
        Parameters:
        result - reusable list for the parsing results
        src - the csv data as charbuffer
      • remainingValuesFromCSV

        void remainingValuesFromCSV​(SimpleArrayList<XltCharBuffer> result)
        Recreates the full state of the object by parsing the remaining data of the passed list. It is the programmers responsibility to make sure that the result list matches the one initially created when calling baseValuesFromCSV. This is an implementation focusing on speed not a nice API aka you can reuse a list over and over again as long as the calling order is right.
        Parameters:
        result - the previously parsed data as list
      • getAgentName

        java.lang.String getAgentName()
        Returns the name of the agent that produced this data record. Only used during report generation or analysis.
        Returns:
        the agent's name
      • getName

        java.lang.String getName()
        Returns the name of this data record.
        Returns:
        the name
      • getTime

        long getTime()
        Returns the time when the event occurred that this data record was created for.
        Returns:
        the time
      • getTransactionName

        java.lang.String getTransactionName()
        Returns the name of the transaction that produced this data record. Only used during report generation or analysis.
        Returns:
        the transaction's name
      • getTypeCode

        char getTypeCode()
        Returns the type code of this data record.
        Returns:
        the type code
      • setAgentName

        void setAgentName​(java.lang.String agentName)
        Sets the name of the agent that produced this data record. Only used during report generation or analysis.
        Parameters:
        agentName - the agent's name
      • setName

        void setName​(java.lang.String name)
        Sets the name of this data record.
        Parameters:
        name - the name
      • setTime

        void setTime​(long time)
        Sets the time when this record's event occurred. To obtain the timestamp, please use GlobalClock.millis().
        Parameters:
        time - the timestamp
      • setTransactionName

        void setTransactionName​(java.lang.String transactionName)
        Sets the name of the transaction that produced this data record. Only used during report generation or analysis.
        Parameters:
        transactionName - the transaction's name
      • toCSV

        java.lang.StringBuilder toCSV()
        Returns the state of this object as a StringBuilder reflecting a list of values separated by the DELIMITER constant.
        Returns:
        the list of values as CSV line