Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StampOutcome ¶
StampOutcome copies outcome into rec's override payload.
Types ¶
type Bucket ¶
type Bucket struct {
PromptFeatureBucket string
Axis string
Match bool
Count int
SuccessOutcomes int
StalledOutcomes int
FailedOutcomes int
CancelledOutcomes int
UnknownOutcomes int
}
Bucket is one cell in the override-class pivot.
type Metrics ¶
type Metrics struct {
AutoAcceptanceRate float64
OverrideDisagreementRate float64
OverrideClassBreakdown []Bucket
TotalRequests int
TotalOverrides int
}
Metrics is the internal routing-quality aggregate.
func ComputeMetrics ¶
func ComputeMetrics(totalRequests int, overrides []OverrideData) Metrics
ComputeMetrics aggregates routing-quality metrics from request and override counts.
func ComputeMetricsFromRecords ¶
ComputeMetricsFromRecords aggregates the store-side record shape directly.
type Outcome ¶
type Outcome struct {
Status string
}
Outcome is the internal terminal outcome for an override.
type OverrideData ¶
type OverrideData struct {
AxesOverridden []string
MatchPerAxis map[string]bool
PromptFeatures PromptFeatures
Outcome *Outcome
}
OverrideData is the internal representation of a service override event.
type PromptFeatures ¶
PromptFeatures is the internal prompt-feature slice used for buckets.
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record is one entry in the in-process routing-quality store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a bounded in-memory ring of routing-quality records. It is safe for concurrent use.
func (*Store) RecordRequest ¶
func (s *Store) RecordRequest(at time.Time, override *OverrideData) *Record
RecordRequest appends a request to the store and returns the freshly allocated record. override may be nil for the no-override case.
func (*Store) SnapshotRecent ¶
SnapshotRecent returns up to maxN of the most recent records, optionally filtered by since.