Skip to content

CanaryEvaluation

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

Represents the result of evaluating a canary policy against the current results of the canary and control variants.

public sealed record CanaryEvaluation : IEquatable<CanaryEvaluation>

objectCanaryEvaluation

IEquatable<CanaryEvaluation>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This type is not persisted. Each GET /api/experiments/{name}/canary call runs CanaryEvaluator again with current ExperimentVariantResult data. Canary run results already accumulate from the start of the experiment; an evaluation history table would store the same information twice.

public CanaryEvaluation()

Gets the current canary variant results. Returns null when no runs exist.

public ExperimentVariantResult? Canary { get; init; }

ExperimentVariantResult?

Gets the current control variant results. Returns null when no runs exist.

public ExperimentVariantResult? Control { get; init; }

ExperimentVariantResult?

Gets the evaluation outcome.

public required CanaryDecisionKind Decision { get; init; }

CanaryDecisionKind

Gets the UTC time when the evaluation occurred.

public required DateTimeOffset EvaluatedAt { get; init; }

DateTimeOffset

Gets the human-readable reason for the decision.

public required string Reason { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(CanaryEvaluation? other)

other CanaryEvaluation?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(CanaryEvaluation?, CanaryEvaluation?)

Section titled “ operator ==(CanaryEvaluation?, CanaryEvaluation?)”
public static bool operator ==(CanaryEvaluation? left, CanaryEvaluation? right)

left CanaryEvaluation?

right CanaryEvaluation?

bool

operator !=(CanaryEvaluation?, CanaryEvaluation?)

Section titled “ operator !=(CanaryEvaluation?, CanaryEvaluation?)”
public static bool operator !=(CanaryEvaluation? left, CanaryEvaluation? right)

left CanaryEvaluation?

right CanaryEvaluation?

bool