Options
All
  • Public
  • Public/Protected
  • All
Menu

A datetime metric.

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

Hierarchy

  • default

Index

Constructors

Properties

Methods

  • set(value?: Date): void
  • 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

  • testGetNumRecordedErrors(errorType: string, ping?: string): Promise<number>
  • 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 Promise<number>

    the number of errors recorded for the metric.

  • testGetValue(ping?: string): Promise<undefined | Date>
  • 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 Promise<undefined | Date>

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

  • testGetValueAsString(ping?: string): Promise<undefined | string>
  • 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 Promise<undefined | string>

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

Generated using TypeDoc