.NET API
Experiment
Tracon.Abstractions.dllRepresents an A/B experiment that splits traffic between two or more definition versions of the same agent.
public sealed record Experiment : IEquatable<Experiment>- Inheritance
- object ← Experiment
- Implements
- IEquatable<Experiment>
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”An experiment can only compare versions of the same agent. An experiment across different agents is out of scope because it complicates name resolution.
Code-based agents (AgentDefinitionOrigin.Code) cannot have an experiment because they have no version history. The endpoint states this clearly with HTTP 400.
Constructors
Section titled “Constructors”Experiment()
Section titled “ Experiment()”public Experiment()Properties
Section titled “Properties”AgentName
Section titled “ AgentName”Gets the name of the agent whose traffic is split.
public required string AgentName { get; init; }Property Value
Section titled “Property Value”AssignmentKey
Section titled “ AssignmentKey”Gets a reserved value. Runtime assignment does not read it: the assignment key is always the session identifier, or the run identifier when no session exists. The property is reserved for future strategies that assign outside a session, and setting it today changes nothing.
public string? AssignmentKey { get; init; }Property Value
Section titled “Property Value”Canary
Section titled “ Canary”Gets the canary policy. null disables automatic decisions, so no background service evaluates this experiment.
public CanaryPolicy? Canary { get; init; }Property Value
Section titled “Property Value”EndedAt
Section titled “ EndedAt”Gets the time when the experiment stopped. Returns null when it runs or never started.
public DateTimeOffset? EndedAt { get; init; }Property Value
Section titled “Property Value”Gets the experiment identifier.
public required Guid Id { get; init; }Property Value
Section titled “Property Value”Gets the experiment name. It is unique within the tenant and is used as an API route key.
public required string Name { get; init; }Property Value
Section titled “Property Value”RollbackReason
Section titled “ RollbackReason”Gets the reason for an automatic rollback. Returns null when the experiment was stopped manually or was never stopped.
public string? RollbackReason { get; init; }Property Value
Section titled “Property Value”StartedAt
Section titled “ StartedAt”Gets the time when the experiment entered ExperimentStatus.Running. Returns null while it is a draft.
public DateTimeOffset? StartedAt { get; init; }Property Value
Section titled “Property Value”Status
Section titled “ Status”Gets the current experiment status.
public ExperimentStatus Status { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”Gets the tenant that owns the experiment.
public required string TenantId { get; init; }Property Value
Section titled “Property Value”UpdatedAt
Section titled “ UpdatedAt”Gets the UTC time of the last update.
public DateTimeOffset? UpdatedAt { get; init; }Property Value
Section titled “Property Value”Variants
Section titled “ Variants”Gets the experiment variants. Their weights must total 100.
public required IReadOnlyList<ExperimentVariant> Variants { get; init; }Property Value
Section titled “Property Value”IReadOnlyList<ExperimentVariant>
Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(Experiment?)
Section titled “ Equals(Experiment?)”public bool Equals(Experiment? other)Parameters
Section titled “Parameters”other Experiment?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(Experiment?, Experiment?)
Section titled “ operator ==(Experiment?, Experiment?)”public static bool operator ==(Experiment? left, Experiment? right)Parameters
Section titled “Parameters”left Experiment?
right Experiment?
Returns
Section titled “Returns”operator !=(Experiment?, Experiment?)
Section titled “ operator !=(Experiment?, Experiment?)”public static bool operator !=(Experiment? left, Experiment? right)Parameters
Section titled “Parameters”left Experiment?
right Experiment?