throughput

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackpressureController

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

func NewBackpressureController

func NewBackpressureController(maxDepth int) *BackpressureController

func (*BackpressureController) ShouldApplyBackpressure

func (bc *BackpressureController) ShouldApplyBackpressure(
	currentDepth int,

	queueName string,
) bool

type BurstDetector

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

func NewBurstDetector

func NewBurstDetector() *BurstDetector

func (*BurstDetector) IsBurstDetected

func (b *BurstDetector) IsBurstDetected() bool

func (*BurstDetector) Record

func (b *BurstDetector) Record()

type CapacityAnalyzer

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

func NewCapacityAnalyzer

func NewCapacityAnalyzer() *CapacityAnalyzer

func (*CapacityAnalyzer) GetBottlenecks

func (a *CapacityAnalyzer) GetBottlenecks() map[string]string

func (*CapacityAnalyzer) GetScalingRecommendations

func (a *CapacityAnalyzer) GetScalingRecommendations() map[string]string

func (*CapacityAnalyzer) PredictMaxThroughput

func (a *CapacityAnalyzer) PredictMaxThroughput() float64

func (*CapacityAnalyzer) RecordThroughputDataPoint

func (a *CapacityAnalyzer) RecordThroughputDataPoint(
	throughput float64,

	cpuUsage float64,

	memoryUsage float64,
)

type ErrorCategory

type ErrorCategory string
const (
	CategorySystem ErrorCategory = "system"

	CategoryUser ErrorCategory = "user"

	CategoryExternal ErrorCategory = "external"

	CategoryTransient ErrorCategory = "transient"
)

type ErrorClassifier

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

func NewErrorClassifier

func NewErrorClassifier() *ErrorClassifier

func (*ErrorClassifier) AnalyzeErrorTrends

func (ec *ErrorClassifier) AnalyzeErrorTrends() map[string]interface{}

func (*ErrorClassifier) GetDetailedErrorBreakdown

func (ec *ErrorClassifier) GetDetailedErrorBreakdown() map[ErrorCategory]map[ErrorType]int

func (*ErrorClassifier) GetErrorSummary

func (ec *ErrorClassifier) GetErrorSummary() map[ErrorCategory]int

func (*ErrorClassifier) RecordError

func (ec *ErrorClassifier) RecordError(
	category ErrorCategory,

	errorType ErrorType,

	message string,
) ErrorEvent

type ErrorEvent

type ErrorEvent struct {
	Timestamp time.Time

	Category ErrorCategory

	Type ErrorType

	Message string

	BusinessImpact float64
}

type ErrorType

type ErrorType string
const (
	ErrorTypeInternalServerError ErrorType = "internal_server_error"

	ErrorTypeResourceExhaustion ErrorType = "resource_exhaustion"

	ErrorTypeConfigurationError ErrorType = "configuration_error"

	ErrorTypeInvalidIntent ErrorType = "invalid_intent"

	ErrorTypeAuthorizationFailed ErrorType = "authorization_failed"

	ErrorTypeValidationError ErrorType = "validation_error"

	ErrorTypeLLMServiceFailure ErrorType = "llm_service_failure"

	ErrorTypeNetworkConnectivity ErrorType = "network_connectivity"

	ErrorTypeExternalAPIError ErrorType = "external_api_error"

	ErrorTypeTimeout ErrorType = "timeout"

	ErrorTypeRateLimitExceeded ErrorType = "rate_limit_exceeded"

	ErrorTypeTemporaryFailure ErrorType = "temporary_failure"
)

type IntentType

type IntentType string
const (
	IntentTypeCore IntentType = "core"

	IntentTypeRAN IntentType = "ran"

	IntentTypeSlicing IntentType = "slicing"

	IntentTypeDefault IntentType = "default"
)

type LinearRegression

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

func NewLinearRegression

func NewLinearRegression() *LinearRegression

func (*LinearRegression) AddDataPoint

func (lr *LinearRegression) AddDataPoint(timestamp time.Time, value float64)

func (*LinearRegression) Predict

func (lr *LinearRegression) Predict() float64

type LoadProfile

type LoadProfile string
const (
	ProfileSteady LoadProfile = "steady"

	ProfileRampUp LoadProfile = "ramp_up"

	ProfilePeakBurst LoadProfile = "peak_burst"

	ProfileRandomSpike LoadProfile = "random_spike"
)

type LoadTestConfig

type LoadTestConfig struct {
	MaxConcurrentIntents int

	IntentsPerMinute int

	TestDuration time.Duration

	ErrorInjectionRate float64

	LoadProfile LoadProfile
}

type LoadTestResult

type LoadTestResult struct {
	Timestamp time.Time

	Throughput float64

	Latency time.Duration

	ErrorRate float64

	ConcurrentIntents int

	Success bool
}

type LoadTestRun

type LoadTestRun struct {
	StartTime time.Time

	CompletedTests int

	Successful int

	Failed int
}

type LoadTester

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

func NewLoadTester

func NewLoadTester(config LoadTestConfig) *LoadTester

func (*LoadTester) AnalyzeTestResults

func (lt *LoadTester) AnalyzeTestResults() map[string]interface{}

func (*LoadTester) RunLoadTest

func (lt *LoadTester) RunLoadTest(ctx context.Context) ([]LoadTestResult, error)

type Priority

type Priority int
const (
	PriorityLow Priority = iota

	PriorityMedium

	PriorityHigh

	PriorityCritical
)

func (Priority) String

func (p Priority) String() string

type QueueMonitor

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

func NewQueueMonitor

func NewQueueMonitor() *QueueMonitor

func (*QueueMonitor) Dequeue

func (m *QueueMonitor) Dequeue(
	queueName string,

	priority Priority,

	enqueuedAt time.Time,

	status string,
) error

func (*QueueMonitor) Enqueue

func (m *QueueMonitor) Enqueue(
	queueName string,

	priority Priority,

	enqueuedAt time.Time,
) error

func (*QueueMonitor) GetQueueStats

func (m *QueueMonitor) GetQueueStats(queueName string) (*QueueStats, error)

func (*QueueMonitor) RegisterQueue

func (m *QueueMonitor) RegisterQueue(
	name string,

	maxDepth int,
) *QueueTracker

type QueueStats

type QueueStats struct {
	CurrentDepth int

	MaxDepth int

	AverageWaitTime time.Duration

	PriorityDistribution map[Priority]int
}

type QueueTracker

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

type ResourceUtilization

type ResourceUtilization struct {
	CPUCores float64

	MemoryGB float64

	IntentsPerCPU float64

	IntentsPerGB float64
}

type RetryStrategy

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

func NewRetryStrategy

func NewRetryStrategy() *RetryStrategy

func (*RetryStrategy) GetRetryEffectiveness

func (rs *RetryStrategy) GetRetryEffectiveness() map[ErrorType]float64

func (*RetryStrategy) RecordRetryOutcome

func (rs *RetryStrategy) RecordRetryOutcome(
	errorType ErrorType,

	successful bool,
)

func (*RetryStrategy) ShouldRetry

func (rs *RetryStrategy) ShouldRetry(
	errorType ErrorType,

	currentAttempt int,
) bool

type SlidingWindowCounter

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

func NewSlidingWindowCounter

func NewSlidingWindowCounter(window time.Duration) *SlidingWindowCounter

func (*SlidingWindowCounter) Increment

func (c *SlidingWindowCounter) Increment()

func (*SlidingWindowCounter) Rate

func (c *SlidingWindowCounter) Rate() float64

type ThroughputDataPoint

type ThroughputDataPoint struct {
	Timestamp time.Time

	Throughput float64

	CPUUsage float64

	MemoryUsage float64
}

type ThroughputTracker

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

func NewThroughputTracker

func NewThroughputTracker() *ThroughputTracker

func (*ThroughputTracker) GetRegionalThroughput

func (t *ThroughputTracker) GetRegionalThroughput() map[string]float64

func (*ThroughputTracker) GetThroughputRates

func (t *ThroughputTracker) GetThroughputRates() map[string]float64

func (*ThroughputTracker) RecordIntent

func (t *ThroughputTracker) RecordIntent(
	intentType IntentType,

	status string,

	processingTime time.Duration,

	region string,
)

Jump to

Keyboard shortcuts

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