Used to track information related to a migration operation.

Hierarchy

  • LDMigrationTracker

Methods

  • Check the consistency of a read result. This method should be invoked if the check function is defined for the migration and both reads ("new"/"old") were done.

    The function will use the checkRatio to determine if the check should be executed, and it will record the result.

    Example calling the check function from the migration config.

    context.tracker.consistency(() => config.check!(oldValue.result, newValue.result));
    

    If the consistency check function throws an exception, then the consistency check result will not be included in the generated event.

    Parameters

    • check: (() => boolean)

      The function which executes the check. This is not the check function from the migration options, but instead should be a parameter-less function that calls that function.

        • (): boolean
        • Returns boolean

    Returns void

  • Create a migration op event. If the event could not be created, because of a missing operation, then undefined is returned.

    Returns undefined | LDMigrationOpEvent

  • Report that an error has occurred for the specified origin.

    Parameters

    Returns void

  • Call this to report that an origin was invoked (executed). There are some situations where the expectation is that both the old and new implementation will be used, but with writes it is possible that the non-authoritative will not execute. Reporting the execution allows for more accurate analytics.

    Parameters

    Returns void

  • Report the latency of an operation.

    Parameters

    • origin: LDMigrationOrigin

      The origin the latency is being reported for.

    • value: number

      The latency, in milliseconds, of the operation.

    Returns void

  • Sets the migration related operation associated with these tracking measurements.

    Parameters

    Returns void

Generated using TypeDoc