Class MigrationOpTracker
Used to track information related to a migration operation.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Migrations
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public sealed class MigrationOpTracker
Methods
| Edit this page View SourceConsistency(Func<bool>)
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.
Declaration
public void Consistency(Func<bool> checker)
Parameters
Type | Name | Description |
---|---|---|
Func<bool> | checker | check method which returns true if the results were consistent |
Remarks
If the consistency check function throws an exception, then no measurement for consistency will be included in the generated migration op event.
Example calling the check function from the migration config.
if (checker != null &&
oldResult.IsSuccessful &&
newResult.IsSuccessful
) {
tracker.Consistency(() => checker(oldResult.Result,
oldResult.Result));
}
Error(MigrationOrigin)
Report that an error has occurred for the specified origin.
Declaration
public void Error(MigrationOrigin origin)
Parameters
Type | Name | Description |
---|---|---|
MigrationOrigin | origin | the origin of the error |
Invoked(MigrationOrigin)
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.
Declaration
public void Invoked(MigrationOrigin origin)
Parameters
Type | Name | Description |
---|---|---|
MigrationOrigin | origin | the origin that was invoked |
Latency(MigrationOrigin, TimeSpan)
Report the latency of an operation.
Declaration
public void Latency(MigrationOrigin origin, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
MigrationOrigin | origin | the origin the latency is being reported for |
TimeSpan | duration | the latency of the operation |
Op(MigrationOperation)
Sets the migration related operation associated with these tracking measurements.
Declaration
public void Op(MigrationOperation operation)
Parameters
Type | Name | Description |
---|---|---|
MigrationOperation | operation | the operation being tracked |