A datetime metric.

Used to record an absolute date and time, such as the time the user first ran the application.

Constructors

Properties

Methods

  • Set a datetime value, truncating it to the metric's resolution.

    Parameters

    • Optional value: Date

      The Date value to set. If not provided, will record the current time.

    Returns void

  • Test-only API

    Returns the number of errors recorded for the given metric.

    Parameters

    • errorType: string

      The type of the error recorded.

    • ping: string = ...

      represents the name of the ping to retrieve the metric for. Defaults to the first value in sendInPings.

    Returns number

    the number of errors recorded for the metric.

  • Test-only API

    Gets the currently stored value as a boolean.

    This doesn't clear the stored value.

    Note

    The Date object is always in local time.

    If the currently stored datetime is in a different timezone than local, the resulting Date object will contain the relative local date to the recorded value.

    Parameters

    • ping: string = ...

      the ping from which we want to retrieve this metrics value from. Defaults to the first value in sendInPings.

    Returns undefined | Date

    The value found in storage or undefined if nothing was found.

  • Test-only API

    Gets the currently stored value as an ISO date string.

    This doesn't clear the stored value.

    Parameters

    • ping: string = ...

      the ping from which we want to retrieve this metrics value from. Defaults to the first value in sendInPings.

    Returns undefined | string

    The value found in storage or undefined if nothing was found.

Generated using TypeDoc