Module: LaunchDarkly::Interfaces::Migrations::OpTracker

Included in:
LaunchDarkly::Impl::Migrations::OpTracker
Defined in:
lib/ldclient-rb/interfaces/migrations.rb

Overview

An OpTracker is responsible for managing the collection of measurements that which a user might wish to record throughout a migration-assisted operation.

Example measurements include latency, errors, and consistency.

This data can be provided to the LDClient.track_migration_op method to relay this metric information upstream to LaunchDarkly services.

Instance Method Summary collapse

Instance Method Details

#buildLaunchDarkly::Impl::MigrationOpEvent, String

Creates an instance of LaunchDarkly::Impl::MigrationOpEventData.

failure.

Returns:

  • (LaunchDarkly::Impl::MigrationOpEvent, String)

    A migration op event or a string describing the error.



95
96
# File 'lib/ldclient-rb/interfaces/migrations.rb', line 95

def build
end

#consistent(is_consistent) ⇒ Object

Allows recording the results of a consistency check.

This method accepts a callable which should take no parameters and return a single boolean to represent the consistency check results for a read operation.

A callable is provided in case sampling rules do not require consistency checking to run. In this case, we can avoid the overhead of a function by not using the callable.

Parameters:

  • is_consistent (#call)

    closure to return result of comparison check



72
# File 'lib/ldclient-rb/interfaces/migrations.rb', line 72

def consistent(is_consistent) end

#error(origin) ⇒ Object

Allows recording whether an error occurred during the operation.

Parameters:

  • origin (Symbol)

    Designation for the old or new origin.



79
# File 'lib/ldclient-rb/interfaces/migrations.rb', line 79

def error(origin) end

#invoked(origin) ⇒ Object

Allows recording which origins were called during a migration.

Parameters:

  • origin (Symbol)

    Designation for the old or new origin.



59
# File 'lib/ldclient-rb/interfaces/migrations.rb', line 59

def invoked(origin) end

#latency(origin, duration) ⇒ Object

Allows tracking the recorded latency for an individual operation.

Parameters:

  • origin (Symbol)

    Designation for the old or new origin.

  • duration (Float)

    Duration measurement in milliseconds (ms).



87
# File 'lib/ldclient-rb/interfaces/migrations.rb', line 87

def latency(origin, duration) end

#operation(op) ⇒ Object

Sets the migration related operation associated with these tracking measurements.

Parameters:

  • op (Symbol)

    The read or write operation symbol.



52
# File 'lib/ldclient-rb/interfaces/migrations.rb', line 52

def operation(op) end