Package com.xceptance.xlt.api.engine

# Interface DataManager

public interface DataManager
The `DataManager` logs data records to a log file, from where they may be read again during test report generation. The `DataManager` instance responsible for a certain test user may be obtained from the current session object via `Session.getDataManager()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DataLogger`
  `dataLogger(String scope)`
  Creates or returns an already created custom data logger for the given scope.
  `void`
  `disableLogging()`
  Disables the logging of data records.
  `void`
  `enableLogging()`
  Enables the logging of data records.
  `long`
  `getEndOfLoggingPeriod()`
  Returns the time that marks the end of the logging period.
  `long`
  `getStartOfLoggingPeriod()`
  Returns the time that marks the beginning of the logging period.
  `boolean`
  `isLoggingEnabled()`
  Returns whether or not logging of data records is currently enabled.
  `void`
  `logDataRecord(Data data)`
  Logs the given data record to a log file, but only if logging is enabled and the current time is inside the configured logging period.
  `void`
  `logEvent(String eventName, String message)`
  Logs an event data record that is initialized with the given parameters, but only if logging is enabled and the current time is inside the configured logging period.
  `void`
  `setEndOfLoggingPeriod(long time)`
  Sets the time that marks the end of the logging period.
  `void`
  `setLoggingEnabled(boolean state)`
  Sets whether or not logging of data records is currently enabled.
  `void`
  `setStartOfLoggingPeriod(long time)`
  Sets the time that marks the beginning of the logging period.

- ## Method Details

  - ### getEndOfLoggingPeriod

    long getEndOfLoggingPeriod()
    Returns the time that marks the end of the logging period.
    Returns:
      the end time

  - ### getStartOfLoggingPeriod

    long getStartOfLoggingPeriod()
    Returns the time that marks the beginning of the logging period.
    Returns:
      the start time

  - ### isLoggingEnabled

    boolean isLoggingEnabled()
    Returns whether or not logging of data records is currently enabled.
    Returns:
      the logging state

  - ### logEvent

    void logEvent(String eventName, String message)
    Logs an event data record that is initialized with the given parameters, but only if logging is enabled and the current time is inside the configured logging period.
    Parameters:
      `eventName` - the name of the event
      `message` - the event message

  - ### logDataRecord

    void logDataRecord(Data data)
    Logs the given data record to a log file, but only if logging is enabled and the current time is inside the configured logging period.
    Parameters:
      `data` - the data record

  - ### setEndOfLoggingPeriod

    void setEndOfLoggingPeriod(long time)
    Sets the time that marks the end of the logging period.
    Parameters:
      `time` - the end time

  - ### setLoggingEnabled

    void setLoggingEnabled(boolean state)
    Sets whether or not logging of data records is currently enabled.
    Parameters:
      `state` - the logging state

  - ### enableLogging

    void enableLogging()
    Enables the logging of data records.

  - ### disableLogging

    void disableLogging()
    Disables the logging of data records.

  - ### setStartOfLoggingPeriod

    void setStartOfLoggingPeriod(long time)
    Sets the time that marks the beginning of the logging period.
    Parameters:
      `time` - the start time

  - ### dataLogger

    DataLogger dataLogger(String scope)
    Creates or returns an already created custom data logger for the given scope.
    Parameters:
      `scope` - the scope of the data logger
    Returns:
      the custom data logger for the given scope