quicktest

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package quicktest executes bounded performance tests for OpenAI-compatible connections and archives operational reports without creating authored targets.

Index

Constants

View Source
const (
	PerformanceSchemaVersion                = 2
	MaxPerformanceRequests           uint64 = 10_000
	MaxPerformanceConcurrency        uint32 = 256
	MaxPerformanceInFlight           uint32 = load.MaxOpenLoopInFlight
	MinPerformanceRatePerSecond             = 0.01
	MaxPerformanceRatePerSecond             = 100_000.0
	MaxPerformanceDurationMS         uint64 = 3_600_000
	MaxPerformanceTimeoutMS          uint64 = 600_000
	MaxPerformanceInputTokens        uint32 = 1_000_000
	MaxPerformanceOutputTokens       uint32 = 65_536
	MaxPerformanceEvidenceBodyBytes         = 16 << 10
	MaxPerformanceEvidenceTotalBytes        = 2 << 20

	PerformancePhaseNotStarted load.Phase = "not_started"
	PerformancePhaseWarmingUp  load.Phase = "warming_up"
	PerformancePhaseRamping    load.Phase = "ramping"
)
View Source
const (
	ErrorInvalidRequest       domain.ErrorCode = "invalid_request"
	ErrorCredentialRequired   domain.ErrorCode = "credential_required"
	ErrorAuthenticationFailed domain.ErrorCode = "authentication_failed"
)
View Source
const MaxPerformanceCapacityRungs = 20
View Source
const MaxPerformanceCheckpointBytes = 32 << 20

Variables

View Source
var ErrInvalidPreparedPerformance = errors.New("quick test: invalid prepared performance input")
View Source
var ErrPerformanceArchiveNotFound = errors.New("quick performance report not found")
View Source
var ErrPerformanceCheckpoint = errors.New("quick performance checkpoint could not be saved")
View Source
var ErrServiceUnavailable = errors.New("quick test service is unavailable")

Functions

func PlanResultMatches

func PlanResultMatches(report PerformanceReport, entry domain.RunEntrySnapshot, channel domain.ChannelSnapshot) bool

func RecomputePerformanceDerivedFields

func RecomputePerformanceDerivedFields(report *PerformanceReport)

RecomputePerformanceDerivedFields rebuilds current-contract metrics and time slices from samples. Callers must still ValidateArchivedPerformanceReport.

func SupportsPerformance

func SupportsPerformance(selected domain.Protocol) bool

func ValidateArchivedPerformanceReport

func ValidateArchivedPerformanceReport(report PerformanceReport) (time.Time, error)

ValidateArchivedPerformanceReport protects every persistence and reporting adapter from malformed or unsafe quick-report documents.

func ValidatePerformanceArchiveSummary

func ValidatePerformanceArchiveSummary(summary PerformanceArchiveSummary) (time.Time, error)

ValidatePerformanceArchiveSummary protects the list boundary without loading or decoding the potentially large request-sample document.

func ValidatePerformanceCheckpointTransition

func ValidatePerformanceCheckpointTransition(previous *PerformanceCheckpoint, next PerformanceCheckpoint) error

ValidatePerformanceCheckpointTransition rejects out-of-order observations and rewrites of facts already recorded at an earlier execution boundary.

func ValidatePlanProfile

func ValidatePlanProfile(profile domain.PerformancePlanProfile) error

ValidatePlanProfile checks authored performance options before saving a plan.

func ValidatePlanReport

func ValidatePlanReport(report domain.Report) error

ValidatePlanReport checks nested measurements at storage and wire boundaries.

Types

type AddressMode

type AddressMode string
const (
	AddressModeBaseURL AddressMode = "base_url"
	AddressModeFullURL AddressMode = "full_url"
)

type ChannelConnection

type ChannelConnection struct {
	BaseURL string
	APIKey  []byte
}

type ChannelConnectionRepository

type ChannelConnectionRepository interface {
	GetChannel(context.Context, string) (domain.Channel, error)
	ListChannelModels(context.Context) ([]domain.ChannelModel, error)
}

type ChannelConnectionResolver

type ChannelConnectionResolver interface {
	Resolve(context.Context, ChannelSelection) (ChannelConnection, error)
}

type ChannelSelection

type ChannelSelection struct {
	ChannelID string
	Model     string
	Protocol  domain.Protocol
}

type Dependencies

type Dependencies struct {
	TaskCredential     func(context.Context, string, string, domain.Protocol) (*credentials.Lease, error)
	TaskPath           func(context.Context, TaskReference, string, domain.Protocol) (string, error)
	Transport          http.RoundTripper
	ChannelConnections ChannelConnectionResolver
	Archive            PerformanceArchive
	Clock              PerformanceClock
	IDFactory          PerformanceReportIDFactory
}

type ExecutionOptions

type ExecutionOptions struct {
	OnProgress  func(PerformanceProgress)
	StopSending <-chan struct{}
	// OnCheckpoint is synchronous, owns its snapshot and must honor its storage
	// context. Failure stops execution before another phase can send requests.
	OnCheckpoint func(context.Context, PerformanceCheckpoint) error
}

type Host

type Host struct {
	// contains filtered or unexported fields
}

Host executes prepared performance input without desktop connection resolvers.

func NewHost

func NewHost(dependencies HostDependencies) *Host

func (*Host) ExecutePrepared

func (service *Host) ExecutePrepared(
	ctx context.Context,
	prepared PreparedPerformance,
	lease *credentials.Lease,
	options ExecutionOptions,
) (report PerformanceReport, executionErr error)

type HostDependencies

type HostDependencies struct {
	Transport http.RoundTripper
	Archive   PerformanceArchive
	Clock     PerformanceClock
}

type PerformanceArchive

type PerformanceArchive interface {
	SaveQuickPerformanceReport(context.Context, PerformanceReport) error
}

type PerformanceArchiveStatus

type PerformanceArchiveStatus string
const (
	PerformanceArchiveNotAttempted PerformanceArchiveStatus = "not_attempted"
	PerformanceArchiveArchived     PerformanceArchiveStatus = "archived"
	PerformanceArchiveFailed       PerformanceArchiveStatus = "failed"
)

type PerformanceArchiveSummary

type PerformanceArchiveSummary struct {
	ReportID    string     `json:"report_id"`
	GeneratedAt string     `json:"generated_at"`
	Success     bool       `json:"success"`
	ModelID     string     `json:"model_id"`
	BaseURL     string     `json:"base_url"`
	Phase       load.Phase `json:"phase"`
	Completed   uint64     `json:"completed"`
	Failed      uint64     `json:"failed"`
}

PerformanceArchiveSummary is the bounded scalar projection used by report lists. Full samples are loaded only for an explicitly opened detail.

type PerformanceBoundary

type PerformanceBoundary string
const (
	PerformanceBoundaryEntered   PerformanceBoundary = "entered"
	PerformanceBoundaryCompleted PerformanceBoundary = "completed"
	PerformanceBoundaryReturned  PerformanceBoundary = "returned"
)

type PerformanceCapacityResult

type PerformanceCapacityResult struct {
	Status                  PerformanceSLOStatus      `json:"status"`
	SelectedRungIndex       *uint32                   `json:"selected_rung_index,omitempty"`
	HighestPassingRungIndex *uint32                   `json:"highest_passing_rung_index,omitempty"`
	Rungs                   []PerformanceCapacityRung `json:"rungs"`
}

type PerformanceCapacityRung

type PerformanceCapacityRung struct {
	Index         uint32                   `json:"index"`
	Target        float64                  `json:"target"`
	Success       bool                     `json:"success"`
	Progress      PerformanceProgress      `json:"progress"`
	Metrics       load.Metrics             `json:"metrics"`
	Failures      []PerformanceFailure     `json:"failures"`
	SLOAssessment PerformanceSLOAssessment `json:"slo_assessment"`
}

type PerformanceCheckpoint

type PerformanceCheckpoint struct {
	Stage     PerformanceStage    `json:"stage"`
	Boundary  PerformanceBoundary `json:"boundary"`
	RungIndex *uint32             `json:"rung_index,omitempty"`
	Report    PerformanceReport   `json:"report"`
}

A checkpoint describes the execution boundary, independently of the selected measured projection in Report. An entered stage may have unobserved traffic after a process interruption, even when its previous report has zero samples.

func (PerformanceCheckpoint) Validate

func (checkpoint PerformanceCheckpoint) Validate() error

Validate checks current execution observations, including partial preparation and capacity phases. Statistical archive validation remains a separate gate.

func (PerformanceCheckpoint) ValidateEnvelope

func (checkpoint PerformanceCheckpoint) ValidateEnvelope() error

ValidateEnvelope checks the boundary and current prepared identity. Storage additionally validates the recorded traffic and measurements before writing.

type PerformanceClock

type PerformanceClock interface {
	Now() time.Time
}

type PerformanceCommand

type PerformanceCommand struct {
	Protocol           domain.Protocol         `json:"protocol"`
	CredentialRunID    string                  `json:"credential_run_id,omitempty"`
	Task               *TaskReference          `json:"task,omitempty"`
	AddressMode        AddressMode             `json:"address_mode"`
	URL                string                  `json:"url"`
	APIKey             string                  `json:"api_key"`
	ChannelID          string                  `json:"channel_id,omitempty"`
	ModelID            string                  `json:"model_id"`
	LoadMode           domain.LoadMode         `json:"load_mode,omitempty"`
	ArrivalPattern     load.ArrivalPattern     `json:"arrival_pattern,omitempty"`
	WorkloadMode       PerformanceWorkloadMode `json:"workload_mode,omitempty"`
	RandomInput        bool                    `json:"random_input,omitempty"`
	AffinityEnabled    bool                    `json:"affinity_enabled,omitempty"`
	RandomSeed         uint32                  `json:"random_seed,omitempty"`
	RequestCount       uint64                  `json:"request_count"`
	DurationMS         uint64                  `json:"duration_ms"`
	Concurrency        uint32                  `json:"concurrency"`
	RatePerSecond      float64                 `json:"rate_per_second,omitempty"`
	MaxInFlight        uint32                  `json:"max_in_flight,omitempty"`
	TimeoutMS          uint64                  `json:"timeout_ms"`
	InputTokens        uint32                  `json:"input_tokens"`
	OutputTokens       uint32                  `json:"output_tokens"`
	InputTokensStdDev  uint32                  `json:"input_tokens_stddev,omitempty"`
	OutputTokensStdDev uint32                  `json:"output_tokens_stddev,omitempty"`
	SharedPrefixTokens uint32                  `json:"shared_prefix_tokens,omitempty"`
	WarmupRequests     uint64                  `json:"warmup_requests,omitempty"`
	RampDurationMS     uint64                  `json:"ramp_duration_ms,omitempty"`
	RampRequestCap     uint64                  `json:"ramp_request_cap,omitempty"`
	SliceDurationMS    uint64                  `json:"slice_duration_ms,omitempty"`
	SLOTTFTMS          float64                 `json:"slo_ttft_ms,omitempty"`
	SLOTPOTMS          float64                 `json:"slo_tpot_ms,omitempty"`
	SLOE2EMS           float64                 `json:"slo_e2e_ms,omitempty"`
	SLOTargetPercent   float64                 `json:"slo_target_percent,omitempty"`
	CapacityEnabled    bool                    `json:"capacity_enabled,omitempty"`
	CapacityStart      float64                 `json:"capacity_start,omitempty"`
	CapacityStep       float64                 `json:"capacity_step,omitempty"`
}

PerformanceCommand accepts a temporary or saved connection and optional Suite provenance. It does not create authored Model, Channel, Case, or Plan entities.

type PerformanceCountSlice

type PerformanceCountSlice struct {
	Count   uint64  `json:"count"`
	P50     float64 `json:"p50"`
	P95     float64 `json:"p95"`
	P99     float64 `json:"p99"`
	Average float64 `json:"average"`
}

type PerformanceEvidenceCaptureStatus

type PerformanceEvidenceCaptureStatus string
const (
	PerformanceEvidenceCaptured PerformanceEvidenceCaptureStatus = "captured"
	PerformanceEvidenceEmpty    PerformanceEvidenceCaptureStatus = "empty"
	PerformanceEvidenceOmitted  PerformanceEvidenceCaptureStatus = "omitted"
)

type PerformanceFailure

type PerformanceFailure struct {
	ErrorCode domain.ErrorCode `json:"error_code"`
	Count     uint64           `json:"count"`
}

type PerformanceLatencySlice

type PerformanceLatencySlice struct {
	Count     uint64  `json:"count"`
	P50MS     float64 `json:"p50_ms"`
	P95MS     float64 `json:"p95_ms"`
	P99MS     float64 `json:"p99_ms"`
	AverageMS float64 `json:"average_ms"`
}

type PerformanceProfile

type PerformanceProfile struct {
	LoadMode           domain.LoadMode         `json:"load_mode,omitempty"`
	ArrivalPattern     load.ArrivalPattern     `json:"arrival_pattern,omitempty"`
	WorkloadMode       PerformanceWorkloadMode `json:"workload_mode,omitempty"`
	RandomInput        bool                    `json:"random_input,omitempty"`
	AffinityEnabled    bool                    `json:"affinity_enabled,omitempty"`
	RandomSeed         uint32                  `json:"random_seed,omitempty"`
	RequestCount       uint64                  `json:"request_count"`
	DurationMS         uint64                  `json:"duration_ms"`
	Concurrency        uint32                  `json:"concurrency"`
	RatePerSecond      float64                 `json:"rate_per_second,omitempty"`
	MaxInFlight        uint32                  `json:"max_in_flight,omitempty"`
	TimeoutMS          uint64                  `json:"timeout_ms"`
	InputTokens        uint32                  `json:"input_tokens"`
	OutputTokens       uint32                  `json:"output_tokens"`
	InputTokensStdDev  uint32                  `json:"input_tokens_stddev,omitempty"`
	OutputTokensStdDev uint32                  `json:"output_tokens_stddev,omitempty"`
	SharedPrefixTokens uint32                  `json:"shared_prefix_tokens,omitempty"`
	WarmupRequests     uint64                  `json:"warmup_requests,omitempty"`
	RampDurationMS     uint64                  `json:"ramp_duration_ms,omitempty"`
	RampRequestCap     uint64                  `json:"ramp_request_cap,omitempty"`
	SliceDurationMS    uint64                  `json:"slice_duration_ms,omitempty"`
	SLOTTFTMS          float64                 `json:"slo_ttft_ms,omitempty"`
	SLOTPOTMS          float64                 `json:"slo_tpot_ms,omitempty"`
	SLOE2EMS           float64                 `json:"slo_e2e_ms,omitempty"`
	SLOTargetPercent   float64                 `json:"slo_target_percent,omitempty"`
	CapacityEnabled    bool                    `json:"capacity_enabled,omitempty"`
	CapacityStart      float64                 `json:"capacity_start,omitempty"`
	CapacityStep       float64                 `json:"capacity_step,omitempty"`
}

type PerformanceProgress

type PerformanceProgress struct {
	Phase              load.Phase `json:"phase"`
	Planned            uint64     `json:"planned"`
	Offered            uint64     `json:"offered,omitempty"`
	Launched           uint64     `json:"launched"`
	Completed          uint64     `json:"completed"`
	InFlight           uint64     `json:"in_flight,omitempty"`
	PeakInFlight       uint64     `json:"peak_in_flight"`
	Succeeded          uint64     `json:"succeeded"`
	Failed             uint64     `json:"failed"`
	Rejected           uint64     `json:"rejected"`
	Stopped            bool       `json:"stopped,omitempty"`
	Capped             bool       `json:"capped,omitempty"`
	CapacityRungNumber uint32     `json:"capacity_rung_number,omitempty"`
	CapacityRungCount  uint32     `json:"capacity_rung_count,omitempty"`
	CapacityTarget     float64    `json:"capacity_target,omitempty"`
	SendDurationMS     float64    `json:"send_duration_ms"`
	DrainDurationMS    float64    `json:"drain_duration_ms"`
	TotalDurationMS    float64    `json:"total_duration_ms"`
}

type PerformanceRampSummary

type PerformanceRampSummary struct {
	Shape               string                    `json:"shape"`
	DurationMS          uint64                    `json:"duration_ms"`
	Steps               uint32                    `json:"steps"`
	TargetConcurrency   uint32                    `json:"target_concurrency,omitempty"`
	TargetRatePerSecond float64                   `json:"target_rate_per_second,omitempty"`
	CompletedWindow     bool                      `json:"completed_window"`
	Traffic             PerformanceTrafficSummary `json:"traffic"`
}

type PerformanceReport

type PerformanceReport struct {
	ExecutionOrigin *domain.ExecutionOrigin    `json:"execution_origin"`
	Protocol        domain.Protocol            `json:"protocol"`
	SchemaVersion   int                        `json:"schema_version"`
	ReportID        string                     `json:"report_id,omitempty"`
	GeneratedAt     string                     `json:"generated_at,omitempty"`
	Archived        bool                       `json:"archived"`
	ArchiveStatus   PerformanceArchiveStatus   `json:"archive_status"`
	Success         bool                       `json:"success"`
	AddressMode     AddressMode                `json:"address_mode"`
	BaseURL         string                     `json:"base_url"`
	Endpoint        string                     `json:"endpoint"`
	ModelID         string                     `json:"model_id"`
	Profile         PerformanceProfile         `json:"profile"`
	RequestBudget   *PerformanceRequestBudget  `json:"request_budget,omitempty"`
	Warmup          *PerformanceTrafficSummary `json:"warmup,omitempty"`
	Ramp            *PerformanceRampSummary    `json:"ramp,omitempty"`
	TimeSlices      []PerformanceTimeSlice     `json:"time_slices,omitempty"`
	SLOAssessment   *PerformanceSLOAssessment  `json:"slo_assessment,omitempty"`
	CapacityResult  *PerformanceCapacityResult `json:"capacity_result,omitempty"`
	Progress        PerformanceProgress        `json:"progress"`
	Metrics         load.Metrics               `json:"metrics"`
	Failures        []PerformanceFailure       `json:"failures"`
	Samples         []PerformanceSample        `json:"samples"`
	ErrorCode       domain.ErrorCode           `json:"error_code,omitempty"`
}

PerformanceReport is an ephemeral, bounded report. It contains no Model, Channel, Case, Plan, credential, prompt, provider payload, or raw error.

func DecodePlanResult

func DecodePlanResult(result domain.Result) (PerformanceReport, error)

DecodePlanResult validates the same checkpoint contract used by standalone performance jobs, including partial results retained after interruption.

type PerformanceReportIDFactory

type PerformanceReportIDFactory func(time.Time) (string, error)

type PerformanceRequestBudget

type PerformanceRequestBudget struct {
	Limit       uint64 `json:"limit"`
	WarmupCap   uint64 `json:"warmup_cap"`
	RampCap     uint64 `json:"ramp_cap"`
	MeasuredCap uint64 `json:"measured_cap"`
	TotalCap    uint64 `json:"total_cap"`
}

type PerformanceResponseEvidence

type PerformanceResponseEvidence struct {
	CaptureStatus PerformanceEvidenceCaptureStatus `json:"capture_status"`
	ContentType   string                           `json:"content_type,omitempty"`
	RequestID     string                           `json:"request_id,omitempty"`
	Body          string                           `json:"body,omitempty"`
	BodyBytes     uint64                           `json:"body_bytes"`
	Truncated     bool                             `json:"truncated"`
	Redacted      bool                             `json:"redacted"`
}

PerformanceResponseEvidence is a bounded, redacted response captured only for a failed request. It never contains request headers or credentials.

type PerformanceSLOAssessment

type PerformanceSLOAssessment struct {
	LatencyPrecision   string                   `json:"latency_precision,omitempty"`
	Status             PerformanceSLOStatus     `json:"status"`
	Thresholds         PerformanceSLOThresholds `json:"thresholds"`
	TargetPercent      float64                  `json:"target_percent"`
	TotalRequests      uint64                   `json:"total_requests"`
	GoodRequests       uint64                   `json:"good_requests"`
	BadRequests        uint64                   `json:"bad_requests"`
	GoodRequestPercent float64                  `json:"good_request_percent"`
	GoodputQPS         float64                  `json:"goodput_qps"`
	Violations         PerformanceSLOViolations `json:"violations"`
}

type PerformanceSLOStatus

type PerformanceSLOStatus string
const (
	PerformanceSLONotEvaluated PerformanceSLOStatus = "not_evaluated"
	PerformanceSLOPassed       PerformanceSLOStatus = "passed"
	PerformanceSLOFailed       PerformanceSLOStatus = "failed"
)

type PerformanceSLOThresholds

type PerformanceSLOThresholds struct {
	TTFTMS float64 `json:"ttft_ms"`
	TPOTMS float64 `json:"tpot_ms"`
	E2EMS  float64 `json:"e2e_ms"`
}

type PerformanceSLOViolations

type PerformanceSLOViolations struct {
	Transport uint64 `json:"transport"`
	TTFT      uint64 `json:"ttft"`
	TPOT      uint64 `json:"tpot"`
	E2E       uint64 `json:"e2e"`
}

type PerformanceSample

type PerformanceSample struct {
	TTFTObserved       bool                         `json:"ttft_observed,omitempty"`
	RequestIndex       uint64                       `json:"request_index"`
	TargetInputTokens  uint32                       `json:"target_input_tokens,omitempty"`
	TargetOutputTokens uint32                       `json:"target_output_tokens,omitempty"`
	ScheduledOffsetMS  float64                      `json:"scheduled_offset_ms"`
	StartedOffsetMS    float64                      `json:"started_offset_ms"`
	FinishedOffsetMS   float64                      `json:"finished_offset_ms"`
	ScheduleLagMS      float64                      `json:"schedule_lag_ms"`
	E2EMS              float64                      `json:"e2e_ms"`
	TTFBMS             float64                      `json:"ttfb_ms"`
	TTFTAnyMS          float64                      `json:"ttft_any_ms"`
	TTFTVisibleMS      float64                      `json:"ttft_visible_ms"`
	TTFTMS             float64                      `json:"ttft_ms"`
	TTSTMS             float64                      `json:"ttst_ms"`
	ObservedICLMS      float64                      `json:"observed_icl_ms"`
	SemanticChunkCount uint64                       `json:"semantic_chunk_count"`
	TPOTMS             float64                      `json:"tpot_ms"`
	HTTPStatus         int                          `json:"http_status"`
	Success            bool                         `json:"success"`
	TimedOut           bool                         `json:"timed_out"`
	PromptTokens       uint64                       `json:"prompt_tokens"`
	CompletionTokens   uint64                       `json:"completion_tokens"`
	CachedTokens       uint64                       `json:"cached_tokens"`
	ErrorCode          domain.ErrorCode             `json:"error_code,omitempty"`
	ResponseEvidence   *PerformanceResponseEvidence `json:"response_evidence,omitempty"`
}

PerformanceSample is the request-level measurement boundary used by charts. Failed samples may carry a bounded, redacted response. Request bodies, prompts, credentials, headers, and unredacted provider text remain excluded.

type PerformanceStage

type PerformanceStage string
const (
	PerformanceStagePreparing PerformanceStage = "preparing"
	PerformanceStageWarmup    PerformanceStage = "warmup"
	PerformanceStageRamp      PerformanceStage = "ramp"
	PerformanceStageMeasured  PerformanceStage = "measured"
	PerformanceStageCapacity  PerformanceStage = "capacity"
)

type PerformanceTimeSlice

type PerformanceTimeSlice struct {
	SliceIndex         uint64                  `json:"slice_index"`
	StartMS            float64                 `json:"start_ms"`
	EndMS              float64                 `json:"end_ms"`
	Partial            bool                    `json:"partial"`
	Offered            uint64                  `json:"offered"`
	Launched           uint64                  `json:"launched"`
	Completed          uint64                  `json:"completed"`
	Succeeded          uint64                  `json:"succeeded"`
	Failed             uint64                  `json:"failed"`
	Rejected           uint64                  `json:"rejected"`
	PromptTokens       uint64                  `json:"prompt_tokens"`
	CompletionTokens   uint64                  `json:"completion_tokens"`
	CachedTokens       uint64                  `json:"cached_tokens"`
	TTFB               PerformanceLatencySlice `json:"ttfb"`
	TTFTAny            PerformanceLatencySlice `json:"ttft_any"`
	TTFTVisible        PerformanceLatencySlice `json:"ttft_visible"`
	TTFT               PerformanceLatencySlice `json:"ttft"`
	TTST               PerformanceLatencySlice `json:"ttst"`
	ObservedICL        PerformanceLatencySlice `json:"observed_icl"`
	SemanticChunkCount PerformanceCountSlice   `json:"semantic_chunk_count"`
	TPOT               PerformanceLatencySlice `json:"tpot"`
	E2E                PerformanceLatencySlice `json:"e2e"`
}

type PerformanceTrafficSummary

type PerformanceTrafficSummary struct {
	RequestCap       uint64               `json:"request_cap"`
	Offered          uint64               `json:"offered"`
	Launched         uint64               `json:"launched"`
	Completed        uint64               `json:"completed"`
	Succeeded        uint64               `json:"succeeded"`
	Failed           uint64               `json:"failed"`
	TimedOut         uint64               `json:"timed_out"`
	Rejected         uint64               `json:"rejected"`
	PeakInFlight     uint64               `json:"peak_in_flight"`
	PromptTokens     uint64               `json:"prompt_tokens"`
	CompletionTokens uint64               `json:"completion_tokens"`
	CachedTokens     uint64               `json:"cached_tokens"`
	SendDurationMS   float64              `json:"send_duration_ms"`
	DrainDurationMS  float64              `json:"drain_duration_ms"`
	TotalDurationMS  float64              `json:"total_duration_ms"`
	Failures         []PerformanceFailure `json:"failures"`
	Stopped          bool                 `json:"stopped"`
	Capped           bool                 `json:"capped"`
}

type PerformanceWorkloadMode

type PerformanceWorkloadMode string
const (
	PerformanceWorkloadFixed  PerformanceWorkloadMode = "fixed"
	PerformanceWorkloadNormal PerformanceWorkloadMode = "normal"
)

type PreparedPerformance

type PreparedPerformance struct {
	ReportID    string             `json:"report_id"`
	Protocol    domain.Protocol    `json:"protocol"`
	AddressMode AddressMode        `json:"address_mode"`
	BaseURL     string             `json:"base_url"`
	Endpoint    string             `json:"endpoint"`
	ModelID     string             `json:"model_id"`
	Profile     PerformanceProfile `json:"profile"`
}

PreparedPerformance contains resolved, non-secret execution input. It has no references that require a desktop catalog, remembered key, or Suite resolver.

func PreparePlanEntry

func PreparePlanEntry(id string, channel domain.ChannelSnapshot, profile domain.PerformancePlanProfile) (PreparedPerformance, error)

PreparePlanEntry resolves a frozen plan item's profile without touching the catalog or credentials. The enclosing Run owns the execution and its report.

func (PreparedPerformance) Validate

func (prepared PreparedPerformance) Validate() error

type Service

type Service struct {
	*Host
	// contains filtered or unexported fields
}

func New

func New(dependencies Dependencies) *Service

func (*Service) BuildPerformance

func (service *Service) BuildPerformance(
	ctx context.Context,
	command PerformanceCommand,
) (PreparedPerformance, *credentials.Lease, domain.ErrorCode)

func (*Service) RunPerformance

func (service *Service) RunPerformance(ctx context.Context, command PerformanceCommand) (PerformanceReport, error)

func (*Service) RunPerformanceWithProgress

func (service *Service) RunPerformanceWithProgress(
	ctx context.Context,
	command PerformanceCommand,
	onProgress func(PerformanceProgress),
) (PerformanceReport, error)

type StoredChannelConnectionResolver

type StoredChannelConnectionResolver struct {
	// contains filtered or unexported fields
}

func (*StoredChannelConnectionResolver) Resolve

type TaskReference

type TaskReference struct {
	SuiteID       string `json:"suite_id"`
	SuiteRevision uint64 `json:"suite_revision"`
	SourceRunID   string `json:"source_run_id,omitempty"`
}

TaskReference pins the same Suite definitions used by a quick task, including historical runs whose authored definitions may no longer be in the catalog.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL