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

Included in:
LaunchDarkly::Impl::Migrations::OpTracker
Defined in:
lib/ldclient-rb/interfaces.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:



884
885
# File 'lib/ldclient-rb/interfaces.rb', line 884

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



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

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.



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

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.



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

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).



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

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.



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

def operation(op) end