Package com.xceptance.xlt.api.engine

# Class WebVitalData

java.lang.Object
com.xceptance.xlt.api.engine.AbstractData
com.xceptance.xlt.api.engine.WebVitalData

All Implemented Interfaces:
  `Data`

public class WebVitalData extends AbstractData
The `WebVitalData` stores a single observation for a certain Web Vital in a certain action as a 'double' value. Which action and Web Vital this data object was reported for is encoded in the name field. For example, "Foo Action [CLS]" and "Bar Action [LCP]" indicate measurements of CLS for the "Foo Action" and LCP for the "Bar Action".

Up to now, the following Web Vitals are supported: CLS, FCP, FID, INP, LCP, and TTFB. See the links below for more information on Web Vitals.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WebVitalData()`
  Creates a new `WebVitalData` object.
  `WebVitalData(String name)`
  Creates a new `WebVitalData` object and gives it the specified name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `getValue()`
  Returns the value.
  `void`
  `setRemainingValues(List<XltCharBuffer> values)`
  Called by XLT during report creation to recreate the remaining object state from the passed string list.
  `void`
  `setValue(double value)`
  Sets the value.
  `List<String>`
  `toList()`
  Called by XLT during a load test to return the full state of the object as a list of strings.

  ### Methods inherited from class com.xceptance.xlt.api.engine.AbstractData

  `getAgentName, getName, getTime, getTransactionName, getTypeCode, setAgentName, setAllValues, setBaseValues, setName, setTime, setTransactionName`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WebVitalData

    public WebVitalData(String name)
    Creates a new `WebVitalData` object and gives it the specified name.
    Parameters:
      `name` - the statistics name

  - ### WebVitalData

    public WebVitalData()
    Creates a new `WebVitalData` object.

- ## Method Details

  - ### setValue

    public void setValue(double value)
    Sets the value.
    Parameters:
      `value` - the value

  - ### getValue

    public double getValue()
    Returns the value.
    Returns:
      the value

  - ### toList

    public List<String> toList()
    Called by XLT during a load test to return the full state of the object as a list of strings. The first three entries have to be, in this order, the type code, the name, and the timestamp. All remaining entries and their order are specific to the concrete implementation class.

    Override this method in sub classes by calling the super method and adding custom values to the list it returns.

    Specified by:
      `toList` in interface `Data`
    Overrides:
      `toList` in class `AbstractData`
    Returns:
      the list of values that form the state of this object
    See Also:
      - `Data.setBaseValues(List)`
      - `Data.setRemainingValues(List)`

  - ### setRemainingValues

    public void setRemainingValues(List<XltCharBuffer> values)
    Called by XLT during report creation to recreate the remaining object state from the passed string list. The base values have already been initialized by calling `Data.setBaseValues(List)` with the same list of values. Splitting the process of recreating the full object state into two methods is purely for performance reasons as the second step is not always needed.
    Parameters:
      `values` - the string list to recreate the object state from
    See Also:
      - `Data.setBaseValues(List)`
      - `Data.toList()`