Documentation
¶
Index ¶
- type AccessPattern
- type AccessPredictor
- type AdaptiveController
- func (ac *AdaptiveController) ApplyAdjustment(adjustment *ParameterAdjustment) error
- func (ac *AdaptiveController) GenerateAdjustments(recommendations []*OptimizationRecommendation) []*ParameterAdjustment
- func (ac *AdaptiveController) GetMetrics() *ControllerMetrics
- func (ac *AdaptiveController) Start() error
- func (ac *AdaptiveController) Stop()
- func (ac *AdaptiveController) ValidateAdjustment(adjustment *ParameterAdjustment) bool
- type AdaptiveParameter
- type AdaptivePredictor
- type AdaptiveProfiler
- type AdaptiveTuner
- type AdaptiveTunerConfig
- type AdaptiveTunerImpl
- func (at *AdaptiveTunerImpl) GetAdaptationReport() *AdaptationReport
- func (at *AdaptiveTunerImpl) GetLearningInsights() *LearningInsights
- func (at *AdaptiveTunerImpl) GetMetrics() *AdaptiveTunerMetrics
- func (at *AdaptiveTunerImpl) GetStats() *AdaptiveTunerStats
- func (at *AdaptiveTunerImpl) Start() error
- func (at *AdaptiveTunerImpl) Stop() error
- type AdaptiveTuningConfig
- type AdjustmentDirection
- type AdvancedLoadBalancer
- func (lb *AdvancedLoadBalancer) AddTarget(target *LoadBalanceTarget) error
- func (lb *AdvancedLoadBalancer) GetMetrics() *LoadBalancerMetrics
- func (lb *AdvancedLoadBalancer) RecordRequest(targetID string, latency time.Duration, success bool)
- func (lb *AdvancedLoadBalancer) RemoveTarget(targetID string) error
- func (lb *AdvancedLoadBalancer) SelectTarget(request *BalanceRequest) (*LoadBalanceTarget, error)
- func (lb *AdvancedLoadBalancer) Start() error
- func (lb *AdvancedLoadBalancer) Stop() error
- type AffinityRule
- type Alert
- type AlertChannel
- type AlertCondition
- type AlertConfig
- type AlertManager
- type AlertMessage
- type AlertMetrics
- type AlertRule
- type AlertingConfig
- type AnalyzerConfig
- type AnalyzerMetrics
- type ApplicationMetrics
- type AutoScaler
- type AutoScalingConfig
- type BalanceRequest
- type BalanceTarget
- type BalancerConfig
- type BalancerMetrics
- type BalancingStrategy
- type Benchmark
- type BenchmarkConfig
- type BenchmarkFunction
- type BenchmarkResult
- type BlockProfiler
- type Buffer
- type BufferPool
- type ByteSliceFactory
- type ByteSliceReset
- type CPUConfig
- type CPUMetrics
- type CPUOptimizationAlgorithm
- func (cpua *CPUOptimizationAlgorithm) Configure(config map[string]interface{}) error
- func (cpua *CPUOptimizationAlgorithm) GetName() string
- func (cpua *CPUOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
- func (cpua *CPUOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
- type CPUProfiler
- type CacheConfig
- type CacheEntry
- type CacheInvalidator
- type CacheInvalidatorConfig
- type CacheLevel
- type CacheLevelImpl
- type CacheManager
- type CacheManagerImpl
- func (cm *CacheManagerImpl) ApplyOptimization(action OptimizationAction) error
- func (cm *CacheManagerImpl) Clear(ctx context.Context) error
- func (cm *CacheManagerImpl) Delete(ctx context.Context, key string) error
- func (cm *CacheManagerImpl) DeleteMulti(ctx context.Context, keys []string) error
- func (cm *CacheManagerImpl) Get(ctx context.Context, key string) (interface{}, bool)
- func (cm *CacheManagerImpl) GetConfig() CacheConfig
- func (cm *CacheManagerImpl) GetMetrics() CacheMetrics
- func (cm *CacheManagerImpl) GetMulti(ctx context.Context, keys []string) (map[string]interface{}, error)
- func (cm *CacheManagerImpl) GetStats() CacheStats
- func (cm *CacheManagerImpl) Health() error
- func (cm *CacheManagerImpl) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
- func (cm *CacheManagerImpl) SetMulti(ctx context.Context, items map[string]interface{}, ttl time.Duration) error
- func (cm *CacheManagerImpl) Start(ctx context.Context) error
- func (cm *CacheManagerImpl) Stop() error
- func (cm *CacheManagerImpl) UpdateConfig(config CacheConfig) error
- type CacheMetrics
- type CacheOptimizationAlgorithm
- func (coa *CacheOptimizationAlgorithm) Configure(config map[string]interface{}) error
- func (coa *CacheOptimizationAlgorithm) GetName() string
- func (coa *CacheOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
- func (coa *CacheOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
- type CachePartition
- type CachePartitioner
- type CachePartitionerConfig
- type CacheStats
- type CacheStrategy
- type CacheWarmer
- type CacheWarmerConfig
- type CircuitBreaker
- type CircuitBreakerConfig
- type CircuitBreakerMetrics
- type CircuitBreakerSettings
- type CircuitState
- type ClientPermissions
- type ClusterNode
- type ClusterStatus
- type CollectorConfig
- type ConcurrencyConfig
- type ConcurrencyEngine
- func (e *ConcurrencyEngine) CreatePipeline(config PipelineConfig, stages []StageProcessor) (*ExecutionPipeline, error)
- func (e *ConcurrencyEngine) CreateWorkerPool(config WorkerPoolConfig, processor TaskProcessor) (*WorkerPool, error)
- func (e *ConcurrencyEngine) GetMetrics() *ConcurrencyMetrics
- func (e *ConcurrencyEngine) Start() error
- func (e *ConcurrencyEngine) Stop() error
- func (e *ConcurrencyEngine) SubmitTask(task Task) error
- func (e *ConcurrencyEngine) SubmitTasks(tasks []Task) error
- type ConcurrencyEngineConfig
- type ConcurrencyEngineImpl
- func (e *ConcurrencyEngineImpl) CreatePipeline(config PipelineConfig) (*Pipeline, error)
- func (e *ConcurrencyEngineImpl) CreateWorkerPool(config WorkerPoolConfig) (*WorkerPool, error)
- func (e *ConcurrencyEngineImpl) ExecuteBatch(tasks []Task, config BatchConfig) (*BatchResult, error)
- func (e *ConcurrencyEngineImpl) GetMetrics() *ConcurrencyMetrics
- func (e *ConcurrencyEngineImpl) GetStats() *ConcurrencyStats
- func (e *ConcurrencyEngineImpl) OptimizeForSystem()
- func (e *ConcurrencyEngineImpl) ProcessStream(stream <-chan Task, config StreamConfig) (<-chan TaskResult, error)
- func (e *ConcurrencyEngineImpl) Start() error
- func (e *ConcurrencyEngineImpl) Stop() error
- func (e *ConcurrencyEngineImpl) SubmitTask(task Task) error
- type ConcurrencyMetrics
- type ConcurrencyStrategy
- type ConcurrencyType
- type Config
- type Connection
- type ConnectionPool
- type ConsensusAlgorithm
- type ConsensusConfig
- type ConsensusLog
- type ConsensusManager
- type ConsensusMetrics
- type ConsensusState
- type ConsistentHashAlgorithm
- type ConsistentHashRing
- type CoordinationMode
- type CoordinatorConfig
- type CoordinatorMetrics
- type DashboardClient
- type DashboardConfig
- type DashboardMetrics
- type DataPoint
- type DefaultLogger
- type DiskMetrics
- type DistributedExecutionCoordinator
- func (c *DistributedExecutionCoordinator) CancelTask(taskID string) error
- func (c *DistributedExecutionCoordinator) GetClusterStatus() *ClusterStatus
- func (c *DistributedExecutionCoordinator) GetMetrics() *CoordinatorMetrics
- func (c *DistributedExecutionCoordinator) GetTaskStatus(taskID string) (*DistributedTask, error)
- func (c *DistributedExecutionCoordinator) Start() error
- func (c *DistributedExecutionCoordinator) Stop() error
- func (c *DistributedExecutionCoordinator) SubmitBatch(tasks []*DistributedTask) error
- func (c *DistributedExecutionCoordinator) SubmitTask(task *DistributedTask) error
- type DistributedExecutor
- type DistributedRateLimitConfig
- type DistributedRateLimiter
- func (d *DistributedRateLimiter) Allow(request *RateLimitRequest) (*RateLimitResult, error)
- func (d *DistributedRateLimiter) AllowN(key string, n int64) (*RateLimitResult, error)
- func (d *DistributedRateLimiter) GetMetrics() *RateLimitMetrics
- func (d *DistributedRateLimiter) GetStatus(key string) (*RateLimitResult, error)
- func (d *DistributedRateLimiter) Reset(key string) error
- func (d *DistributedRateLimiter) Start() error
- func (d *DistributedRateLimiter) Stop() error
- type DistributedScheduler
- type DistributedTask
- type ElectionConfig
- type ElectionMetrics
- type ExecutionPipeline
- type ExecutionTracer
- type ExecutorMetrics
- type FeedbackLoop
- type FileHandlePool
- type GCMetrics
- type GCStats
- type GCTuner
- type GeneticOptimizationAlgorithm
- func (goa *GeneticOptimizationAlgorithm) Configure(config map[string]interface{}) error
- func (goa *GeneticOptimizationAlgorithm) GetName() string
- func (goa *GeneticOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
- func (goa *GeneticOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
- type GoroutineMetrics
- type GoroutineProfiler
- type HealthCheck
- type HealthCheckConfig
- type HealthCheckType
- type HealthChecker
- type HealthMetrics
- type HealthMonitor
- type HealthMonitorConfig
- type HeartbeatManager
- type Hotspot
- type IOConfig
- type Individual
- type InvalidationCallback
- type InvalidationHandler
- type InvalidationStrategy
- type InvalidatorMetrics
- type IssueType
- type KeyRange
- type LargeMemoryBlock
- type LeaderElection
- func (le *LeaderElection) GetCurrentLeader() string
- func (le *LeaderElection) GetCurrentTerm() int64
- func (le *LeaderElection) HasLeader() bool
- func (le *LeaderElection) IsElectionInProgress() bool
- func (le *LeaderElection) IsLeader() bool
- func (le *LeaderElection) Start() error
- func (le *LeaderElection) StartElection()
- func (le *LeaderElection) Stop() error
- type LeastConnectionsAlgorithm
- type LoadAnalyzer
- type LoadBalanceAlgorithm
- type LoadBalanceStrategy
- type LoadBalanceTarget
- type LoadBalancer
- type LoadBalancerConfig
- type LoadBalancerImpl
- func (lb *LoadBalancerImpl) AddNode(config NodeConfig) error
- func (lb *LoadBalancerImpl) BalanceRequest(request *Request) (*LoadBalancerNode, error)
- func (lb *LoadBalancerImpl) GetLoadReport() *LoadBalancerReport
- func (lb *LoadBalancerImpl) GetMetrics() *LoadBalancerMetrics
- func (lb *LoadBalancerImpl) GetNodeDistribution() map[string]float64
- func (lb *LoadBalancerImpl) GetStats() *LoadBalancerStats
- func (lb *LoadBalancerImpl) RemoveNode(nodeID string) error
- func (lb *LoadBalancerImpl) Start() error
- func (lb *LoadBalancerImpl) Stop() error
- type LoadBalancerMetrics
- type LoadBalancerNode
- type LoadBalancingAlgorithm
- type LoadBalancingConfig
- type LoadDataPoint
- type LoadForecast
- type LoadHistory
- type LoadPredictionConfig
- type LoadPredictor
- type Logger
- type MLConfig
- type MLModelType
- type MachineLearner
- func (ml *MachineLearner) EvaluateModels() *ModelEvaluation
- func (ml *MachineLearner) ExtractFeatures() *FeatureSet
- func (ml *MachineLearner) ExtractPatterns() []*PerformancePattern
- func (ml *MachineLearner) GetMetrics() *MLMetrics
- func (ml *MachineLearner) Start() error
- func (ml *MachineLearner) Stop()
- func (ml *MachineLearner) TrainModels(features *FeatureSet)
- func (ml *MachineLearner) UpdateModels()
- type MapFactory
- type MapReset
- type MemoryBlock
- type MemoryConfig
- type MemoryManager
- type MemoryMetrics
- type MemoryOptimizationAlgorithm
- func (moa *MemoryOptimizationAlgorithm) Configure(config map[string]interface{}) error
- func (moa *MemoryOptimizationAlgorithm) GetName() string
- func (moa *MemoryOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
- func (moa *MemoryOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
- type MemoryPool
- type MemoryPoolConfig
- type MemoryPoolManager
- func (m *MemoryPoolManager) CreatePool(name string, factory ObjectFactory, reset ObjectReset) (*ObjectPool, error)
- func (m *MemoryPoolManager) Get(poolName string) (interface{}, error)
- func (m *MemoryPoolManager) GetMetrics() *MemoryPoolMetrics
- func (m *MemoryPoolManager) GetPool(name string) (*ObjectPool, error)
- func (m *MemoryPoolManager) GetPoolMetrics() []*ObjectPoolMetrics
- func (m *MemoryPoolManager) Put(poolName string, obj interface{}) error
- func (m *MemoryPoolManager) Start() error
- func (m *MemoryPoolManager) Stop() error
- type MemoryPoolMetrics
- type MemoryProfiler
- func (mp *MemoryProfiler) Collect() (*ProfileData, error)
- func (mp *MemoryProfiler) GetName() string
- func (mp *MemoryProfiler) GetSnapshots() []*MemorySnapshot
- func (mp *MemoryProfiler) IsEnabled() bool
- func (mp *MemoryProfiler) Start() error
- func (mp *MemoryProfiler) Stop() error
- func (mp *MemoryProfiler) TakeSnapshot()
- type MemorySnapshot
- type Metric
- type MetricQuery
- type MetricResult
- type MetricSummary
- type MetricsCollector
- type MetricsMessage
- type MonitorMetrics
- type MonitoringConfig
- type MonitoringDashboard
- func (d *MonitoringDashboard) AddMetricsCollector(collector MetricsCollector)
- func (d *MonitoringDashboard) BroadcastAlert(alert AlertMessage)
- func (d *MonitoringDashboard) GetMetrics() *DashboardMetrics
- func (d *MonitoringDashboard) RemoveMetricsCollector(name string)
- func (d *MonitoringDashboard) Start() error
- func (d *MonitoringDashboard) Stop() error
- type MutexProfiler
- type NetworkBuffers
- type NetworkConfig
- type NetworkMetrics
- type NodeInfo
- type NodeLoad
- type NodeLoadInfo
- type NodeManager
- type NodeManagerConfig
- type NodeMetrics
- type NodePerformance
- type NodeResources
- type NodeRole
- type NodeStatus
- type NotificationChannel
- type ObjectFactory
- type ObjectPool
- type ObjectPoolMetrics
- type ObjectReset
- type OptimizationAction
- type OptimizationAlgorithm
- type OptimizationAnalyzer
- type OptimizationCondition
- type OptimizationConfig
- type OptimizationConstraint
- type OptimizationEngine
- type OptimizationEngineImpl
- func (oe *OptimizationEngineImpl) GetMetrics() *OptimizationMetrics
- func (oe *OptimizationEngineImpl) GetStats() *OptimizationStats
- func (oe *OptimizationEngineImpl) RegisterAlgorithm(name string, algorithm OptimizationAlgorithm)
- func (oe *OptimizationEngineImpl) Start() error
- func (oe *OptimizationEngineImpl) Stop() error
- type OptimizationExecutor
- type OptimizationObjective
- type OptimizationRecommendation
- type OptimizationResult
- type OptimizationRule
- type OptimizationScheduler
- type OptimizationSolution
- type OptimizationStrategy
- type OptimizationType
- type OptimizerConfig
- type OptimizerMetrics
- type OrchestratorConfig
- type OrchestratorMetrics
- type Partition
- type PartitionConfig
- type PartitionHealth
- type PartitionManager
- type PartitionMetrics
- type PartitionStatus
- type PartitionStrategy
- type PartitionerMetrics
- type PartitioningStrategy
- type PerformanceAlerter
- type PerformanceAnalyzer
- func (a *PerformanceAnalyzer) Analyze()
- func (pa *PerformanceAnalyzer) AnalyzeMetrics(metrics *PerformanceMetrics)
- func (pa *PerformanceAnalyzer) GetHotspots() []*Hotspot
- func (pa *PerformanceAnalyzer) GetIssues() []*PerformanceIssue
- func (a *PerformanceAnalyzer) GetMetrics() *AnalyzerMetrics
- func (pa *PerformanceAnalyzer) Start() error
- func (pa *PerformanceAnalyzer) Stop() error
- type PerformanceConstraints
- type PerformanceIssue
- type PerformanceManager
- func (pm *PerformanceManager) ApplyProfile(profileName string) error
- func (pm *PerformanceManager) DisableAutoTuning() error
- func (pm *PerformanceManager) EnableAutoTuning() error
- func (pm *PerformanceManager) GetMetrics() *PerformanceMetrics
- func (pm *PerformanceManager) GetProfile(name string) (*PerformanceProfile, error)
- func (pm *PerformanceManager) GetRecommendations() []OptimizationRecommendation
- func (pm *PerformanceManager) OptimizeFor(target PerformanceTarget) error
- func (pm *PerformanceManager) Shutdown(timeout time.Duration) error
- type PerformanceMetrics
- type PerformanceMonitor
- type PerformanceMonitorImpl
- func (m *PerformanceMonitorImpl) CreateAnalyzer(config AnalyzerConfig) (*PerformanceAnalyzer, error)
- func (m *PerformanceMonitorImpl) CreateCollector(config CollectorConfig) (*MetricsCollector, error)
- func (m *PerformanceMonitorImpl) ExportMetrics(format string) ([]byte, error)
- func (m *PerformanceMonitorImpl) GetCurrentMetrics() map[string]interface{}
- func (m *PerformanceMonitorImpl) GetMetrics() *MonitoringMetrics
- func (m *PerformanceMonitorImpl) GetPerformanceReport() *PerformanceReport
- func (m *PerformanceMonitorImpl) GetStats() *MonitoringStats
- func (m *PerformanceMonitorImpl) GetTopMetrics(limit int) []*MetricSummary
- func (m *PerformanceMonitorImpl) RecordMetric(name string, value float64, tags map[string]string)
- func (m *PerformanceMonitorImpl) Start() error
- func (m *PerformanceMonitorImpl) StartTrace(name string) *TraceSpan
- func (m *PerformanceMonitorImpl) Stop() error
- type PerformanceOptimizer
- type PerformanceProfile
- type PerformanceProfiler
- func (p *PerformanceProfiler) CollectMetrics() *PerformanceMetrics
- func (p *PerformanceProfiler) GenerateReport(period ReportPeriod) (*PerformanceReport, error)
- func (p *PerformanceProfiler) GetMetrics() *ProfilerMetrics
- func (p *PerformanceProfiler) Start() error
- func (p *PerformanceProfiler) Stop() error
- type PerformanceReport
- type PerformanceReporter
- type PerformanceSummary
- type PerformanceTarget
- type PerformanceThresholds
- type Pipeline
- type PipelineConfig
- type PipelineMetrics
- type PipelineResult
- type PipelineStage
- type PipelineStageConfig
- type PoolInfo
- type PoolMetrics
- type PoolStats
- type PooledAllocator
- type PooledObject
- type PredictionAlgorithm
- type PredictionMetrics
- type PredictionModel
- type PredictionPoint
- type PredictorConfig
- type Priority
- type PriorityQueue
- type ProcessingNode
- type ProfileData
- type Profiler
- func NewBlockProfiler(dir string, logger Logger) Profiler
- func NewCPUProfiler(dir string, logger Logger) Profiler
- func NewGoroutineProfiler(dir string, logger Logger) Profiler
- func NewMemoryProfiler(dir string, logger Logger) Profiler
- func NewMutexProfiler(dir string, logger Logger) Profiler
- func NewTraceProfiler(dir string, logger Logger) Profiler
- type ProfilerConfig
- type ProfilerMetrics
- type Proposal
- type ProposalStatus
- type ProposalType
- type QueueStats
- type RandomAlgorithm
- type RateLimitAlgorithm
- type RateLimitMetrics
- type RateLimitRequest
- type RateLimitResult
- type RateLimitScripts
- type ReadPreference
- type RedisClusterCache
- func (c *RedisClusterCache) Delete(key string) error
- func (c *RedisClusterCache) Get(key string) (interface{}, error)
- func (c *RedisClusterCache) GetMetrics() *CacheMetrics
- func (c *RedisClusterCache) InvalidateByTags(tags []string) error
- func (c *RedisClusterCache) Set(key string, value interface{}, ttl time.Duration, tags ...string) error
- func (c *RedisClusterCache) Start() error
- func (c *RedisClusterCache) Stop() error
- type RedisClusterCacheConfig
- type Replica
- type ReplicationConfig
- type ReplicationManager
- type ReplicationMetrics
- type ReportExporter
- type ReportPeriod
- type ReportTemplate
- type ReporterConfig
- type ReporterMetrics
- type RequestRouter
- type Resource
- type ResourceAllocator
- type ResourceConfig
- type ResourceMetrics
- type ResourceMonitor
- type ResourcePool
- type ResourcePoolConfig
- type ResourcePoolManager
- type ResourcePoolManagerImpl
- func (m *ResourcePoolManagerImpl) CreateBufferPool(config BufferPoolConfig) (ResourcePool, error)
- func (m *ResourcePoolManagerImpl) CreateConnectionPool(config ConnectionPoolConfig) (ResourcePool, error)
- func (m *ResourcePoolManagerImpl) CreateMemoryPool(config MemoryPoolConfig) (ResourcePool, error)
- func (m *ResourcePoolManagerImpl) GetMetrics() *ResourceMetrics
- func (m *ResourcePoolManagerImpl) GetPool(id string) (ResourcePool, error)
- func (m *ResourcePoolManagerImpl) GetStats() *ResourceStats
- func (m *ResourcePoolManagerImpl) OptimizeForSystem()
- func (m *ResourcePoolManagerImpl) Start() error
- func (m *ResourcePoolManagerImpl) Stop() error
- type ResourceRecycler
- type ResourceStats
- type ResourceType
- type RoundRobinAlgorithm
- type ScalingCondition
- type ScalingEvent
- type ScalingHistory
- type ScalingMetrics
- type ScalingPolicy
- type ScalingTrigger
- type ScalingType
- type Scheduler
- type SchedulerConfig
- type SchedulerMetrics
- type SchedulingAlgorithm
- type ServiceDiscovery
- type Severity
- type ShardingConfig
- type SimulatedAnnealingAlgorithm
- func (saa *SimulatedAnnealingAlgorithm) Configure(config map[string]interface{}) error
- func (saa *SimulatedAnnealingAlgorithm) GetName() string
- func (saa *SimulatedAnnealingAlgorithm) IsApplicable(context OptimizationContext) bool
- func (saa *SimulatedAnnealingAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
- type SlicePool
- type Snapshot
- type Solution
- type StageMetrics
- type StageProcessor
- type StageWorker
- type StringBuilderFactory
- type StringBuilderReset
- type SystemProfiler
- type TagIndex
- type TargetHealthStatus
- type TargetStatistics
- type Task
- type TaskCache
- type TaskConstraints
- type TaskExecutor
- type TaskMonitor
- type TaskOrchestrator
- func (to *TaskOrchestrator) CancelTask(taskID string) error
- func (to *TaskOrchestrator) GetActiveTasks() []*DistributedTask
- func (to *TaskOrchestrator) GetTaskStatus(taskID string) (*DistributedTask, error)
- func (to *TaskOrchestrator) RebalanceTasks()
- func (to *TaskOrchestrator) Start() error
- func (to *TaskOrchestrator) Stop() error
- func (to *TaskOrchestrator) SubmitBatch(tasks []*DistributedTask) error
- func (to *TaskOrchestrator) SubmitTask(task *DistributedTask) error
- type TaskPartition
- type TaskPartitioner
- type TaskProcessor
- type TaskRecovery
- type TaskRequirements
- type TaskScheduler
- type TaskStatus
- type ThreadPool
- type ThresholdOperator
- type ThrottlingConfig
- type Toleration
- type TraceProfiler
- type Trend
- type TrendAnalysis
- type TrendDirection
- type TuningParameter
- type TuningRecommendation
- type VoteRecord
- type WarmerMetrics
- type WarmingExecutor
- type WarmingJob
- type WarmingScheduler
- type WarmingStrategy
- type WarmingWorker
- type WeightAlgorithm
- type WeightConfig
- type WeightedRoundRobinAlgorithm
- type Worker
- type WorkerCoordinator
- type WorkerMetrics
- type WorkerPool
- func (wp *WorkerPool) AddWorker() error
- func (p *WorkerPool) GetActiveWorkers() int
- func (p *WorkerPool) GetMetrics() *WorkerPoolMetrics
- func (wp *WorkerPool) RemoveWorker() error
- func (p *WorkerPool) Scale(delta int) error
- func (p *WorkerPool) Start() error
- func (p *WorkerPool) Stop()
- func (p *WorkerPool) SubmitTask(task Task) error
- type WorkerPoolConfig
- type WorkerPoolInfo
- type WorkerStatus
- type WorkloadCoordinator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessPattern ¶ added in v0.2.0
type AccessPredictor ¶ added in v0.2.0
type AccessPredictor struct {
// contains filtered or unexported fields
}
func (*AccessPredictor) RecordAccess ¶ added in v0.2.0
func (ap *AccessPredictor) RecordAccess(key string)
type AdaptiveController ¶
type AdaptiveController struct {
// contains filtered or unexported fields
}
AdaptiveController manages automatic parameter adjustments
func NewAdaptiveController ¶
func NewAdaptiveController(config ControllerConfig, logger Logger) *AdaptiveController
func (*AdaptiveController) ApplyAdjustment ¶
func (ac *AdaptiveController) ApplyAdjustment(adjustment *ParameterAdjustment) error
func (*AdaptiveController) GenerateAdjustments ¶
func (ac *AdaptiveController) GenerateAdjustments(recommendations []*OptimizationRecommendation) []*ParameterAdjustment
func (*AdaptiveController) GetMetrics ¶
func (ac *AdaptiveController) GetMetrics() *ControllerMetrics
func (*AdaptiveController) Start ¶
func (ac *AdaptiveController) Start() error
func (*AdaptiveController) Stop ¶
func (ac *AdaptiveController) Stop()
func (*AdaptiveController) ValidateAdjustment ¶
func (ac *AdaptiveController) ValidateAdjustment(adjustment *ParameterAdjustment) bool
type AdaptiveParameter ¶
type AdaptiveParameter struct {
Name string
CurrentValue float64
MinValue float64
MaxValue float64
MaxChangeRate float64
MinChangeThreshold float64
LastUpdate time.Time
History []ParameterChange
// contains filtered or unexported fields
}
AdaptiveParameter represents a tunable system parameter
func NewAdaptiveParameter ¶
func NewAdaptiveParameter(name string, current, min, max, maxChangeRate float64) *AdaptiveParameter
func (*AdaptiveParameter) GetRecentTrend ¶
func (ap *AdaptiveParameter) GetRecentTrend() TrendDirection
func (*AdaptiveParameter) RecordChange ¶
func (ap *AdaptiveParameter) RecordChange(oldValue, newValue float64)
type AdaptivePredictor ¶
type AdaptivePredictor struct {
// contains filtered or unexported fields
}
AdaptivePredictor forecasts performance trends and needs
type AdaptiveProfiler ¶
type AdaptiveProfiler struct {
// contains filtered or unexported fields
}
AdaptiveProfiler provides continuous performance profiling
type AdaptiveTuner ¶
type AdaptiveTuner interface {
// Tuning operations
TuneParameter(name string, value interface{}) error
GetParameter(name string) (interface{}, error)
ResetParameter(name string) error
// Learning operations
RecordOutcome(parameters map[string]interface{}, performance float64) error
GetRecommendations() ([]TuningRecommendation, error)
// Model management
SaveModel(path string) error
LoadModel(path string) error
ResetModel() error
// Lifecycle
Start(ctx context.Context) error
Stop() error
Health() error
}
AdaptiveTuner interface for adaptive tuning
type AdaptiveTunerConfig ¶
type AdaptiveTunerConfig struct {
TuningInterval time.Duration
LearningInterval time.Duration
ImpactMeasurementDelay time.Duration
MachineLearning MLConfig
Profiler ProfilerConfig
Controller ControllerConfig
Predictor PredictorConfig
Feedback FeedbackConfig
Optimizer OptimizerConfig
Knowledge KnowledgeConfig
}
type AdaptiveTunerImpl ¶
type AdaptiveTunerImpl struct {
// contains filtered or unexported fields
}
AdaptiveTunerImpl provides intelligent, self-adjusting performance tuning
func NewAdaptiveTuner ¶
func NewAdaptiveTuner(config AdaptiveTunerConfig, logger Logger) *AdaptiveTunerImpl
func (*AdaptiveTunerImpl) GetAdaptationReport ¶
func (at *AdaptiveTunerImpl) GetAdaptationReport() *AdaptationReport
func (*AdaptiveTunerImpl) GetLearningInsights ¶
func (at *AdaptiveTunerImpl) GetLearningInsights() *LearningInsights
func (*AdaptiveTunerImpl) GetMetrics ¶
func (at *AdaptiveTunerImpl) GetMetrics() *AdaptiveTunerMetrics
func (*AdaptiveTunerImpl) GetStats ¶
func (at *AdaptiveTunerImpl) GetStats() *AdaptiveTunerStats
func (*AdaptiveTunerImpl) Start ¶
func (at *AdaptiveTunerImpl) Start() error
func (*AdaptiveTunerImpl) Stop ¶
func (at *AdaptiveTunerImpl) Stop() error
type AdaptiveTuningConfig ¶
type AdaptiveTuningConfig struct{}
type AdjustmentDirection ¶
type AdjustmentDirection int
const ( Increase AdjustmentDirection = iota Decrease Set )
type AdvancedLoadBalancer ¶ added in v0.2.0
type AdvancedLoadBalancer struct {
// contains filtered or unexported fields
}
AdvancedLoadBalancer provides sophisticated load balancing and auto-scaling
func NewAdvancedLoadBalancer ¶ added in v0.2.0
func NewAdvancedLoadBalancer(config LoadBalancerConfig, logger Logger) *AdvancedLoadBalancer
NewAdvancedLoadBalancer creates a new advanced load balancer
func (*AdvancedLoadBalancer) AddTarget ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) AddTarget(target *LoadBalanceTarget) error
AddTarget adds a new target
func (*AdvancedLoadBalancer) GetMetrics ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) GetMetrics() *LoadBalancerMetrics
GetMetrics returns load balancer metrics
func (*AdvancedLoadBalancer) RecordRequest ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) RecordRequest(targetID string, latency time.Duration, success bool)
RecordRequest records the result of a request
func (*AdvancedLoadBalancer) RemoveTarget ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) RemoveTarget(targetID string) error
RemoveTarget removes a target
func (*AdvancedLoadBalancer) SelectTarget ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) SelectTarget(request *BalanceRequest) (*LoadBalanceTarget, error)
SelectTarget selects the best target based on the configured strategy
func (*AdvancedLoadBalancer) Start ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) Start() error
Start starts the load balancer
func (*AdvancedLoadBalancer) Stop ¶ added in v0.2.0
func (lb *AdvancedLoadBalancer) Stop() error
Stop stops the load balancer
type AffinityRule ¶ added in v0.2.0
type AffinityRule struct {
Key string `json:"key"`
Operator string `json:"operator"`
Values []string `json:"values"`
Weight int `json:"weight"`
}
AffinityRule defines node affinity rules
type Alert ¶
type Alert struct {
ID string `json:"id"`
Rule string `json:"rule"`
Severity Severity `json:"severity"`
Title string `json:"title"`
Message string `json:"message"`
Value float64 `json:"value"`
Threshold float64 `json:"threshold"`
Timestamp time.Time `json:"timestamp"`
Resolved bool `json:"resolved"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
Metadata map[string]interface{} `json:"metadata"`
}
type AlertChannel ¶ added in v0.2.0
type AlertCondition ¶ added in v0.2.0
type AlertCondition string
const ( AlertConditionGreaterThan AlertCondition = "greater_than" AlertConditionLessThan AlertCondition = "less_than" AlertConditionEquals AlertCondition = "equals" AlertConditionChange AlertCondition = "change" )
type AlertConfig ¶ added in v0.2.0
type AlertManager ¶ added in v0.2.0
type AlertManager struct {
// contains filtered or unexported fields
}
Alert management
func NewAlertManager ¶ added in v0.2.0
func NewAlertManager(config AlertConfig, logger Logger) *AlertManager
func (*AlertManager) CheckAlerts ¶ added in v0.2.0
func (am *AlertManager) CheckAlerts(metrics *PerformanceMetrics)
func (*AlertManager) GetActiveAlerts ¶ added in v0.2.0
func (am *AlertManager) GetActiveAlerts() []*Alert
func (*AlertManager) Start ¶ added in v0.2.0
func (am *AlertManager) Start() error
func (*AlertManager) Stop ¶ added in v0.2.0
func (am *AlertManager) Stop() error
type AlertMessage ¶ added in v0.2.0
type AlertMessage struct {
Type string `json:"type"`
Timestamp time.Time `json:"timestamp"`
Severity string `json:"severity"`
Title string `json:"title"`
Message string `json:"message"`
Source string `json:"source"`
Metadata map[string]interface{} `json:"metadata"`
}
AlertMessage represents a real-time alert
type AlertMetrics ¶ added in v0.2.0
type AlertingConfig ¶
type AlertingConfig struct {
Enabled bool `json:"enabled"`
Rules []AlertRule `json:"rules"`
Channels []NotificationChannel `json:"channels"`
}
type AnalyzerConfig ¶ added in v0.2.0
type AnalyzerMetrics ¶ added in v0.2.0
type ApplicationMetrics ¶ added in v0.2.0
type ApplicationMetrics struct {
RequestsPerSecond float64 `json:"requests_per_second"`
AverageLatency time.Duration `json:"average_latency"`
P95Latency time.Duration `json:"p95_latency"`
P99Latency time.Duration `json:"p99_latency"`
ErrorRate float64 `json:"error_rate"`
ActiveConnections int `json:"active_connections"`
QueueDepth int `json:"queue_depth"`
}
type AutoScaler ¶
type AutoScaler struct {
// contains filtered or unexported fields
}
AutoScaler handles automatic scaling of targets
func NewAutoScaler ¶
func NewAutoScaler(config AutoScalingConfig, logger Logger) *AutoScaler
func (*AutoScaler) GetMetrics ¶
func (as *AutoScaler) GetMetrics() *AutoScalerMetrics
func (*AutoScaler) Start ¶
func (as *AutoScaler) Start() error
func (*AutoScaler) Stop ¶
func (as *AutoScaler) Stop() error
func (*AutoScaler) TriggerScaleDown ¶
func (*AutoScaler) TriggerScaleUp ¶
type AutoScalingConfig ¶ added in v0.2.0
type AutoScalingConfig struct {
Enabled bool `json:"enabled"`
MinTargets int `json:"min_targets"`
MaxTargets int `json:"max_targets"`
ScaleUpThreshold float64 `json:"scale_up_threshold"`
ScaleDownThreshold float64 `json:"scale_down_threshold"`
ScaleUpCooldown time.Duration `json:"scale_up_cooldown"`
ScaleDownCooldown time.Duration `json:"scale_down_cooldown"`
EvaluationInterval time.Duration `json:"evaluation_interval"`
PredictiveScaling bool `json:"predictive_scaling"`
ScalingPolicies []ScalingPolicy `json:"scaling_policies"`
}
AutoScalingConfig defines auto-scaling configuration
type BalanceRequest ¶ added in v0.2.0
type BalanceRequest struct {
Key string `json:"key"`
Strategy string `json:"strategy"`
Preferences map[string]interface{} `json:"preferences"`
Metadata map[string]string `json:"metadata"`
}
BalanceRequest represents a load balancing request
type BalanceTarget ¶ added in v0.2.0
type BalancerConfig ¶ added in v0.2.0
type BalancerMetrics ¶ added in v0.2.0
type BalancingStrategy ¶ added in v0.2.0
type BalancingStrategy string
BalancingStrategy defines load balancing strategies
const ( BalancingRoundRobin BalancingStrategy = "round_robin" BalancingLeastActive BalancingStrategy = "least_active" BalancingWeighted BalancingStrategy = "weighted" BalancingConsistent BalancingStrategy = "consistent_hash" BalancingAdaptive BalancingStrategy = "adaptive" )
type Benchmark ¶ added in v0.2.0
type Benchmark struct {
Name string `json:"name"`
Description string `json:"description"`
Function BenchmarkFunction `json:"-"`
Results []*BenchmarkResult `json:"results"`
Config BenchmarkConfig `json:"config"`
Enabled bool `json:"enabled"`
}
Benchmark management
type BenchmarkConfig ¶ added in v0.2.0
type BenchmarkFunction ¶ added in v0.2.0
type BenchmarkFunction func() BenchmarkResult
type BenchmarkResult ¶ added in v0.2.0
type BenchmarkResult struct {
Timestamp time.Time `json:"timestamp"`
Duration time.Duration `json:"duration"`
Iterations int `json:"iterations"`
NsPerOp int64 `json:"ns_per_op"`
AllocsPerOp int64 `json:"allocs_per_op"`
BytesPerOp int64 `json:"bytes_per_op"`
MemoryUsed int64 `json:"memory_used"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
type BlockProfiler ¶ added in v0.2.0
type BlockProfiler struct {
// contains filtered or unexported fields
}
func (*BlockProfiler) Collect ¶ added in v0.2.0
func (bp *BlockProfiler) Collect() (*ProfileData, error)
func (*BlockProfiler) GetName ¶ added in v0.2.0
func (bp *BlockProfiler) GetName() string
func (*BlockProfiler) IsEnabled ¶ added in v0.2.0
func (bp *BlockProfiler) IsEnabled() bool
func (*BlockProfiler) Start ¶ added in v0.2.0
func (bp *BlockProfiler) Start() error
func (*BlockProfiler) Stop ¶ added in v0.2.0
func (bp *BlockProfiler) Stop() error
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool manages reusable byte buffers
func NewBufferPool ¶
func NewBufferPool(config BufferPoolConfig) *BufferPool
func (*BufferPool) Close ¶
func (p *BufferPool) Close() error
func (*BufferPool) GetStats ¶
func (p *BufferPool) GetStats() PoolStats
func (*BufferPool) Release ¶
func (p *BufferPool) Release(resource Resource) error
func (*BufferPool) Resize ¶
func (p *BufferPool) Resize(newSize int) error
type ByteSliceFactory ¶ added in v0.2.0
type ByteSliceFactory struct {
Size int
}
ByteSliceFactory creates byte slice pools
func NewByteSliceFactory ¶ added in v0.2.0
func NewByteSliceFactory(size int) *ByteSliceFactory
func (*ByteSliceFactory) CreateObject ¶ added in v0.2.0
func (f *ByteSliceFactory) CreateObject() interface{}
func (*ByteSliceFactory) GetObjectType ¶ added in v0.2.0
func (f *ByteSliceFactory) GetObjectType() string
type ByteSliceReset ¶ added in v0.2.0
type ByteSliceReset struct{}
ByteSliceReset resets byte slices
func (*ByteSliceReset) ResetObject ¶ added in v0.2.0
func (r *ByteSliceReset) ResetObject(obj interface{}) error
type CPUConfig ¶
type CPUConfig struct {
MaxCores int `json:"max_cores"`
AffinityMask string `json:"affinity_mask"`
SchedulingPolicy string `json:"scheduling_policy"`
Priority int `json:"priority"`
}
CPUConfig defines CPU optimization settings
type CPUMetrics ¶ added in v0.2.0
type CPUMetrics struct {
Usage float64 `json:"usage"`
UserTime time.Duration `json:"user_time"`
SystemTime time.Duration `json:"system_time"`
IdleTime time.Duration `json:"idle_time"`
LoadAverage []float64 `json:"load_average"`
}
Various metrics structures
type CPUOptimizationAlgorithm ¶
type CPUOptimizationAlgorithm struct {
// contains filtered or unexported fields
}
CPU Optimization Algorithm
func (*CPUOptimizationAlgorithm) Configure ¶
func (cpua *CPUOptimizationAlgorithm) Configure(config map[string]interface{}) error
func (*CPUOptimizationAlgorithm) GetName ¶
func (cpua *CPUOptimizationAlgorithm) GetName() string
func (*CPUOptimizationAlgorithm) IsApplicable ¶
func (cpua *CPUOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
func (*CPUOptimizationAlgorithm) Optimize ¶
func (cpua *CPUOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
type CPUProfiler ¶ added in v0.2.0
type CPUProfiler struct {
// contains filtered or unexported fields
}
Individual profiler structs
func (*CPUProfiler) Collect ¶ added in v0.2.0
func (cp *CPUProfiler) Collect() (*ProfileData, error)
func (*CPUProfiler) GetName ¶ added in v0.2.0
func (cp *CPUProfiler) GetName() string
func (*CPUProfiler) IsEnabled ¶ added in v0.2.0
func (cp *CPUProfiler) IsEnabled() bool
func (*CPUProfiler) Start ¶ added in v0.2.0
func (cp *CPUProfiler) Start() error
func (*CPUProfiler) Stop ¶ added in v0.2.0
func (cp *CPUProfiler) Stop() error
type CacheConfig ¶
type CacheConfig struct {
Enabled bool `json:"enabled"`
MaxSize int64 `json:"max_size"`
TTL time.Duration `json:"ttl"`
Strategy CacheStrategy `json:"strategy"`
Levels []CacheLevel `json:"levels"`
Compression bool `json:"compression"`
Persistence bool `json:"persistence"`
Sharding ShardingConfig `json:"sharding"`
}
CacheConfig defines caching configuration
type CacheEntry ¶
type CacheEntry struct {
Key string `json:"key"`
Value interface{} `json:"value"`
TTL time.Duration `json:"ttl"`
CreatedAt time.Time `json:"created_at"`
AccessedAt time.Time `json:"accessed_at"`
AccessCount int64 `json:"access_count"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
Compressed bool `json:"compressed"`
Size int64 `json:"size"`
}
CacheEntry represents a cache entry with metadata
type CacheInvalidator ¶ added in v0.2.0
type CacheInvalidator struct {
// contains filtered or unexported fields
}
CacheInvalidator handles cache invalidation
func NewCacheInvalidator ¶ added in v0.2.0
func NewCacheInvalidator(config CacheInvalidatorConfig, logger Logger) *CacheInvalidator
func (*CacheInvalidator) InvalidateByTags ¶ added in v0.2.0
func (ci *CacheInvalidator) InvalidateByTags(tags []string) error
func (*CacheInvalidator) Start ¶ added in v0.2.0
func (ci *CacheInvalidator) Start() error
func (*CacheInvalidator) Stop ¶ added in v0.2.0
func (ci *CacheInvalidator) Stop() error
type CacheInvalidatorConfig ¶ added in v0.2.0
type CacheInvalidatorConfig struct {
Strategies []InvalidationStrategy `json:"strategies"`
TTLCheckInterval time.Duration `json:"ttl_check_interval"`
MaxTagsPerKey int `json:"max_tags_per_key"`
BatchSize int `json:"batch_size"`
}
type CacheLevel ¶
type CacheLevel struct {
Name string `json:"name"`
MaxSize int64 `json:"max_size"`
TTL time.Duration `json:"ttl"`
Strategy CacheStrategy `json:"strategy"`
Compression bool `json:"compression"`
Persistence bool `json:"persistence"`
}
CacheLevel defines a cache tier
type CacheLevelImpl ¶
type CacheLevelImpl struct {
// contains filtered or unexported fields
}
func (*CacheLevelImpl) Clear ¶
func (cl *CacheLevelImpl) Clear()
func (*CacheLevelImpl) Delete ¶
func (cl *CacheLevelImpl) Delete(key string)
func (*CacheLevelImpl) Get ¶
func (cl *CacheLevelImpl) Get(key string) (interface{}, bool)
type CacheManager ¶
type CacheManager interface {
// Cache operations
Get(ctx context.Context, key string) (interface{}, bool)
Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
Delete(ctx context.Context, key string) error
Clear(ctx context.Context) error
// Multi-operations
GetMulti(ctx context.Context, keys []string) (map[string]interface{}, error)
SetMulti(ctx context.Context, items map[string]interface{}, ttl time.Duration) error
DeleteMulti(ctx context.Context, keys []string) error
// Management
GetMetrics() CacheMetrics
GetStats() CacheStats
ApplyOptimization(action OptimizationAction) error
// Configuration
UpdateConfig(config CacheConfig) error
GetConfig() CacheConfig
// Lifecycle
Start(ctx context.Context) error
Stop() error
Health() error
}
CacheManager interface for caching operations
func NewCacheManager ¶
func NewCacheManager(config CacheConfig, logger Logger) CacheManager
type CacheManagerImpl ¶
type CacheManagerImpl struct {
// contains filtered or unexported fields
}
CacheManagerImpl implements comprehensive caching with memory optimization
func (*CacheManagerImpl) ApplyOptimization ¶
func (cm *CacheManagerImpl) ApplyOptimization(action OptimizationAction) error
func (*CacheManagerImpl) Delete ¶
func (cm *CacheManagerImpl) Delete(ctx context.Context, key string) error
func (*CacheManagerImpl) DeleteMulti ¶
func (cm *CacheManagerImpl) DeleteMulti(ctx context.Context, keys []string) error
func (*CacheManagerImpl) Get ¶
func (cm *CacheManagerImpl) Get(ctx context.Context, key string) (interface{}, bool)
func (*CacheManagerImpl) GetConfig ¶
func (cm *CacheManagerImpl) GetConfig() CacheConfig
func (*CacheManagerImpl) GetMetrics ¶
func (cm *CacheManagerImpl) GetMetrics() CacheMetrics
func (*CacheManagerImpl) GetStats ¶
func (cm *CacheManagerImpl) GetStats() CacheStats
func (*CacheManagerImpl) Health ¶
func (cm *CacheManagerImpl) Health() error
func (*CacheManagerImpl) Stop ¶
func (cm *CacheManagerImpl) Stop() error
func (*CacheManagerImpl) UpdateConfig ¶
func (cm *CacheManagerImpl) UpdateConfig(config CacheConfig) error
type CacheMetrics ¶
type CacheMetrics struct {
Hits int64 `json:"hits"`
Misses int64 `json:"misses"`
Sets int64 `json:"sets"`
Deletes int64 `json:"deletes"`
Evictions int64 `json:"evictions"`
HitRatio float64 `json:"hit_ratio"`
AverageLatency time.Duration `json:"average_latency"`
TotalKeys int64 `json:"total_keys"`
TotalSize int64 `json:"total_size"`
PartitionMetrics []*PartitionMetrics `json:"partition_metrics"`
}
Various metrics structures
type CacheOptimizationAlgorithm ¶
type CacheOptimizationAlgorithm struct {
// contains filtered or unexported fields
}
Cache Optimization Algorithm
func (*CacheOptimizationAlgorithm) Configure ¶
func (coa *CacheOptimizationAlgorithm) Configure(config map[string]interface{}) error
func (*CacheOptimizationAlgorithm) GetName ¶
func (coa *CacheOptimizationAlgorithm) GetName() string
func (*CacheOptimizationAlgorithm) IsApplicable ¶
func (coa *CacheOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
func (*CacheOptimizationAlgorithm) Optimize ¶
func (coa *CacheOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
type CachePartition ¶ added in v0.2.0
type CachePartition struct {
ID int `json:"id"`
Node string `json:"node"`
KeyRange KeyRange `json:"key_range"`
Load float64 `json:"load"`
Health PartitionHealth `json:"health"`
}
CachePartition represents a cache partition
type CachePartitioner ¶ added in v0.2.0
type CachePartitioner struct {
// contains filtered or unexported fields
}
CachePartitioner handles cache partitioning across cluster nodes
func NewCachePartitioner ¶ added in v0.2.0
func NewCachePartitioner(config CachePartitionerConfig, strategy PartitionStrategy, count int, logger Logger) *CachePartitioner
func (*CachePartitioner) GetPartition ¶ added in v0.2.0
func (cp *CachePartitioner) GetPartition(key string) *CachePartition
func (*CachePartitioner) GetPartitionMetrics ¶ added in v0.2.0
func (cp *CachePartitioner) GetPartitionMetrics() []*PartitionMetrics
func (*CachePartitioner) Start ¶ added in v0.2.0
func (cp *CachePartitioner) Start() error
func (*CachePartitioner) Stop ¶ added in v0.2.0
func (cp *CachePartitioner) Stop() error
type CachePartitionerConfig ¶ added in v0.2.0
type CachePartitionerConfig struct {
RebalanceThreshold float64 `json:"rebalance_threshold"`
RebalanceInterval time.Duration `json:"rebalance_interval"`
MigrationBatchSize int `json:"migration_batch_size"`
HealthCheckInterval time.Duration `json:"health_check_interval"`
}
Configuration structures
type CacheStats ¶
type CacheStrategy ¶
type CacheStrategy string
Cache strategies
const ( CacheStrategyLRU CacheStrategy = "lru" CacheStrategyLFU CacheStrategy = "lfu" CacheStrategyFIFO CacheStrategy = "fifo" CacheStrategyAdaptive CacheStrategy = "adaptive" )
type CacheWarmer ¶ added in v0.2.0
type CacheWarmer struct {
// contains filtered or unexported fields
}
CacheWarmer handles proactive cache warming
func NewCacheWarmer ¶ added in v0.2.0
func NewCacheWarmer(config CacheWarmerConfig, cache *RedisClusterCache, logger Logger) *CacheWarmer
func (*CacheWarmer) Start ¶ added in v0.2.0
func (cw *CacheWarmer) Start() error
func (*CacheWarmer) Stop ¶ added in v0.2.0
func (cw *CacheWarmer) Stop() error
type CacheWarmerConfig ¶ added in v0.2.0
type CacheWarmerConfig struct {
Strategies []string `json:"strategies"`
WarmingInterval time.Duration `json:"warming_interval"`
ConcurrentWorkers int `json:"concurrent_workers"`
BatchSize int `json:"batch_size"`
PredictionWindow time.Duration `json:"prediction_window"`
MinAccessThreshold int64 `json:"min_access_threshold"`
}
type CircuitBreaker ¶ added in v0.2.0
type CircuitBreaker struct {
// contains filtered or unexported fields
}
CircuitBreaker protects targets from overload
func NewCircuitBreaker ¶ added in v0.2.0
func NewCircuitBreaker(config CircuitBreakerConfig, logger Logger) *CircuitBreaker
func (*CircuitBreaker) RecordRequest ¶ added in v0.2.0
func (cb *CircuitBreaker) RecordRequest(targetID string, success bool)
type CircuitBreakerConfig ¶ added in v0.2.0
type CircuitBreakerConfig struct {
Enabled bool `json:"enabled"`
FailureThreshold int `json:"failure_threshold"`
SuccessThreshold int `json:"success_threshold"`
Timeout time.Duration `json:"timeout"`
HalfOpenMaxRequests int `json:"half_open_max_requests"`
FailureRate float64 `json:"failure_rate"`
MinimumRequests int `json:"minimum_requests"`
SlidingWindowSize int `json:"sliding_window_size"`
}
CircuitBreakerConfig defines circuit breaker configuration
type CircuitBreakerMetrics ¶ added in v0.2.0
type CircuitBreakerSettings ¶ added in v0.2.0
type CircuitState ¶ added in v0.2.0
type CircuitState string
CircuitState represents circuit breaker states
const ( CircuitClosed CircuitState = "closed" CircuitOpen CircuitState = "open" CircuitHalfOpen CircuitState = "half_open" )
type ClientPermissions ¶ added in v0.2.0
type ClientPermissions struct {
ReadMetrics bool `json:"read_metrics"`
WriteConfig bool `json:"write_config"`
ManageAlerts bool `json:"manage_alerts"`
ExportData bool `json:"export_data"`
}
ClientPermissions defines what a client can access
type ClusterNode ¶ added in v0.2.0
type ClusterNode struct {
ID string `json:"id"`
Address string `json:"address"`
Status NodeStatus `json:"status"`
Role NodeRole `json:"role"`
Capabilities []string `json:"capabilities"`
Load NodeLoadInfo `json:"load"`
Resources NodeResources `json:"resources"`
LastHeartbeat time.Time `json:"last_heartbeat"`
Version string `json:"version"`
Metadata map[string]interface{} `json:"metadata"`
TasksAssigned int64 `json:"tasks_assigned"`
TasksCompleted int64 `json:"tasks_completed"`
TasksFailed int64 `json:"tasks_failed"`
HealthScore float64 `json:"health_score"`
Performance NodePerformance `json:"performance"`
}
ClusterNode represents a node in the distributed cluster
type ClusterStatus ¶ added in v0.2.0
type ClusterStatus struct {
Nodes map[string]*ClusterNode `json:"nodes"`
Leader string `json:"leader"`
Term int64 `json:"term"`
Consensus ConsensusState `json:"consensus"`
Tasks []*DistributedTask `json:"tasks"`
Metrics *CoordinatorMetrics `json:"metrics"`
}
ClusterStatus represents current cluster status
type CollectorConfig ¶
type ConcurrencyConfig ¶
type ConcurrencyConfig struct {
MaxWorkers int `json:"max_workers"`
QueueSize int `json:"queue_size"`
WorkerPools map[string]WorkerPoolConfig `json:"worker_pools"`
Strategies []ConcurrencyStrategy `json:"strategies"`
Throttling ThrottlingConfig `json:"throttling"`
}
ConcurrencyConfig defines concurrency settings
type ConcurrencyEngine ¶
type ConcurrencyEngine interface {
// Task execution
Submit(ctx context.Context, task Task) error
SubmitWithPriority(ctx context.Context, task Task, priority int) error
SubmitBatch(ctx context.Context, tasks []Task) error
// Worker pool management
ScaleWorkers(poolName string, count int) error
GetWorkerPools() map[string]WorkerPoolInfo
// Pipeline operations
CreatePipeline(name string, stages []PipelineStage) error
ExecutePipeline(ctx context.Context, pipelineName string, input interface{}) error
// Metrics and monitoring
GetMetrics() ConcurrencyMetrics
GetQueueStats() QueueStats
ApplyOptimization(action OptimizationAction) error
// Configuration
UpdateConfig(config ConcurrencyConfig) error
GetConfig() ConcurrencyConfig
// Lifecycle
Start(ctx context.Context) error
Stop() error
Health() error
}
ConcurrencyEngine interface for concurrency management
func NewConcurrencyEngine ¶
func NewConcurrencyEngine(config ConcurrencyEngineConfig, logger Logger) *ConcurrencyEngine
NewConcurrencyEngine creates a new concurrency engine
func (*ConcurrencyEngine) CreatePipeline ¶
func (e *ConcurrencyEngine) CreatePipeline(config PipelineConfig, stages []StageProcessor) (*ExecutionPipeline, error)
CreatePipeline creates a new execution pipeline
func (*ConcurrencyEngine) CreateWorkerPool ¶ added in v0.2.0
func (e *ConcurrencyEngine) CreateWorkerPool(config WorkerPoolConfig, processor TaskProcessor) (*WorkerPool, error)
CreateWorkerPool creates a new worker pool
func (*ConcurrencyEngine) GetMetrics ¶
func (e *ConcurrencyEngine) GetMetrics() *ConcurrencyMetrics
GetMetrics returns concurrency engine metrics
func (*ConcurrencyEngine) Start ¶
func (e *ConcurrencyEngine) Start() error
Start starts the concurrency engine
func (*ConcurrencyEngine) Stop ¶
func (e *ConcurrencyEngine) Stop() error
Stop stops the concurrency engine
func (*ConcurrencyEngine) SubmitTask ¶ added in v0.2.0
func (e *ConcurrencyEngine) SubmitTask(task Task) error
SubmitTask submits a task for execution
func (*ConcurrencyEngine) SubmitTasks ¶ added in v0.2.0
func (e *ConcurrencyEngine) SubmitTasks(tasks []Task) error
SubmitTasks submits multiple tasks for execution
type ConcurrencyEngineConfig ¶ added in v0.2.0
type ConcurrencyEngineConfig struct {
// Worker pool settings
DefaultPoolSize int `json:"default_pool_size"`
MaxWorkers int `json:"max_workers"`
MinWorkers int `json:"min_workers"`
WorkerIdleTimeout time.Duration `json:"worker_idle_timeout"`
// Task scheduling
SchedulingAlgorithm SchedulingAlgorithm `json:"scheduling_algorithm"`
PriorityLevels int `json:"priority_levels"`
TaskTimeout time.Duration `json:"task_timeout"`
MaxQueueSize int `json:"max_queue_size"`
// Load balancing
BalancingStrategy BalancingStrategy `json:"balancing_strategy"`
HealthCheckInterval time.Duration `json:"health_check_interval"`
CircuitBreakerConfig CircuitBreakerSettings `json:"circuit_breaker"`
// Coordination
EnableCoordination bool `json:"enable_coordination"`
CoordinationMode CoordinationMode `json:"coordination_mode"`
HeartbeatInterval time.Duration `json:"heartbeat_interval"`
// Performance optimization
EnableAdaptiveScaling bool `json:"enable_adaptive_scaling"`
ScalingInterval time.Duration `json:"scaling_interval"`
CPUThreshold float64 `json:"cpu_threshold"`
MemoryThreshold float64 `json:"memory_threshold"`
// Monitoring
EnableMetrics bool `json:"enable_metrics"`
MetricsInterval time.Duration `json:"metrics_interval"`
}
ConcurrencyEngineConfig defines configuration for the concurrency engine
func DefaultConcurrencyEngineConfig ¶ added in v0.2.0
func DefaultConcurrencyEngineConfig() ConcurrencyEngineConfig
Default configuration
type ConcurrencyEngineImpl ¶
type ConcurrencyEngineImpl struct {
// contains filtered or unexported fields
}
ConcurrencyEngine manages concurrent processing with various execution patterns
func NewConcurrencyEngine ¶
func NewConcurrencyEngine(config ConcurrencyConfig, logger Logger) *ConcurrencyEngineImpl
func (*ConcurrencyEngineImpl) CreatePipeline ¶
func (e *ConcurrencyEngineImpl) CreatePipeline(config PipelineConfig) (*Pipeline, error)
func (*ConcurrencyEngineImpl) CreateWorkerPool ¶
func (e *ConcurrencyEngineImpl) CreateWorkerPool(config WorkerPoolConfig) (*WorkerPool, error)
func (*ConcurrencyEngineImpl) ExecuteBatch ¶
func (e *ConcurrencyEngineImpl) ExecuteBatch(tasks []Task, config BatchConfig) (*BatchResult, error)
func (*ConcurrencyEngineImpl) GetMetrics ¶
func (e *ConcurrencyEngineImpl) GetMetrics() *ConcurrencyMetrics
func (*ConcurrencyEngineImpl) GetStats ¶
func (e *ConcurrencyEngineImpl) GetStats() *ConcurrencyStats
func (*ConcurrencyEngineImpl) OptimizeForSystem ¶
func (e *ConcurrencyEngineImpl) OptimizeForSystem()
func (*ConcurrencyEngineImpl) ProcessStream ¶
func (e *ConcurrencyEngineImpl) ProcessStream(stream <-chan Task, config StreamConfig) (<-chan TaskResult, error)
func (*ConcurrencyEngineImpl) Start ¶
func (e *ConcurrencyEngineImpl) Start() error
func (*ConcurrencyEngineImpl) Stop ¶
func (e *ConcurrencyEngineImpl) Stop() error
func (*ConcurrencyEngineImpl) SubmitTask ¶
func (e *ConcurrencyEngineImpl) SubmitTask(task Task) error
type ConcurrencyMetrics ¶
type ConcurrencyStrategy ¶
type ConcurrencyStrategy struct {
Name string `json:"name"`
Type ConcurrencyType `json:"type"`
Parameters map[string]interface{} `json:"parameters"`
Conditions []string `json:"conditions"`
}
ConcurrencyStrategy defines concurrency patterns
type ConcurrencyType ¶
type ConcurrencyType string
const ( ConcurrencyTypeWorkerPool ConcurrencyType = "worker_pool" ConcurrencyTypePipeline ConcurrencyType = "pipeline" ConcurrencyTypeFanOut ConcurrencyType = "fan_out" ConcurrencyTypeFanIn ConcurrencyType = "fan_in" ConcurrencyTypeProducer ConcurrencyType = "producer_consumer" )
type Config ¶
type Config struct {
// General settings
Enabled bool `json:"enabled"`
AutoTuning bool `json:"auto_tuning"`
ProfileName string `json:"profile_name"`
// Cache configuration
Cache CacheConfig `json:"cache"`
// Concurrency settings
Concurrency ConcurrencyConfig `json:"concurrency"`
// Resource management
Resources ResourceConfig `json:"resources"`
// Monitoring configuration
Monitoring MonitoringConfig `json:"monitoring"`
// Load balancing
LoadBalancing LoadBalancingConfig `json:"load_balancing"`
// Optimization settings
Optimization OptimizationConfig `json:"optimization"`
// Adaptive tuning
AdaptiveTuning AdaptiveTuningConfig `json:"adaptive_tuning"`
}
Config defines performance optimization configuration
type ConnectionPool ¶
type ConnectionPool struct {
// contains filtered or unexported fields
}
ConnectionPool manages database/network connections
func NewConnectionPool ¶
func NewConnectionPool(config ConnectionPoolConfig, logger Logger) *ConnectionPool
func (*ConnectionPool) Acquire ¶
func (p *ConnectionPool) Acquire(ctx context.Context) (Resource, error)
func (*ConnectionPool) Close ¶
func (p *ConnectionPool) Close() error
func (*ConnectionPool) GetStats ¶
func (p *ConnectionPool) GetStats() PoolStats
func (*ConnectionPool) Release ¶
func (p *ConnectionPool) Release(resource Resource) error
func (*ConnectionPool) Resize ¶
func (p *ConnectionPool) Resize(newSize int) error
type ConsensusAlgorithm ¶ added in v0.2.0
type ConsensusAlgorithm string
const ( ConsensusRaft ConsensusAlgorithm = "raft" ConsensusPBFT ConsensusAlgorithm = "pbft" ConsensusPaxos ConsensusAlgorithm = "paxos" ConsensusSimple ConsensusAlgorithm = "simple" )
type ConsensusConfig ¶ added in v0.2.0
type ConsensusLog ¶ added in v0.2.0
type ConsensusLog struct{}
type ConsensusManager ¶ added in v0.2.0
type ConsensusManager struct {
// contains filtered or unexported fields
}
ConsensusManager handles distributed consensus
func NewConsensusManager ¶ added in v0.2.0
func NewConsensusManager(config ConsensusConfig, redis *redis.Client, logger Logger) *ConsensusManager
func (*ConsensusManager) GetState ¶ added in v0.2.0
func (cm *ConsensusManager) GetState() ConsensusState
func (*ConsensusManager) Start ¶ added in v0.2.0
func (cm *ConsensusManager) Start() error
func (*ConsensusManager) Stop ¶ added in v0.2.0
func (cm *ConsensusManager) Stop() error
type ConsensusMetrics ¶ added in v0.2.0
type ConsensusMetrics struct{}
type ConsensusState ¶ added in v0.2.0
type ConsensusState string
Placeholder implementations for missing types and functions
type ConsistentHashAlgorithm ¶
type ConsistentHashAlgorithm struct {
// contains filtered or unexported fields
}
ConsistentHashAlgorithm implements consistent hashing
func (*ConsistentHashAlgorithm) Configure ¶
func (ch *ConsistentHashAlgorithm) Configure(config map[string]interface{}) error
func (*ConsistentHashAlgorithm) GetName ¶
func (ch *ConsistentHashAlgorithm) GetName() string
func (*ConsistentHashAlgorithm) SelectNode ¶
func (ch *ConsistentHashAlgorithm) SelectNode(nodes []*LoadBalancerNode, request *Request) (*LoadBalancerNode, error)
type ConsistentHashRing ¶ added in v0.2.0
type ConsistentHashRing struct {
// contains filtered or unexported fields
}
ConsistentHashRing implements consistent hashing for cache distribution
type CoordinationMode ¶ added in v0.2.0
type CoordinationMode string
CoordinationMode defines worker coordination modes
const ( CoordinationLocal CoordinationMode = "local" CoordinationDistributed CoordinationMode = "distributed" CoordinationHybrid CoordinationMode = "hybrid" )
type CoordinatorConfig ¶ added in v0.2.0
type CoordinatorConfig struct {
// Node identification
NodeID string `json:"node_id"`
ClusterName string `json:"cluster_name"`
Region string `json:"region"`
Zone string `json:"zone"`
// Redis configuration
RedisAddr string `json:"redis_addr"`
RedisPassword string `json:"redis_password"`
RedisDB int `json:"redis_db"`
// Coordination settings
HeartbeatInterval time.Duration `json:"heartbeat_interval"`
NodeTimeout time.Duration `json:"node_timeout"`
ElectionTimeout time.Duration `json:"election_timeout"`
ConsensusTimeout time.Duration `json:"consensus_timeout"`
// Task distribution
TaskPartitioning bool `json:"task_partitioning"`
ReplicationFactor int `json:"replication_factor"`
PartitionStrategy PartitionStrategy `json:"partition_strategy"`
LoadBalancingStrategy LoadBalanceStrategy `json:"load_balancing_strategy"`
// Fault tolerance
EnableFailover bool `json:"enable_failover"`
FailoverTimeout time.Duration `json:"failover_timeout"`
MaxRetries int `json:"max_retries"`
RetryBackoff time.Duration `json:"retry_backoff"`
// Performance optimization
EnableBatching bool `json:"enable_batching"`
BatchSize int `json:"batch_size"`
BatchTimeout time.Duration `json:"batch_timeout"`
EnableCompression bool `json:"enable_compression"`
// Monitoring
EnableMetrics bool `json:"enable_metrics"`
MetricsInterval time.Duration `json:"metrics_interval"`
EnableTracing bool `json:"enable_tracing"`
}
CoordinatorConfig defines distributed coordinator configuration
func DefaultCoordinatorConfig ¶ added in v0.2.0
func DefaultCoordinatorConfig() CoordinatorConfig
Default configuration
type CoordinatorMetrics ¶ added in v0.2.0
type CoordinatorMetrics struct {
TotalNodes int64 `json:"total_nodes"`
ActiveNodes int64 `json:"active_nodes"`
TasksDistributed int64 `json:"tasks_distributed"`
TasksCompleted int64 `json:"tasks_completed"`
TasksFailed int64 `json:"tasks_failed"`
AverageLatency time.Duration `json:"average_latency"`
Throughput float64 `json:"throughput"`
ElectionCount int64 `json:"election_count"`
ConsensusDecisions int64 `json:"consensus_decisions"`
FailoverEvents int64 `json:"failover_events"`
}
Various metrics structures
type DashboardClient ¶ added in v0.2.0
type DashboardClient struct {
ID string `json:"id"`
Conn *websocket.Conn `json:"-"`
Permissions ClientPermissions `json:"permissions"`
LastSeen time.Time `json:"last_seen"`
Subscriptions []string `json:"subscriptions"`
// contains filtered or unexported fields
}
DashboardClient represents a connected dashboard client
type DashboardConfig ¶ added in v0.2.0
type DashboardConfig struct {
// Server configuration
Host string `json:"host"`
Port int `json:"port"`
EnableTLS bool `json:"enable_tls"`
TLSCertFile string `json:"tls_cert_file"`
TLSKeyFile string `json:"tls_key_file"`
// Dashboard settings
UpdateInterval time.Duration `json:"update_interval"`
MaxClients int `json:"max_clients"`
ClientTimeout time.Duration `json:"client_timeout"`
// Data retention
HistoryDuration time.Duration `json:"history_duration"`
MaxDataPoints int `json:"max_data_points"`
// Authentication
EnableAuth bool `json:"enable_auth"`
AdminToken string `json:"admin_token"`
ReadOnlyToken string `json:"readonly_token"`
// Features
EnableAlerts bool `json:"enable_alerts"`
EnableExport bool `json:"enable_export"`
EnableDebug bool `json:"enable_debug"`
}
DashboardConfig defines configuration for the monitoring dashboard
func DefaultDashboardConfig ¶ added in v0.2.0
func DefaultDashboardConfig() DashboardConfig
DefaultDashboardConfig returns default configuration
type DashboardMetrics ¶ added in v0.2.0
type DashboardMetrics struct {
ConnectedClients int64 `json:"connected_clients"`
TotalConnections int64 `json:"total_connections"`
MessagesSent int64 `json:"messages_sent"`
MessagesReceived int64 `json:"messages_received"`
DataPointsStreamed int64 `json:"data_points_streamed"`
AverageLatency time.Duration `json:"average_latency"`
ErrorCount int64 `json:"error_count"`
}
DashboardMetrics tracks dashboard performance
type DefaultLogger ¶ added in v0.2.0
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger provides a simple logger implementation
func NewDefaultLogger ¶ added in v0.2.0
func NewDefaultLogger() *DefaultLogger
NewDefaultLogger creates a new default logger
func (*DefaultLogger) Debug ¶ added in v0.2.0
func (l *DefaultLogger) Debug(msg string, args ...interface{})
func (*DefaultLogger) Error ¶ added in v0.2.0
func (l *DefaultLogger) Error(msg string, args ...interface{})
func (*DefaultLogger) Info ¶ added in v0.2.0
func (l *DefaultLogger) Info(msg string, args ...interface{})
func (*DefaultLogger) Warn ¶ added in v0.2.0
func (l *DefaultLogger) Warn(msg string, args ...interface{})
type DiskMetrics ¶ added in v0.2.0
type DistributedExecutionCoordinator ¶ added in v0.2.0
type DistributedExecutionCoordinator struct {
// contains filtered or unexported fields
}
DistributedExecutionCoordinator manages distributed execution across multiple nodes
func NewDistributedExecutionCoordinator ¶ added in v0.2.0
func NewDistributedExecutionCoordinator(config CoordinatorConfig, logger Logger) (*DistributedExecutionCoordinator, error)
NewDistributedExecutionCoordinator creates a new distributed execution coordinator
func (*DistributedExecutionCoordinator) CancelTask ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) CancelTask(taskID string) error
CancelTask cancels a running task
func (*DistributedExecutionCoordinator) GetClusterStatus ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) GetClusterStatus() *ClusterStatus
GetClusterStatus returns current cluster status
func (*DistributedExecutionCoordinator) GetMetrics ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) GetMetrics() *CoordinatorMetrics
GetMetrics returns coordinator metrics
func (*DistributedExecutionCoordinator) GetTaskStatus ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) GetTaskStatus(taskID string) (*DistributedTask, error)
GetTaskStatus returns the status of a task
func (*DistributedExecutionCoordinator) Start ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) Start() error
Start starts the distributed execution coordinator
func (*DistributedExecutionCoordinator) Stop ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) Stop() error
Stop stops the distributed execution coordinator
func (*DistributedExecutionCoordinator) SubmitBatch ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) SubmitBatch(tasks []*DistributedTask) error
SubmitBatch submits a batch of tasks for distributed execution
func (*DistributedExecutionCoordinator) SubmitTask ¶ added in v0.2.0
func (c *DistributedExecutionCoordinator) SubmitTask(task *DistributedTask) error
SubmitTask submits a task for distributed execution
type DistributedExecutor ¶ added in v0.2.0
type DistributedExecutor struct{}
type DistributedRateLimitConfig ¶ added in v0.2.0
type DistributedRateLimitConfig struct {
// Redis connection
RedisAddr string `json:"redis_addr"`
RedisPassword string `json:"redis_password"`
RedisDB int `json:"redis_db"`
// Rate limiting configuration
KeyPrefix string `json:"key_prefix"`
DefaultLimit int64 `json:"default_limit"`
DefaultWindow time.Duration `json:"default_window"`
DefaultBurst int64 `json:"default_burst"`
// Algorithm settings
Algorithm RateLimitAlgorithm `json:"algorithm"`
SlidingWindowParts int `json:"sliding_window_parts"`
// Cleanup and maintenance
CleanupInterval time.Duration `json:"cleanup_interval"`
KeyExpiration time.Duration `json:"key_expiration"`
// Performance settings
EnablePipelining bool `json:"enable_pipelining"`
MaxRetries int `json:"max_retries"`
RetryDelay time.Duration `json:"retry_delay"`
// Monitoring
EnableMetrics bool `json:"enable_metrics"`
MetricsInterval time.Duration `json:"metrics_interval"`
}
DistributedRateLimitConfig defines configuration for distributed rate limiting
func DefaultDistributedRateLimitConfig ¶ added in v0.2.0
func DefaultDistributedRateLimitConfig() DistributedRateLimitConfig
DefaultDistributedRateLimitConfig returns default configuration
type DistributedRateLimiter ¶ added in v0.2.0
type DistributedRateLimiter struct {
// contains filtered or unexported fields
}
DistributedRateLimiter implements distributed rate limiting using Redis
func NewDistributedRateLimiter ¶ added in v0.2.0
func NewDistributedRateLimiter(config DistributedRateLimitConfig, logger Logger) (*DistributedRateLimiter, error)
NewDistributedRateLimiter creates a new distributed rate limiter
func (*DistributedRateLimiter) Allow ¶ added in v0.2.0
func (d *DistributedRateLimiter) Allow(request *RateLimitRequest) (*RateLimitResult, error)
Allow checks if a request is allowed under the rate limit
func (*DistributedRateLimiter) AllowN ¶ added in v0.2.0
func (d *DistributedRateLimiter) AllowN(key string, n int64) (*RateLimitResult, error)
AllowN checks if N requests are allowed under the rate limit
func (*DistributedRateLimiter) GetMetrics ¶ added in v0.2.0
func (d *DistributedRateLimiter) GetMetrics() *RateLimitMetrics
GetMetrics returns current rate limiting metrics
func (*DistributedRateLimiter) GetStatus ¶ added in v0.2.0
func (d *DistributedRateLimiter) GetStatus(key string) (*RateLimitResult, error)
GetStatus returns the current status for a key without consuming quota
func (*DistributedRateLimiter) Reset ¶ added in v0.2.0
func (d *DistributedRateLimiter) Reset(key string) error
Reset resets the rate limit for a key
func (*DistributedRateLimiter) Start ¶ added in v0.2.0
func (d *DistributedRateLimiter) Start() error
Start starts the distributed rate limiter
func (*DistributedRateLimiter) Stop ¶ added in v0.2.0
func (d *DistributedRateLimiter) Stop() error
Stop stops the distributed rate limiter
type DistributedScheduler ¶ added in v0.2.0
type DistributedScheduler struct{}
type DistributedTask ¶ added in v0.2.0
type DistributedTask struct {
ID string `json:"id"`
Type string `json:"type"`
Priority int `json:"priority"`
Payload map[string]interface{} `json:"payload"`
Requirements TaskRequirements `json:"requirements"`
Constraints TaskConstraints `json:"constraints"`
Dependencies []string `json:"dependencies"`
Partitions []TaskPartition `json:"partitions"`
Status TaskStatus `json:"status"`
AssignedNode string `json:"assigned_node"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Timeout time.Duration `json:"timeout"`
RetryCount int `json:"retry_count"`
MaxRetries int `json:"max_retries"`
Result interface{} `json:"result,omitempty"`
Error string `json:"error,omitempty"`
Metadata map[string]interface{} `json:"metadata"`
}
DistributedTask represents a task that can be executed across nodes
type ElectionConfig ¶ added in v0.2.0
type ElectionMetrics ¶ added in v0.2.0
type ElectionMetrics struct{ ElectionsHeld int64 }
type ExecutionPipeline ¶ added in v0.2.0
type ExecutionPipeline struct {
// contains filtered or unexported fields
}
ExecutionPipeline manages multi-stage task execution
func NewExecutionPipeline ¶ added in v0.2.0
func NewExecutionPipeline(config PipelineConfig, stages []StageProcessor, logger Logger) *ExecutionPipeline
func (*ExecutionPipeline) Start ¶ added in v0.2.0
func (ep *ExecutionPipeline) Start() error
func (*ExecutionPipeline) Stop ¶ added in v0.2.0
func (ep *ExecutionPipeline) Stop() error
type ExecutionTracer ¶
type ExecutionTracer struct {
// contains filtered or unexported fields
}
ExecutionTracer traces execution paths and timing
type ExecutorMetrics ¶ added in v0.2.0
type FeedbackLoop ¶
type FeedbackLoop struct {
// contains filtered or unexported fields
}
FeedbackLoop manages continuous learning and improvement
type FileHandlePool ¶
type FileHandlePool struct {
// contains filtered or unexported fields
}
FileHandlePool manages file descriptors
type GCTuner ¶
type GCTuner struct {
// contains filtered or unexported fields
}
GCTuner optimizes garbage collection
func NewGCTuner ¶
func NewGCTuner(config MemoryConfig) *GCTuner
type GeneticOptimizationAlgorithm ¶
type GeneticOptimizationAlgorithm struct {
// contains filtered or unexported fields
}
Genetic Optimization Algorithm
func (*GeneticOptimizationAlgorithm) Configure ¶
func (goa *GeneticOptimizationAlgorithm) Configure(config map[string]interface{}) error
func (*GeneticOptimizationAlgorithm) GetName ¶
func (goa *GeneticOptimizationAlgorithm) GetName() string
func (*GeneticOptimizationAlgorithm) IsApplicable ¶
func (goa *GeneticOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
func (*GeneticOptimizationAlgorithm) Optimize ¶
func (goa *GeneticOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
type GoroutineMetrics ¶ added in v0.2.0
type GoroutineProfiler ¶ added in v0.2.0
type GoroutineProfiler struct {
// contains filtered or unexported fields
}
func (*GoroutineProfiler) Collect ¶ added in v0.2.0
func (gp *GoroutineProfiler) Collect() (*ProfileData, error)
func (*GoroutineProfiler) GetName ¶ added in v0.2.0
func (gp *GoroutineProfiler) GetName() string
func (*GoroutineProfiler) IsEnabled ¶ added in v0.2.0
func (gp *GoroutineProfiler) IsEnabled() bool
func (*GoroutineProfiler) Start ¶ added in v0.2.0
func (gp *GoroutineProfiler) Start() error
func (*GoroutineProfiler) Stop ¶ added in v0.2.0
func (gp *GoroutineProfiler) Stop() error
type HealthCheck ¶ added in v0.2.0
type HealthCheck struct {
Type HealthCheckType `json:"type"`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
Headers map[string]string `json:"headers"`
Body string `json:"body"`
ExpectedCode int `json:"expected_code"`
Timeout time.Duration `json:"timeout"`
Interval time.Duration `json:"interval"`
Retries int `json:"retries"`
}
HealthCheck represents a health check configuration
type HealthCheckConfig ¶
type HealthCheckConfig struct {
Type string `json:"type"`
Endpoint string `json:"endpoint"`
Interval time.Duration `json:"interval"`
Timeout time.Duration `json:"timeout"`
Retries int `json:"retries"`
HealthyThreshold int `json:"healthy_threshold"`
UnhealthyThreshold int `json:"unhealthy_threshold"`
}
type HealthCheckType ¶ added in v0.2.0
type HealthCheckType string
HealthCheckType defines health check types
const ( HealthCheckHTTP HealthCheckType = "http" HealthCheckTCP HealthCheckType = "tcp" HealthCheckPing HealthCheckType = "ping" HealthCheckCustom HealthCheckType = "custom" )
type HealthChecker ¶ added in v0.2.0
type HealthChecker struct {
// contains filtered or unexported fields
}
type HealthMetrics ¶ added in v0.2.0
type HealthMetrics struct {
TotalChecks int64 `json:"total_checks"`
SuccessfulChecks int64 `json:"successful_checks"`
FailedChecks int64 `json:"failed_checks"`
AverageLatency time.Duration `json:"average_latency"`
}
Metrics structures
type HealthMonitor ¶ added in v0.2.0
type HealthMonitor struct {
// contains filtered or unexported fields
}
HealthMonitor monitors target health
func NewHealthMonitor ¶ added in v0.2.0
func NewHealthMonitor(config HealthMonitorConfig, logger Logger) *HealthMonitor
Placeholder implementations for missing components
func (*HealthMonitor) AddTarget ¶ added in v0.2.0
func (hm *HealthMonitor) AddTarget(target *LoadBalanceTarget)
func (*HealthMonitor) RemoveTarget ¶ added in v0.2.0
func (hm *HealthMonitor) RemoveTarget(target *LoadBalanceTarget)
func (*HealthMonitor) Start ¶ added in v0.2.0
func (hm *HealthMonitor) Start() error
func (*HealthMonitor) Stop ¶ added in v0.2.0
func (hm *HealthMonitor) Stop() error
type HealthMonitorConfig ¶ added in v0.2.0
type HealthMonitorConfig struct {
Enabled bool `json:"enabled"`
CheckInterval time.Duration `json:"check_interval"`
Timeout time.Duration `json:"timeout"`
HealthyThreshold int `json:"healthy_threshold"`
UnhealthyThreshold int `json:"unhealthy_threshold"`
MaxConcurrentChecks int `json:"max_concurrent_checks"`
}
Configuration structures
type HeartbeatManager ¶ added in v0.2.0
type HeartbeatManager struct {
// contains filtered or unexported fields
}
type Hotspot ¶ added in v0.2.0
type Hotspot struct {
Function string `json:"function"`
File string `json:"file"`
Line int `json:"line"`
CPUPercent float64 `json:"cpu_percent"`
MemoryBytes int64 `json:"memory_bytes"`
CallCount int64 `json:"call_count"`
TotalTime time.Duration `json:"total_time"`
AverageTime time.Duration `json:"average_time"`
Severity Severity `json:"severity"`
}
Hotspot represents a performance hotspot
type Individual ¶
type InvalidationCallback ¶ added in v0.2.0
type InvalidationCallback func(key string, entry *CacheEntry, reason string)
InvalidationCallback is called when cache entries are invalidated
type InvalidationHandler ¶ added in v0.2.0
type InvalidationHandler interface {
ShouldInvalidate(entry *CacheEntry) bool
Invalidate(key string, entry *CacheEntry) error
}
InvalidationHandler handles specific invalidation strategies
type InvalidationStrategy ¶ added in v0.2.0
type InvalidationStrategy string
InvalidationStrategy defines cache invalidation strategies
const ( InvalidationLRU InvalidationStrategy = "lru" InvalidationTTL InvalidationStrategy = "ttl" InvalidationTags InvalidationStrategy = "tags" InvalidationCallback InvalidationStrategy = "callback" )
type InvalidatorMetrics ¶ added in v0.2.0
type IssueType ¶ added in v0.2.0
type IssueType string
IssueType defines types of performance issues
type LargeMemoryBlock ¶
func (*LargeMemoryBlock) Close ¶
func (l *LargeMemoryBlock) Close() error
func (*LargeMemoryBlock) ID ¶
func (l *LargeMemoryBlock) ID() string
type LeaderElection ¶ added in v0.2.0
type LeaderElection struct {
// contains filtered or unexported fields
}
LeaderElection manages leader election process
func NewLeaderElection ¶ added in v0.2.0
func NewLeaderElection(config ElectionConfig, redis *redis.Client, logger Logger) *LeaderElection
func (*LeaderElection) GetCurrentLeader ¶ added in v0.2.0
func (le *LeaderElection) GetCurrentLeader() string
func (*LeaderElection) GetCurrentTerm ¶ added in v0.2.0
func (le *LeaderElection) GetCurrentTerm() int64
func (*LeaderElection) HasLeader ¶ added in v0.2.0
func (le *LeaderElection) HasLeader() bool
func (*LeaderElection) IsElectionInProgress ¶ added in v0.2.0
func (le *LeaderElection) IsElectionInProgress() bool
func (*LeaderElection) IsLeader ¶ added in v0.2.0
func (le *LeaderElection) IsLeader() bool
func (*LeaderElection) Start ¶ added in v0.2.0
func (le *LeaderElection) Start() error
func (*LeaderElection) StartElection ¶ added in v0.2.0
func (le *LeaderElection) StartElection()
func (*LeaderElection) Stop ¶ added in v0.2.0
func (le *LeaderElection) Stop() error
type LeastConnectionsAlgorithm ¶
type LeastConnectionsAlgorithm struct{}
LeastConnectionsAlgorithm selects node with fewest active connections
func (*LeastConnectionsAlgorithm) Configure ¶
func (lc *LeastConnectionsAlgorithm) Configure(config map[string]interface{}) error
func (*LeastConnectionsAlgorithm) GetName ¶
func (lc *LeastConnectionsAlgorithm) GetName() string
func (*LeastConnectionsAlgorithm) SelectNode ¶
func (lc *LeastConnectionsAlgorithm) SelectNode(nodes []*LoadBalancerNode, request *Request) (*LoadBalancerNode, error)
type LoadAnalyzer ¶
type LoadAnalyzer struct {
// contains filtered or unexported fields
}
LoadAnalyzer analyzes load patterns and provides insights
type LoadBalanceAlgorithm ¶
type LoadBalanceAlgorithm string
const ( LoadBalanceRoundRobin LoadBalanceAlgorithm = "round_robin" LoadBalanceLeastConn LoadBalanceAlgorithm = "least_conn" LoadBalanceWeighted LoadBalanceAlgorithm = "weighted" LoadBalanceIPHash LoadBalanceAlgorithm = "ip_hash" LoadBalanceAdaptive LoadBalanceAlgorithm = "adaptive" )
type LoadBalanceStrategy ¶ added in v0.2.0
type LoadBalanceStrategy string
LoadBalanceStrategy defines load balancing strategies for distributed execution
const ( LoadBalanceRoundRobin LoadBalanceStrategy = "round_robin" LoadBalanceLeastLoaded LoadBalanceStrategy = "least_loaded" LoadBalanceCapability LoadBalanceStrategy = "capability" LoadBalanceLatency LoadBalanceStrategy = "latency" LoadBalanceAdaptive LoadBalanceStrategy = "adaptive" )
type LoadBalanceTarget ¶
type LoadBalanceTarget struct {
ID string `json:"id"`
Address string `json:"address"`
Weight int `json:"weight"`
MaxConcurrency int `json:"max_concurrency"`
CurrentLoad int64 `json:"current_load"`
HealthStatus TargetHealthStatus `json:"health_status"`
ResponseTime time.Duration `json:"response_time"`
SuccessRate float64 `json:"success_rate"`
LastHealthCheck time.Time `json:"last_health_check"`
Capabilities []string `json:"capabilities"`
Metadata map[string]interface{} `json:"metadata"`
CircuitState CircuitState `json:"circuit_state"`
Statistics *TargetStatistics `json:"statistics"`
// contains filtered or unexported fields
}
LoadBalanceTarget represents a target for load balancing
type LoadBalancer ¶ added in v0.2.0
type LoadBalancer struct {
// contains filtered or unexported fields
}
LoadBalancer distributes tasks across available resources
func NewLoadBalancer ¶
func NewLoadBalancer(config BalancerConfig, logger Logger) *LoadBalancer
func (*LoadBalancer) Start ¶ added in v0.2.0
func (lb *LoadBalancer) Start() error
func (*LoadBalancer) Stop ¶ added in v0.2.0
func (lb *LoadBalancer) Stop() error
type LoadBalancerConfig ¶ added in v0.2.0
type LoadBalancerConfig struct {
// Basic settings
Name string `json:"name"`
DefaultStrategy BalancingStrategy `json:"default_strategy"`
EnableHealthChecks bool `json:"enable_health_checks"`
HealthCheckInterval time.Duration `json:"health_check_interval"`
// Circuit breaker settings
CircuitBreaker CircuitBreakerConfig `json:"circuit_breaker"`
// Auto-scaling settings
AutoScaling AutoScalingConfig `json:"auto_scaling"`
// Load prediction
LoadPrediction LoadPredictionConfig `json:"load_prediction"`
// Advanced features
EnableStickySessions bool `json:"enable_sticky_sessions"`
SessionTimeout time.Duration `json:"session_timeout"`
EnableWeighting bool `json:"enable_weighting"`
WeightAdjustment WeightConfig `json:"weight_adjustment"`
// Performance tuning
MaxConcurrentChecks int `json:"max_concurrent_checks"`
RequestTimeout time.Duration `json:"request_timeout"`
RetryAttempts int `json:"retry_attempts"`
RetryDelay time.Duration `json:"retry_delay"`
// Monitoring
EnableMetrics bool `json:"enable_metrics"`
MetricsInterval time.Duration `json:"metrics_interval"`
EnablePredictive bool `json:"enable_predictive"`
}
LoadBalancerConfig defines comprehensive load balancer configuration
func DefaultLoadBalancerConfig ¶ added in v0.2.0
func DefaultLoadBalancerConfig() LoadBalancerConfig
Default configurations
type LoadBalancerImpl ¶
type LoadBalancerImpl struct {
// contains filtered or unexported fields
}
LoadBalancerImpl manages load distribution and auto-scaling
func NewLoadBalancer ¶
func NewLoadBalancer(config LoadBalancerConfig, logger Logger) *LoadBalancerImpl
func (*LoadBalancerImpl) AddNode ¶
func (lb *LoadBalancerImpl) AddNode(config NodeConfig) error
func (*LoadBalancerImpl) BalanceRequest ¶
func (lb *LoadBalancerImpl) BalanceRequest(request *Request) (*LoadBalancerNode, error)
func (*LoadBalancerImpl) GetLoadReport ¶
func (lb *LoadBalancerImpl) GetLoadReport() *LoadBalancerReport
func (*LoadBalancerImpl) GetMetrics ¶
func (lb *LoadBalancerImpl) GetMetrics() *LoadBalancerMetrics
func (*LoadBalancerImpl) GetNodeDistribution ¶
func (lb *LoadBalancerImpl) GetNodeDistribution() map[string]float64
func (*LoadBalancerImpl) GetStats ¶
func (lb *LoadBalancerImpl) GetStats() *LoadBalancerStats
func (*LoadBalancerImpl) RemoveNode ¶
func (lb *LoadBalancerImpl) RemoveNode(nodeID string) error
func (*LoadBalancerImpl) Start ¶
func (lb *LoadBalancerImpl) Start() error
func (*LoadBalancerImpl) Stop ¶
func (lb *LoadBalancerImpl) Stop() error
type LoadBalancerMetrics ¶ added in v0.2.0
type LoadBalancerMetrics struct {
TotalRequests int64 `json:"total_requests"`
SuccessfulRequests int64 `json:"successful_requests"`
FailedRequests int64 `json:"failed_requests"`
AverageLatency time.Duration `json:"average_latency"`
RequestsPerSecond float64 `json:"requests_per_second"`
ActiveTargets int `json:"active_targets"`
HealthyTargets int `json:"healthy_targets"`
CircuitBreakerTrips int64 `json:"circuit_breaker_trips"`
ScalingEvents int64 `json:"scaling_events"`
TargetMetrics map[string]*TargetStatistics `json:"target_metrics"`
}
LoadBalancerMetrics tracks load balancer performance
type LoadBalancerNode ¶
type LoadBalancerNode struct {
// contains filtered or unexported fields
}
LoadBalancerNode represents a processing node in the load balancer
type LoadBalancingAlgorithm ¶
type LoadBalancingAlgorithm interface {
SelectNode(nodes []*LoadBalancerNode, request *Request) (*LoadBalancerNode, error)
GetName() string
Configure(config map[string]interface{}) error
}
LoadBalancingAlgorithm interface for different load balancing strategies
type LoadBalancingConfig ¶
type LoadBalancingConfig struct{}
type LoadDataPoint ¶ added in v0.2.0
type LoadForecast ¶ added in v0.2.0
type LoadForecast struct {
Predictions []PredictionPoint `json:"predictions"`
Confidence float64 `json:"confidence"`
GeneratedAt time.Time `json:"generated_at"`
Algorithm PredictionAlgorithm `json:"algorithm"`
}
type LoadHistory ¶ added in v0.2.0
type LoadHistory struct {
DataPoints []LoadDataPoint `json:"data_points"`
// contains filtered or unexported fields
}
type LoadPredictionConfig ¶ added in v0.2.0
type LoadPredictionConfig struct {
Enabled bool `json:"enabled"`
Algorithm PredictionAlgorithm `json:"algorithm"`
HistoryDuration time.Duration `json:"history_duration"`
PredictionHorizon time.Duration `json:"prediction_horizon"`
UpdateInterval time.Duration `json:"update_interval"`
ConfidenceThreshold float64 `json:"confidence_threshold"`
SeasonalityDetection bool `json:"seasonality_detection"`
TrendAnalysis bool `json:"trend_analysis"`
}
LoadPredictionConfig defines load prediction configuration
type LoadPredictor ¶
type LoadPredictor struct {
// contains filtered or unexported fields
}
LoadPredictor predicts future load patterns
func NewLoadPredictor ¶ added in v0.2.0
func NewLoadPredictor(config LoadPredictionConfig, logger Logger) *LoadPredictor
func (*LoadPredictor) Start ¶ added in v0.2.0
func (lp *LoadPredictor) Start() error
func (*LoadPredictor) Stop ¶ added in v0.2.0
func (lp *LoadPredictor) Stop() error
type Logger ¶
type Logger interface {
Info(msg string, args ...interface{})
Warn(msg string, args ...interface{})
Error(msg string, args ...interface{})
Debug(msg string, args ...interface{})
}
Logger interface for memory pool logging
type MLConfig ¶
type MLConfig struct {
TrainingInterval time.Duration
MinTrainingSamples int
Training TrainingConfig
Evaluation EvaluationConfig
Features FeatureConfig
Pipeline PipelineConfig
}
type MLModelType ¶
type MLModelType int
const ( LinearRegression MLModelType = iota RandomForest NeuralNetwork SVM )
type MachineLearner ¶
type MachineLearner struct {
// contains filtered or unexported fields
}
MachineLearner implements ML-based performance learning
func NewMachineLearner ¶
func NewMachineLearner(config MLConfig, logger Logger) *MachineLearner
func (*MachineLearner) EvaluateModels ¶
func (ml *MachineLearner) EvaluateModels() *ModelEvaluation
func (*MachineLearner) ExtractFeatures ¶
func (ml *MachineLearner) ExtractFeatures() *FeatureSet
func (*MachineLearner) ExtractPatterns ¶
func (ml *MachineLearner) ExtractPatterns() []*PerformancePattern
func (*MachineLearner) GetMetrics ¶
func (ml *MachineLearner) GetMetrics() *MLMetrics
func (*MachineLearner) Start ¶
func (ml *MachineLearner) Start() error
func (*MachineLearner) Stop ¶
func (ml *MachineLearner) Stop()
func (*MachineLearner) TrainModels ¶
func (ml *MachineLearner) TrainModels(features *FeatureSet)
func (*MachineLearner) UpdateModels ¶
func (ml *MachineLearner) UpdateModels()
type MapFactory ¶ added in v0.2.0
type MapFactory struct {
InitialSize int
}
MapFactory creates map pools
func NewMapFactory ¶ added in v0.2.0
func NewMapFactory(initialSize int) *MapFactory
func (*MapFactory) CreateObject ¶ added in v0.2.0
func (f *MapFactory) CreateObject() interface{}
func (*MapFactory) GetObjectType ¶ added in v0.2.0
func (f *MapFactory) GetObjectType() string
type MapReset ¶ added in v0.2.0
type MapReset struct{}
MapReset resets maps
func (*MapReset) ResetObject ¶ added in v0.2.0
type MemoryBlock ¶
func (*MemoryBlock) Close ¶
func (m *MemoryBlock) Close() error
func (*MemoryBlock) ID ¶
func (m *MemoryBlock) ID() string
type MemoryConfig ¶
type MemoryConfig struct {
MaxHeapSize int64 `json:"max_heap_size"`
GCTarget int `json:"gc_target"`
GCThreshold float64 `json:"gc_threshold"`
PoolSizes map[string]int `json:"pool_sizes"`
EnableProfiling bool `json:"enable_profiling"`
}
MemoryConfig defines memory management settings
type MemoryManager ¶
type MemoryManager struct {
// contains filtered or unexported fields
}
MemoryManager handles memory optimization
func NewMemoryManager ¶
func NewMemoryManager(config MemoryConfig, logger Logger) *MemoryManager
func (*MemoryManager) CreatePool ¶
func (mm *MemoryManager) CreatePool(name string, factory func() interface{}, reset func(interface{}), maxSize int)
func (*MemoryManager) GetPool ¶
func (mm *MemoryManager) GetPool(name string) *ObjectPool
func (*MemoryManager) OptimizeMemory ¶
func (mm *MemoryManager) OptimizeMemory()
type MemoryMetrics ¶ added in v0.2.0
type MemoryMetrics struct {
Allocated uint64 `json:"allocated"`
TotalAlloc uint64 `json:"total_alloc"`
Sys uint64 `json:"sys"`
Lookups uint64 `json:"lookups"`
Mallocs uint64 `json:"mallocs"`
Frees uint64 `json:"frees"`
HeapAlloc uint64 `json:"heap_alloc"`
HeapSys uint64 `json:"heap_sys"`
HeapIdle uint64 `json:"heap_idle"`
HeapInuse uint64 `json:"heap_inuse"`
HeapReleased uint64 `json:"heap_released"`
HeapObjects uint64 `json:"heap_objects"`
StackInuse uint64 `json:"stack_inuse"`
StackSys uint64 `json:"stack_sys"`
MSpanInuse uint64 `json:"mspan_inuse"`
MSpanSys uint64 `json:"mspan_sys"`
MCacheInuse uint64 `json:"mcache_inuse"`
MCacheSys uint64 `json:"mcache_sys"`
BuckHashSys uint64 `json:"buck_hash_sys"`
GCSys uint64 `json:"gc_sys"`
OtherSys uint64 `json:"other_sys"`
NextGC uint64 `json:"next_gc"`
}
type MemoryOptimizationAlgorithm ¶
type MemoryOptimizationAlgorithm struct {
// contains filtered or unexported fields
}
Memory Optimization Algorithm
func (*MemoryOptimizationAlgorithm) Configure ¶
func (moa *MemoryOptimizationAlgorithm) Configure(config map[string]interface{}) error
func (*MemoryOptimizationAlgorithm) GetName ¶
func (moa *MemoryOptimizationAlgorithm) GetName() string
func (*MemoryOptimizationAlgorithm) IsApplicable ¶
func (moa *MemoryOptimizationAlgorithm) IsApplicable(context OptimizationContext) bool
func (*MemoryOptimizationAlgorithm) Optimize ¶
func (moa *MemoryOptimizationAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
type MemoryPool ¶
type MemoryPool struct {
// contains filtered or unexported fields
}
MemoryPool manages memory blocks
func NewMemoryPool ¶
func NewMemoryPool(config MemoryPoolConfig) *MemoryPool
func (*MemoryPool) Close ¶
func (p *MemoryPool) Close() error
func (*MemoryPool) GetStats ¶
func (p *MemoryPool) GetStats() PoolStats
func (*MemoryPool) Release ¶
func (p *MemoryPool) Release(resource Resource) error
func (*MemoryPool) Resize ¶
func (p *MemoryPool) Resize(newSize int) error
type MemoryPoolConfig ¶ added in v0.2.0
type MemoryPoolConfig struct {
// Pool sizing
DefaultPoolSize int `json:"default_pool_size"`
MaxPoolSize int `json:"max_pool_size"`
MinPoolSize int `json:"min_pool_size"`
// Object lifecycle
MaxObjectAge time.Duration `json:"max_object_age"`
CleanupInterval time.Duration `json:"cleanup_interval"`
PreallocationSize int `json:"preallocation_size"`
// Memory management
EnableGCOptimization bool `json:"enable_gc_optimization"`
GCTarget int `json:"gc_target"`
MaxMemoryUsage int64 `json:"max_memory_usage"`
// Monitoring
EnableMetrics bool `json:"enable_metrics"`
MetricsInterval time.Duration `json:"metrics_interval"`
}
MemoryPoolConfig defines configuration for memory pools
func DefaultMemoryPoolConfig ¶ added in v0.2.0
func DefaultMemoryPoolConfig() MemoryPoolConfig
DefaultMemoryPoolConfig returns default configuration
type MemoryPoolManager ¶ added in v0.2.0
type MemoryPoolManager struct {
// contains filtered or unexported fields
}
MemoryPoolManager manages object pools for memory optimization
func NewMemoryPoolManager ¶ added in v0.2.0
func NewMemoryPoolManager(config MemoryPoolConfig, logger Logger) *MemoryPoolManager
NewMemoryPoolManager creates a new memory pool manager
func (*MemoryPoolManager) CreatePool ¶ added in v0.2.0
func (m *MemoryPoolManager) CreatePool(name string, factory ObjectFactory, reset ObjectReset) (*ObjectPool, error)
CreatePool creates a new object pool
func (*MemoryPoolManager) Get ¶ added in v0.2.0
func (m *MemoryPoolManager) Get(poolName string) (interface{}, error)
Get retrieves an object from a pool
func (*MemoryPoolManager) GetMetrics ¶ added in v0.2.0
func (m *MemoryPoolManager) GetMetrics() *MemoryPoolMetrics
GetMetrics returns current memory pool metrics
func (*MemoryPoolManager) GetPool ¶ added in v0.2.0
func (m *MemoryPoolManager) GetPool(name string) (*ObjectPool, error)
GetPool returns an object pool by name
func (*MemoryPoolManager) GetPoolMetrics ¶ added in v0.2.0
func (m *MemoryPoolManager) GetPoolMetrics() []*ObjectPoolMetrics
GetPoolMetrics returns metrics for all pools
func (*MemoryPoolManager) Put ¶ added in v0.2.0
func (m *MemoryPoolManager) Put(poolName string, obj interface{}) error
Put returns an object to a pool
func (*MemoryPoolManager) Start ¶ added in v0.2.0
func (m *MemoryPoolManager) Start() error
Start starts the memory pool manager
func (*MemoryPoolManager) Stop ¶ added in v0.2.0
func (m *MemoryPoolManager) Stop() error
Stop stops the memory pool manager
type MemoryPoolMetrics ¶ added in v0.2.0
type MemoryPoolMetrics struct {
TotalPools int64 `json:"total_pools"`
TotalObjects int64 `json:"total_objects"`
ObjectsCreated int64 `json:"objects_created"`
ObjectsReused int64 `json:"objects_reused"`
ObjectsDestroyed int64 `json:"objects_destroyed"`
MemoryAllocated int64 `json:"memory_allocated"`
MemoryReleased int64 `json:"memory_released"`
PoolHitRate float64 `json:"pool_hit_rate"`
AverageObjectAge time.Duration `json:"average_object_age"`
}
MemoryPoolMetrics tracks memory pool performance
type MemoryProfiler ¶
type MemoryProfiler struct {
// contains filtered or unexported fields
}
func NewMemoryProfiler ¶
func NewMemoryProfiler(enabled bool) *MemoryProfiler
func (*MemoryProfiler) Collect ¶ added in v0.2.0
func (mp *MemoryProfiler) Collect() (*ProfileData, error)
func (*MemoryProfiler) GetName ¶ added in v0.2.0
func (mp *MemoryProfiler) GetName() string
func (*MemoryProfiler) GetSnapshots ¶
func (mp *MemoryProfiler) GetSnapshots() []*MemorySnapshot
func (*MemoryProfiler) IsEnabled ¶ added in v0.2.0
func (mp *MemoryProfiler) IsEnabled() bool
func (*MemoryProfiler) Start ¶ added in v0.2.0
func (mp *MemoryProfiler) Start() error
func (*MemoryProfiler) Stop ¶ added in v0.2.0
func (mp *MemoryProfiler) Stop() error
func (*MemoryProfiler) TakeSnapshot ¶
func (mp *MemoryProfiler) TakeSnapshot()
type MemorySnapshot ¶
type MetricQuery ¶
type MetricResult ¶
type MetricResult struct {
Metrics []Metric `json:"metrics"`
Summary MetricSummary `json:"summary"`
}
type MetricSummary ¶
type MetricsCollector ¶
type MetricsCollector interface {
GetMetrics() map[string]interface{}
GetName() string
IsEnabled() bool
}
MetricsCollector interface for collecting metrics from various sources
func NewMetricsCollector ¶
func NewMetricsCollector(config CollectorConfig, logger Logger) *MetricsCollector
func (*MetricsCollector) GetMetrics ¶
func (c *MetricsCollector) GetMetrics() *CollectorMetrics
type MetricsMessage ¶ added in v0.2.0
type MetricsMessage struct {
Type string `json:"type"`
Timestamp time.Time `json:"timestamp"`
Source string `json:"source"`
Metrics map[string]interface{} `json:"metrics"`
}
MetricsMessage represents a real-time metrics update
type MonitorMetrics ¶
type MonitorMetrics struct{}
type MonitoringConfig ¶
type MonitoringConfig struct{}
type MonitoringDashboard ¶
type MonitoringDashboard struct {
// contains filtered or unexported fields
}
MonitoringDashboard provides real-time monitoring and metrics visualization
func NewMonitoringDashboard ¶ added in v0.2.0
func NewMonitoringDashboard(config DashboardConfig, logger Logger) *MonitoringDashboard
NewMonitoringDashboard creates a new monitoring dashboard
func (*MonitoringDashboard) AddMetricsCollector ¶ added in v0.2.0
func (d *MonitoringDashboard) AddMetricsCollector(collector MetricsCollector)
AddMetricsCollector adds a metrics collector
func (*MonitoringDashboard) BroadcastAlert ¶ added in v0.2.0
func (d *MonitoringDashboard) BroadcastAlert(alert AlertMessage)
BroadcastAlert broadcasts an alert to all connected clients
func (*MonitoringDashboard) GetMetrics ¶ added in v0.2.0
func (d *MonitoringDashboard) GetMetrics() *DashboardMetrics
GetMetrics returns dashboard metrics
func (*MonitoringDashboard) RemoveMetricsCollector ¶ added in v0.2.0
func (d *MonitoringDashboard) RemoveMetricsCollector(name string)
RemoveMetricsCollector removes a metrics collector
func (*MonitoringDashboard) Start ¶ added in v0.2.0
func (d *MonitoringDashboard) Start() error
Start starts the monitoring dashboard server
func (*MonitoringDashboard) Stop ¶ added in v0.2.0
func (d *MonitoringDashboard) Stop() error
Stop stops the monitoring dashboard
type MutexProfiler ¶ added in v0.2.0
type MutexProfiler struct {
// contains filtered or unexported fields
}
func (*MutexProfiler) Collect ¶ added in v0.2.0
func (mp *MutexProfiler) Collect() (*ProfileData, error)
func (*MutexProfiler) GetName ¶ added in v0.2.0
func (mp *MutexProfiler) GetName() string
func (*MutexProfiler) IsEnabled ¶ added in v0.2.0
func (mp *MutexProfiler) IsEnabled() bool
func (*MutexProfiler) Start ¶ added in v0.2.0
func (mp *MutexProfiler) Start() error
func (*MutexProfiler) Stop ¶ added in v0.2.0
func (mp *MutexProfiler) Stop() error
type NetworkBuffers ¶
type NetworkConfig ¶
type NetworkConfig struct{}
type NetworkMetrics ¶ added in v0.2.0
type NodeInfo ¶ added in v0.2.0
type NodeInfo struct {
ID string `json:"id"`
Address string `json:"address"`
Status NodeStatus `json:"status"`
LastSeen time.Time `json:"last_seen"`
Capabilities []string `json:"capabilities"`
Load NodeLoad `json:"load"`
Metadata map[string]interface{} `json:"metadata"`
}
NodeInfo represents information about a worker node
type NodeLoad ¶ added in v0.2.0
type NodeLoad struct {
CPU float64 `json:"cpu"`
Memory float64 `json:"memory"`
Network float64 `json:"network"`
TaskCount int `json:"task_count"`
QueueDepth int `json:"queue_depth"`
}
NodeLoad represents node resource utilization
type NodeLoadInfo ¶ added in v0.2.0
type NodeLoadInfo struct {
CPUUsage float64 `json:"cpu_usage"`
MemoryUsage float64 `json:"memory_usage"`
NetworkUsage float64 `json:"network_usage"`
DiskUsage float64 `json:"disk_usage"`
ActiveTasks int `json:"active_tasks"`
QueuedTasks int `json:"queued_tasks"`
ThroughputRPS float64 `json:"throughput_rps"`
}
NodeLoadInfo represents current node load
type NodeManager ¶ added in v0.2.0
type NodeManager struct {
// contains filtered or unexported fields
}
NodeManager manages cluster nodes
func NewNodeManager ¶ added in v0.2.0
func NewNodeManager(config NodeManagerConfig, redis *redis.Client, logger Logger) *NodeManager
Placeholder implementations
func (*NodeManager) CheckNodeHealth ¶ added in v0.2.0
func (nm *NodeManager) CheckNodeHealth()
func (*NodeManager) GetActiveNodeCount ¶ added in v0.2.0
func (nm *NodeManager) GetActiveNodeCount() int
func (*NodeManager) GetNodes ¶ added in v0.2.0
func (nm *NodeManager) GetNodes() map[string]*ClusterNode
func (*NodeManager) Start ¶ added in v0.2.0
func (nm *NodeManager) Start() error
func (*NodeManager) Stop ¶ added in v0.2.0
func (nm *NodeManager) Stop() error
type NodeManagerConfig ¶ added in v0.2.0
type NodeManagerConfig struct {
DiscoveryInterval time.Duration `json:"discovery_interval"`
HealthCheckInterval time.Duration `json:"health_check_interval"`
MaxNodes int `json:"max_nodes"`
NodeTimeout time.Duration `json:"node_timeout"`
}
Configuration structures
type NodeMetrics ¶ added in v0.2.0
type NodePerformance ¶ added in v0.2.0
type NodePerformance struct {
AverageLatency time.Duration `json:"average_latency"`
P95Latency time.Duration `json:"p95_latency"`
P99Latency time.Duration `json:"p99_latency"`
ErrorRate float64 `json:"error_rate"`
SuccessRate float64 `json:"success_rate"`
Availability float64 `json:"availability"`
LastUpdate time.Time `json:"last_update"`
}
NodePerformance tracks node performance metrics
type NodeResources ¶ added in v0.2.0
type NodeResources struct {
CPU int `json:"cpu_cores"`
Memory int64 `json:"memory_mb"`
Network int64 `json:"network_mbps"`
Disk int64 `json:"disk_gb"`
MaxTasks int `json:"max_tasks"`
Specialized map[string]int `json:"specialized"`
}
NodeResources represents node resource capacity
type NodeStatus ¶ added in v0.2.0
type NodeStatus string
NodeStatus represents node states
const ( NodeStatusHealthy NodeStatus = "healthy" NodeStatusDegraded NodeStatus = "degraded" NodeStatusUnhealthy NodeStatus = "unhealthy" )
type NotificationChannel ¶
type ObjectFactory ¶ added in v0.2.0
type ObjectFactory interface {
CreateObject() interface{}
GetObjectType() string
}
ObjectFactory creates new objects for the pool
type ObjectPool ¶
type ObjectPool struct {
// contains filtered or unexported fields
}
ObjectPool manages a pool of reusable objects
func (*ObjectPool) Get ¶
func (p *ObjectPool) Get() (interface{}, error)
Get retrieves an object from the pool
func (*ObjectPool) GetMetrics ¶ added in v0.2.0
func (p *ObjectPool) GetMetrics() *ObjectPoolMetrics
GetMetrics returns pool metrics
func (*ObjectPool) Put ¶
func (p *ObjectPool) Put(obj interface{}) error
Put returns an object to the pool
type ObjectPoolMetrics ¶ added in v0.2.0
type ObjectPoolMetrics struct {
PoolName string `json:"pool_name"`
PoolSize int `json:"pool_size"`
ObjectsCreated int64 `json:"objects_created"`
ObjectsReused int64 `json:"objects_reused"`
ObjectsDestroyed int64 `json:"objects_destroyed"`
HitRate float64 `json:"hit_rate"`
AverageAge time.Duration `json:"average_age"`
LastCleanup time.Time `json:"last_cleanup"`
}
ObjectPoolMetrics tracks individual pool performance
type ObjectReset ¶ added in v0.2.0
type ObjectReset interface {
ResetObject(obj interface{}) error
}
ObjectReset resets objects for reuse
type OptimizationAction ¶
type OptimizationAction struct{}
type OptimizationAlgorithm ¶
type OptimizationAlgorithm interface {
Optimize(context OptimizationContext) (*OptimizationResult, error)
GetName() string
Configure(config map[string]interface{}) error
IsApplicable(context OptimizationContext) bool
}
OptimizationAlgorithm interface for different optimization strategies
type OptimizationAnalyzer ¶
type OptimizationAnalyzer struct {
// contains filtered or unexported fields
}
OptimizationAnalyzer identifies optimization opportunities
func NewOptimizationAnalyzer ¶
func NewOptimizationAnalyzer(config AnalyzerConfig, logger Logger) *OptimizationAnalyzer
func (*OptimizationAnalyzer) AnalyzeOpportunities ¶
func (oa *OptimizationAnalyzer) AnalyzeOpportunities() []*OptimizationOpportunity
func (*OptimizationAnalyzer) GetMetrics ¶
func (oa *OptimizationAnalyzer) GetMetrics() *AnalyzerMetrics
func (*OptimizationAnalyzer) Start ¶
func (oa *OptimizationAnalyzer) Start() error
func (*OptimizationAnalyzer) Stop ¶
func (oa *OptimizationAnalyzer) Stop()
type OptimizationCondition ¶
type OptimizationCondition struct{}
type OptimizationConfig ¶
type OptimizationConfig struct{}
type OptimizationConstraint ¶
type OptimizationEngine ¶
type OptimizationEngine interface {
// Optimization operations
Optimize(ctx context.Context, objectives []OptimizationObjective) (*OptimizationResult, error)
EvaluateSolution(solution OptimizationSolution) (float64, error)
// Algorithm management
RegisterAlgorithm(algorithm OptimizationAlgorithm) error
GetAlgorithms() []OptimizationAlgorithm
// Solution management
GetBestSolution() (*OptimizationSolution, error)
GetSolutionHistory() ([]OptimizationSolution, error)
// Lifecycle
Start(ctx context.Context) error
Stop() error
Health() error
}
OptimizationEngine interface for optimization
type OptimizationEngineImpl ¶
type OptimizationEngineImpl struct {
// contains filtered or unexported fields
}
OptimizationEngineImpl manages various optimization algorithms
func NewOptimizationEngine ¶
func NewOptimizationEngine(config OptimizationConfig, logger Logger) *OptimizationEngineImpl
func (*OptimizationEngineImpl) GetMetrics ¶
func (oe *OptimizationEngineImpl) GetMetrics() *OptimizationMetrics
func (*OptimizationEngineImpl) GetStats ¶
func (oe *OptimizationEngineImpl) GetStats() *OptimizationStats
func (*OptimizationEngineImpl) RegisterAlgorithm ¶
func (oe *OptimizationEngineImpl) RegisterAlgorithm(name string, algorithm OptimizationAlgorithm)
func (*OptimizationEngineImpl) Start ¶
func (oe *OptimizationEngineImpl) Start() error
func (*OptimizationEngineImpl) Stop ¶
func (oe *OptimizationEngineImpl) Stop() error
type OptimizationExecutor ¶
type OptimizationExecutor struct {
// contains filtered or unexported fields
}
OptimizationExecutor applies optimization strategies
type OptimizationObjective ¶
type OptimizationRecommendation ¶
type OptimizationRecommendation struct {
Type OptimizationType `json:"type"`
Priority Priority `json:"priority"`
Description string `json:"description"`
Action string `json:"action"`
}
type OptimizationResult ¶
type OptimizationResult struct {
Strategy string `json:"strategy"`
Timestamp time.Time `json:"timestamp"`
Applied bool `json:"applied"`
Description string `json:"description"`
Parameters map[string]interface{} `json:"parameters"`
BeforeMetrics *PerformanceMetrics `json:"before_metrics"`
AfterMetrics *PerformanceMetrics `json:"after_metrics"`
Improvement float64 `json:"improvement"`
Error string `json:"error,omitempty"`
}
OptimizationResult represents the result of an optimization
type OptimizationRule ¶
type OptimizationRule struct {
ID string `json:"id"`
Name string `json:"name"`
Type OptimizationType `json:"type"`
Condition OptimizationCondition `json:"condition"`
Action OptimizationAction `json:"action"`
Priority int `json:"priority"`
Enabled bool `json:"enabled"`
}
OptimizationRule defines a specific optimization
type OptimizationScheduler ¶
type OptimizationScheduler struct {
// contains filtered or unexported fields
}
OptimizationScheduler manages when and how optimizations are applied
type OptimizationSolution ¶
type OptimizationStrategy ¶ added in v0.2.0
type OptimizationStrategy interface {
CanOptimize(metrics *PerformanceMetrics) bool
Optimize(metrics *PerformanceMetrics) (*OptimizationResult, error)
GetName() string
GetPriority() int
}
OptimizationStrategy defines optimization strategies
type OptimizationType ¶
type OptimizationType string
Performance optimization types
const ( OptimizationTypeCache OptimizationType = "cache" OptimizationTypeConcurrency OptimizationType = "concurrency" OptimizationTypeMemory OptimizationType = "memory" OptimizationTypeIO OptimizationType = "io" OptimizationTypeNetwork OptimizationType = "network" OptimizationTypeAlgorithm OptimizationType = "algorithm" )
type OptimizerConfig ¶ added in v0.2.0
type OptimizerConfig struct {
Strategies []string `json:"strategies"`
OptimizationInterval time.Duration `json:"optimization_interval"`
MaxOptimizations int `json:"max_optimizations"`
SafetyMode bool `json:"safety_mode"`
}
Configuration structures
type OptimizerMetrics ¶ added in v0.2.0
type OrchestratorConfig ¶ added in v0.2.0
type OrchestratorMetrics ¶ added in v0.2.0
type PartitionConfig ¶ added in v0.2.0
type PartitionHealth ¶ added in v0.2.0
type PartitionHealth string
PartitionHealth represents partition health status
const ( PartitionHealthy PartitionHealth = "healthy" PartitionDegraded PartitionHealth = "degraded" PartitionUnhealthy PartitionHealth = "unhealthy" )
type PartitionManager ¶ added in v0.2.0
type PartitionManager struct {
// contains filtered or unexported fields
}
PartitionManager handles task partitioning
func NewPartitionManager ¶ added in v0.2.0
func NewPartitionManager(config PartitionConfig, logger Logger) *PartitionManager
type PartitionMetrics ¶ added in v0.2.0
type PartitionMetrics struct {
PartitionID int `json:"partition_id"`
Load float64 `json:"load"`
KeyCount int64 `json:"key_count"`
DataSize int64 `json:"data_size"`
Health PartitionHealth `json:"health"`
}
type PartitionStatus ¶ added in v0.2.0
type PartitionStatus string
PartitionStatus represents partition execution status
const ( PartitionStatusPending PartitionStatus = "pending" PartitionStatusAssigned PartitionStatus = "assigned" PartitionStatusExecuting PartitionStatus = "executing" PartitionStatusCompleted PartitionStatus = "completed" PartitionStatusFailed PartitionStatus = "failed" PartitionStatusCancelled PartitionStatus = "cancelled" )
type PartitionStrategy ¶ added in v0.2.0
type PartitionStrategy string
PartitionStrategy defines cache partitioning strategies
const ( PartitionByHash PartitionStrategy = "hash" PartitionByRange PartitionStrategy = "range" PartitionByLoad PartitionStrategy = "load" PartitionByCapability PartitionStrategy = "capability" PartitionAdaptive PartitionStrategy = "adaptive" )
const ( PartitionByHash PartitionStrategy = "hash" PartitionByRange PartitionStrategy = "range" PartitionByConsistent PartitionStrategy = "consistent" PartitionByLoad PartitionStrategy = "load" )
type PartitionerMetrics ¶ added in v0.2.0
type PartitioningStrategy ¶ added in v0.2.0
type PartitioningStrategy interface{}
type PerformanceAlerter ¶
type PerformanceAlerter struct {
// contains filtered or unexported fields
}
PerformanceAlerter handles performance alerts and notifications
type PerformanceAnalyzer ¶
type PerformanceAnalyzer struct {
// contains filtered or unexported fields
}
PerformanceAnalyzer analyzes performance data and identifies issues
func NewPerformanceAnalyzer ¶
func NewPerformanceAnalyzer(config AnalyzerConfig, logger Logger) *PerformanceAnalyzer
func (*PerformanceAnalyzer) AnalyzeMetrics ¶ added in v0.2.0
func (pa *PerformanceAnalyzer) AnalyzeMetrics(metrics *PerformanceMetrics)
func (*PerformanceAnalyzer) GetHotspots ¶ added in v0.2.0
func (pa *PerformanceAnalyzer) GetHotspots() []*Hotspot
func (*PerformanceAnalyzer) GetIssues ¶ added in v0.2.0
func (pa *PerformanceAnalyzer) GetIssues() []*PerformanceIssue
func (*PerformanceAnalyzer) GetMetrics ¶
func (a *PerformanceAnalyzer) GetMetrics() *AnalyzerMetrics
func (*PerformanceAnalyzer) Start ¶
func (pa *PerformanceAnalyzer) Start() error
func (*PerformanceAnalyzer) Stop ¶
func (pa *PerformanceAnalyzer) Stop() error
type PerformanceConstraints ¶
type PerformanceConstraints struct {
MaxWorkers int `json:"max_workers"`
MaxMemory int64 `json:"max_memory"`
MaxCacheSize int64 `json:"max_cache_size"`
MaxConnections int `json:"max_connections"`
}
PerformanceConstraints defines resource constraints
type PerformanceIssue ¶ added in v0.2.0
type PerformanceIssue struct {
Type IssueType `json:"type"`
Severity Severity `json:"severity"`
Title string `json:"title"`
Description string `json:"description"`
Component string `json:"component"`
DetectedAt time.Time `json:"detected_at"`
Metadata map[string]interface{} `json:"metadata"`
Suggestions []string `json:"suggestions"`
Impact float64 `json:"impact"`
}
PerformanceIssue represents a detected performance issue
type PerformanceManager ¶
type PerformanceManager struct {
// contains filtered or unexported fields
}
PerformanceManager orchestrates all performance optimization components
func NewPerformanceManager ¶
func NewPerformanceManager(config *Config, logger Logger) *PerformanceManager
NewPerformanceManager creates a new performance manager
func (*PerformanceManager) ApplyProfile ¶
func (pm *PerformanceManager) ApplyProfile(profileName string) error
ApplyProfile applies a performance profile
func (*PerformanceManager) DisableAutoTuning ¶
func (pm *PerformanceManager) DisableAutoTuning() error
DisableAutoTuning disables automatic performance tuning
func (*PerformanceManager) EnableAutoTuning ¶
func (pm *PerformanceManager) EnableAutoTuning() error
EnableAutoTuning enables automatic performance tuning
func (*PerformanceManager) GetMetrics ¶
func (pm *PerformanceManager) GetMetrics() *PerformanceMetrics
GetMetrics returns current performance metrics
func (*PerformanceManager) GetProfile ¶
func (pm *PerformanceManager) GetProfile(name string) (*PerformanceProfile, error)
GetProfile returns a performance profile by name
func (*PerformanceManager) GetRecommendations ¶
func (pm *PerformanceManager) GetRecommendations() []OptimizationRecommendation
GetRecommendations returns performance optimization recommendations
func (*PerformanceManager) OptimizeFor ¶
func (pm *PerformanceManager) OptimizeFor(target PerformanceTarget) error
OptimizeFor optimizes for a specific performance target
type PerformanceMetrics ¶
type PerformanceMetrics struct {
Timestamp time.Time `json:"timestamp"`
CPU CPUMetrics `json:"cpu"`
Memory MemoryMetrics `json:"memory"`
Goroutines GoroutineMetrics `json:"goroutines"`
GC GCMetrics `json:"gc"`
Network NetworkMetrics `json:"network"`
Disk DiskMetrics `json:"disk"`
Application ApplicationMetrics `json:"application"`
}
PerformanceMetrics comprehensive performance metrics
type PerformanceMonitor ¶
type PerformanceMonitor interface {
// Metrics collection
RecordMetric(name string, value float64, tags map[string]string) error
RecordLatency(name string, duration time.Duration, tags map[string]string) error
RecordCounter(name string, value int64, tags map[string]string) error
// Query operations
GetMetric(name string) (*Metric, error)
GetMetrics(pattern string) ([]*Metric, error)
QueryMetrics(query MetricQuery) (*MetricResult, error)
// Alerting
AddAlertRule(rule AlertRule) error
RemoveAlertRule(name string) error
GetActiveAlerts() ([]Alert, error)
// Lifecycle
Start(ctx context.Context) error
Stop() error
Health() error
GetMetrics() MonitorMetrics
}
PerformanceMonitor interface for monitoring
type PerformanceMonitorImpl ¶
type PerformanceMonitorImpl struct {
// contains filtered or unexported fields
}
PerformanceMonitorImpl provides comprehensive performance monitoring
func NewPerformanceMonitor ¶
func NewPerformanceMonitor(config MonitoringConfig, logger Logger) *PerformanceMonitorImpl
func (*PerformanceMonitorImpl) CreateAnalyzer ¶
func (m *PerformanceMonitorImpl) CreateAnalyzer(config AnalyzerConfig) (*PerformanceAnalyzer, error)
func (*PerformanceMonitorImpl) CreateCollector ¶
func (m *PerformanceMonitorImpl) CreateCollector(config CollectorConfig) (*MetricsCollector, error)
func (*PerformanceMonitorImpl) ExportMetrics ¶
func (m *PerformanceMonitorImpl) ExportMetrics(format string) ([]byte, error)
func (*PerformanceMonitorImpl) GetCurrentMetrics ¶
func (m *PerformanceMonitorImpl) GetCurrentMetrics() map[string]interface{}
func (*PerformanceMonitorImpl) GetMetrics ¶
func (m *PerformanceMonitorImpl) GetMetrics() *MonitoringMetrics
func (*PerformanceMonitorImpl) GetPerformanceReport ¶
func (m *PerformanceMonitorImpl) GetPerformanceReport() *PerformanceReport
func (*PerformanceMonitorImpl) GetStats ¶
func (m *PerformanceMonitorImpl) GetStats() *MonitoringStats
func (*PerformanceMonitorImpl) GetTopMetrics ¶
func (m *PerformanceMonitorImpl) GetTopMetrics(limit int) []*MetricSummary
func (*PerformanceMonitorImpl) RecordMetric ¶
func (m *PerformanceMonitorImpl) RecordMetric(name string, value float64, tags map[string]string)
func (*PerformanceMonitorImpl) Start ¶
func (m *PerformanceMonitorImpl) Start() error
func (*PerformanceMonitorImpl) StartTrace ¶
func (m *PerformanceMonitorImpl) StartTrace(name string) *TraceSpan
func (*PerformanceMonitorImpl) Stop ¶
func (m *PerformanceMonitorImpl) Stop() error
type PerformanceOptimizer ¶ added in v0.2.0
type PerformanceOptimizer struct {
// contains filtered or unexported fields
}
PerformanceOptimizer handles automatic performance optimizations
func NewPerformanceOptimizer ¶ added in v0.2.0
func NewPerformanceOptimizer(config OptimizerConfig, logger Logger) *PerformanceOptimizer
Placeholder implementations for referenced components
func (*PerformanceOptimizer) Start ¶ added in v0.2.0
func (po *PerformanceOptimizer) Start() error
func (*PerformanceOptimizer) Stop ¶ added in v0.2.0
func (po *PerformanceOptimizer) Stop() error
type PerformanceProfile ¶
type PerformanceProfile struct {
Name string `json:"name"`
Description string `json:"description"`
Target PerformanceTarget `json:"target"`
Constraints PerformanceConstraints `json:"constraints"`
Optimizations []OptimizationRule `json:"optimizations"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
PerformanceProfile defines a performance optimization profile
type PerformanceProfiler ¶ added in v0.2.0
type PerformanceProfiler struct {
// contains filtered or unexported fields
}
PerformanceProfiler provides comprehensive performance profiling and optimization
func NewPerformanceProfiler ¶ added in v0.2.0
func NewPerformanceProfiler(config ProfilerConfig, logger Logger) (*PerformanceProfiler, error)
NewPerformanceProfiler creates a new performance profiler
func (*PerformanceProfiler) CollectMetrics ¶ added in v0.2.0
func (p *PerformanceProfiler) CollectMetrics() *PerformanceMetrics
CollectMetrics collects current performance metrics
func (*PerformanceProfiler) GenerateReport ¶ added in v0.2.0
func (p *PerformanceProfiler) GenerateReport(period ReportPeriod) (*PerformanceReport, error)
GenerateReport generates a comprehensive performance report
func (*PerformanceProfiler) GetMetrics ¶ added in v0.2.0
func (p *PerformanceProfiler) GetMetrics() *ProfilerMetrics
GetMetrics returns profiler metrics
func (*PerformanceProfiler) Start ¶ added in v0.2.0
func (p *PerformanceProfiler) Start() error
Start starts the performance profiler
func (*PerformanceProfiler) Stop ¶ added in v0.2.0
func (p *PerformanceProfiler) Stop() error
Stop stops the performance profiler
type PerformanceReport ¶ added in v0.2.0
type PerformanceReport struct {
GeneratedAt time.Time `json:"generated_at"`
Period ReportPeriod `json:"period"`
Summary *PerformanceSummary `json:"summary"`
Metrics *PerformanceMetrics `json:"metrics"`
Hotspots []*Hotspot `json:"hotspots"`
Issues []*PerformanceIssue `json:"issues"`
Optimizations []*OptimizationResult `json:"optimizations"`
Trends *TrendAnalysis `json:"trends"`
Recommendations []string `json:"recommendations"`
}
PerformanceReport represents a comprehensive performance report
type PerformanceReporter ¶ added in v0.2.0
type PerformanceReporter struct {
// contains filtered or unexported fields
}
PerformanceReporter generates performance reports
func NewPerformanceReporter ¶ added in v0.2.0
func NewPerformanceReporter(config ReporterConfig, logger Logger) *PerformanceReporter
func (*PerformanceReporter) GenerateReport ¶ added in v0.2.0
func (pr *PerformanceReporter) GenerateReport(period ReportPeriod) (*PerformanceReport, error)
func (*PerformanceReporter) Start ¶ added in v0.2.0
func (pr *PerformanceReporter) Start() error
func (*PerformanceReporter) Stop ¶ added in v0.2.0
func (pr *PerformanceReporter) Stop() error
type PerformanceSummary ¶ added in v0.2.0
type PerformanceSummary struct {
OverallScore float64 `json:"overall_score"`
CPUScore float64 `json:"cpu_score"`
MemoryScore float64 `json:"memory_score"`
LatencyScore float64 `json:"latency_score"`
ThroughputScore float64 `json:"throughput_score"`
TotalIssues int `json:"total_issues"`
CriticalIssues int `json:"critical_issues"`
Uptime time.Duration `json:"uptime"`
}
PerformanceSummary provides a high-level performance summary
type PerformanceTarget ¶
type PerformanceTarget struct {
MaxLatency time.Duration `json:"max_latency"`
MinThroughput float64 `json:"min_throughput"`
MaxErrorRate float64 `json:"max_error_rate"`
MaxMemoryUsage int64 `json:"max_memory_usage"`
MaxCPUUsage float64 `json:"max_cpu_usage"`
}
PerformanceTarget defines optimization targets
type PerformanceThresholds ¶ added in v0.2.0
type PerformanceThresholds struct {
MaxCPUUsage float64 `json:"max_cpu_usage"`
MaxMemoryUsage int64 `json:"max_memory_usage"`
MaxGoroutines int `json:"max_goroutines"`
MaxLatency time.Duration `json:"max_latency"`
MaxErrorRate float64 `json:"max_error_rate"`
MinThroughput float64 `json:"min_throughput"`
}
PerformanceThresholds defines performance alert thresholds
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline manages sequential processing stages
func NewPipeline ¶
func NewPipeline(config PipelineConfig, logger Logger) *Pipeline
func (*Pipeline) GetMetrics ¶
func (p *Pipeline) GetMetrics() *PipelineMetrics
type PipelineConfig ¶ added in v0.2.0
type PipelineMetrics ¶ added in v0.2.0
type PipelineResult ¶ added in v0.2.0
type PipelineStage ¶
type PipelineStage struct {
// contains filtered or unexported fields
}
PipelineStage represents a stage in an execution pipeline
func NewPipelineStage ¶
func NewPipelineStage(config StageConfig, pipeline *Pipeline, inputCh chan StageInput, outputCh chan StageOutput) *PipelineStage
func (*PipelineStage) GetMetrics ¶
func (s *PipelineStage) GetMetrics() *StageMetrics
type PipelineStageConfig ¶
type PoolMetrics ¶ added in v0.2.0
type PoolMetrics struct {
PoolName string `json:"pool_name"`
WorkerCount int `json:"worker_count"`
ActiveTasks int64 `json:"active_tasks"`
CompletedTasks int64 `json:"completed_tasks"`
FailedTasks int64 `json:"failed_tasks"`
QueueDepth int `json:"queue_depth"`
AverageWaitTime time.Duration `json:"average_wait_time"`
Throughput float64 `json:"throughput"`
}
type PooledAllocator ¶
type PooledAllocator struct {
// contains filtered or unexported fields
}
PooledAllocator provides memory-efficient allocation
func NewPooledAllocator ¶
func NewPooledAllocator() *PooledAllocator
func (*PooledAllocator) GetBuffer ¶
func (pa *PooledAllocator) GetBuffer(size int) []byte
func (*PooledAllocator) PutBuffer ¶
func (pa *PooledAllocator) PutBuffer(buffer []byte)
type PooledObject ¶ added in v0.2.0
type PooledObject struct {
Object interface{} `json:"object"`
CreatedAt time.Time `json:"created_at"`
UsedCount int64 `json:"used_count"`
LastUsed time.Time `json:"last_used"`
}
PooledObject represents an object in the pool
type PredictionAlgorithm ¶ added in v0.2.0
type PredictionAlgorithm string
PredictionAlgorithm defines prediction algorithms
const ( PredictionLinearRegression PredictionAlgorithm = "linear_regression" PredictionExponentialSmoothing PredictionAlgorithm = "exponential_smoothing" PredictionARIMA PredictionAlgorithm = "arima" PredictionNeuralNetwork PredictionAlgorithm = "neural_network" PredictionEnsemble PredictionAlgorithm = "ensemble" )
type PredictionMetrics ¶ added in v0.2.0
type PredictionModel ¶ added in v0.2.0
type PredictionPoint ¶ added in v0.2.0
type PredictorConfig ¶ added in v0.2.0
type PriorityQueue ¶ added in v0.2.0
type PriorityQueue struct {
// contains filtered or unexported fields
}
Placeholder implementations for referenced types
type ProcessingNode ¶
type ProcessingNode struct {
// contains filtered or unexported fields
}
ProcessingNode represents a processing unit
type ProfileData ¶ added in v0.2.0
type ProfileData struct {
Type string `json:"type"`
Timestamp time.Time `json:"timestamp"`
Duration time.Duration `json:"duration"`
Data []byte `json:"data"`
Metadata map[string]interface{} `json:"metadata"`
FilePath string `json:"file_path"`
Size int64 `json:"size"`
}
ProfileData represents collected profiling data
type Profiler ¶ added in v0.2.0
type Profiler interface {
Start() error
Stop() error
Collect() (*ProfileData, error)
GetName() string
IsEnabled() bool
}
Profiler interface for different types of profilers
func NewBlockProfiler ¶ added in v0.2.0
func NewCPUProfiler ¶ added in v0.2.0
Individual profiler implementations
func NewGoroutineProfiler ¶ added in v0.2.0
func NewMemoryProfiler ¶
func NewMutexProfiler ¶ added in v0.2.0
func NewTraceProfiler ¶ added in v0.2.0
type ProfilerConfig ¶ added in v0.2.0
type ProfilerConfig struct {
// Profiling settings
EnableCPUProfiling bool `json:"enable_cpu_profiling"`
EnableMemoryProfiling bool `json:"enable_memory_profiling"`
EnableGoroutineProfiling bool `json:"enable_goroutine_profiling"`
EnableBlockProfiling bool `json:"enable_block_profiling"`
EnableMutexProfiling bool `json:"enable_mutex_profiling"`
EnableTraceProfiling bool `json:"enable_trace_profiling"`
// Collection intervals
ProfilingInterval time.Duration `json:"profiling_interval"`
MetricsInterval time.Duration `json:"metrics_interval"`
OptimizationInterval time.Duration `json:"optimization_interval"`
// Storage settings
ProfilesDir string `json:"profiles_dir"`
MaxProfileFiles int `json:"max_profile_files"`
ProfileRetention time.Duration `json:"profile_retention"`
// Server settings
ServerEnabled bool `json:"server_enabled"`
ServerHost string `json:"server_host"`
ServerPort int `json:"server_port"`
// Analysis settings
AnalysisEnabled bool `json:"analysis_enabled"`
AnalysisDepth int `json:"analysis_depth"`
HotspotThreshold float64 `json:"hotspot_threshold"`
MemoryLeakThreshold int64 `json:"memory_leak_threshold"`
// Optimization settings
AutoOptimization bool `json:"auto_optimization"`
OptimizationStrategies []string `json:"optimization_strategies"`
GCTuningEnabled bool `json:"gc_tuning_enabled"`
PoolOptimizationEnabled bool `json:"pool_optimization_enabled"`
// Alerting
AlertsEnabled bool `json:"alerts_enabled"`
PerformanceThresholds PerformanceThresholds `json:"performance_thresholds"`
}
ProfilerConfig defines configuration for performance profiling
func DefaultProfilerConfig ¶ added in v0.2.0
func DefaultProfilerConfig() ProfilerConfig
Default configuration
type ProfilerMetrics ¶ added in v0.2.0
type ProfilerMetrics struct {
ProfilesCollected int64 `json:"profiles_collected"`
AnalysesPerformed int64 `json:"analyses_performed"`
OptimizationsApplied int64 `json:"optimizations_applied"`
IssuesDetected int64 `json:"issues_detected"`
AlertsTriggered int64 `json:"alerts_triggered"`
AverageAnalysisTime time.Duration `json:"average_analysis_time"`
}
Metrics structures
type Proposal ¶ added in v0.2.0
type Proposal struct {
ID string `json:"id"`
Type ProposalType `json:"type"`
Proposer string `json:"proposer"`
Term int64 `json:"term"`
Data map[string]interface{} `json:"data"`
Votes map[string]bool `json:"votes"`
Status ProposalStatus `json:"status"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
Proposal represents a consensus proposal
type ProposalStatus ¶ added in v0.2.0
type ProposalStatus string
type ProposalType ¶ added in v0.2.0
type ProposalType string
ProposalType defines types of consensus proposals
const ( ProposalLeaderElection ProposalType = "leader_election" ProposalConfigChange ProposalType = "config_change" ProposalTaskAssignment ProposalType = "task_assignment" ProposalNodeMembership ProposalType = "node_membership" ProposalResourceRebalance ProposalType = "resource_rebalance" )
type QueueStats ¶
type RandomAlgorithm ¶
type RandomAlgorithm struct{}
Random algorithm for testing
func (*RandomAlgorithm) Configure ¶
func (ra *RandomAlgorithm) Configure(config map[string]interface{}) error
func (*RandomAlgorithm) GetName ¶
func (ra *RandomAlgorithm) GetName() string
func (*RandomAlgorithm) SelectNode ¶
func (ra *RandomAlgorithm) SelectNode(nodes []*LoadBalancerNode, request *Request) (*LoadBalancerNode, error)
type RateLimitAlgorithm ¶ added in v0.2.0
type RateLimitAlgorithm string
RateLimitAlgorithm defines the rate limiting algorithm
const ( AlgorithmTokenBucket RateLimitAlgorithm = "token_bucket" AlgorithmSlidingWindow RateLimitAlgorithm = "sliding_window" AlgorithmFixedWindow RateLimitAlgorithm = "fixed_window" AlgorithmLeakyBucket RateLimitAlgorithm = "leaky_bucket" )
type RateLimitMetrics ¶ added in v0.2.0
type RateLimitMetrics struct {
TotalRequests int64 `json:"total_requests"`
AllowedRequests int64 `json:"allowed_requests"`
DeniedRequests int64 `json:"denied_requests"`
ActiveKeys int64 `json:"active_keys"`
RedisOperations int64 `json:"redis_operations"`
RedisErrors int64 `json:"redis_errors"`
AverageLatency time.Duration `json:"average_latency"`
AllowRate float64 `json:"allow_rate"`
}
RateLimitMetrics tracks rate limiting performance
type RateLimitRequest ¶ added in v0.2.0
type RateLimitRequest struct {
Key string `json:"key"`
Limit int64 `json:"limit"`
Window time.Duration `json:"window"`
Burst int64 `json:"burst"`
Cost int64 `json:"cost"`
Timestamp time.Time `json:"timestamp"`
}
RateLimitRequest represents a rate limit check request
type RateLimitResult ¶ added in v0.2.0
type RateLimitResult struct {
Allowed bool `json:"allowed"`
Remaining int64 `json:"remaining"`
ResetTime time.Time `json:"reset_time"`
RetryAfter time.Duration `json:"retry_after"`
TotalLimit int64 `json:"total_limit"`
WindowSize time.Duration `json:"window_size"`
CurrentUsage int64 `json:"current_usage"`
}
RateLimitResult represents the result of a rate limit check
type RateLimitScripts ¶ added in v0.2.0
type RateLimitScripts struct {
TokenBucket *redis.Script
SlidingWindow *redis.Script
FixedWindow *redis.Script
LeakyBucket *redis.Script
Cleanup *redis.Script
}
RateLimitScripts contains Lua scripts for atomic Redis operations
type ReadPreference ¶ added in v0.2.0
type ReadPreference string
ReadPreference defines read preference for cache operations
const ( ReadPrimary ReadPreference = "primary" ReadReplica ReadPreference = "replica" ReadNearest ReadPreference = "nearest" ReadPreferReplica ReadPreference = "prefer_replica" )
type RedisClusterCache ¶ added in v0.2.0
type RedisClusterCache struct {
// contains filtered or unexported fields
}
RedisClusterCache provides advanced caching with Redis clustering support
func NewRedisClusterCache ¶ added in v0.2.0
func NewRedisClusterCache(config RedisClusterCacheConfig, logger Logger) (*RedisClusterCache, error)
NewRedisClusterCache creates a new Redis cluster cache
func (*RedisClusterCache) Delete ¶ added in v0.2.0
func (c *RedisClusterCache) Delete(key string) error
Delete removes a value from the cache
func (*RedisClusterCache) Get ¶ added in v0.2.0
func (c *RedisClusterCache) Get(key string) (interface{}, error)
Get retrieves a value from the cache
func (*RedisClusterCache) GetMetrics ¶ added in v0.2.0
func (c *RedisClusterCache) GetMetrics() *CacheMetrics
GetMetrics returns cache metrics
func (*RedisClusterCache) InvalidateByTags ¶ added in v0.2.0
func (c *RedisClusterCache) InvalidateByTags(tags []string) error
InvalidateByTags invalidates all entries with the specified tags
func (*RedisClusterCache) Set ¶ added in v0.2.0
func (c *RedisClusterCache) Set(key string, value interface{}, ttl time.Duration, tags ...string) error
Set stores a value in the cache
func (*RedisClusterCache) Start ¶ added in v0.2.0
func (c *RedisClusterCache) Start() error
Start starts the Redis cluster cache
func (*RedisClusterCache) Stop ¶ added in v0.2.0
func (c *RedisClusterCache) Stop() error
Stop stops the Redis cluster cache
type RedisClusterCacheConfig ¶ added in v0.2.0
type RedisClusterCacheConfig struct {
// Cluster configuration
PrimaryAddrs []string `json:"primary_addrs"`
ReplicaAddrs []string `json:"replica_addrs"`
Password string `json:"password"`
MaxRedirects int `json:"max_redirects"`
ReadTimeout time.Duration `json:"read_timeout"`
WriteTimeout time.Duration `json:"write_timeout"`
// Partitioning strategy
PartitionStrategy PartitionStrategy `json:"partition_strategy"`
PartitionCount int `json:"partition_count"`
ReplicationFactor int `json:"replication_factor"`
ConsistentHashing bool `json:"consistent_hashing"`
// Cache settings
DefaultTTL time.Duration `json:"default_ttl"`
MaxValueSize int64 `json:"max_value_size"`
CompressionEnabled bool `json:"compression_enabled"`
CompressionThreshold int64 `json:"compression_threshold"`
// Invalidation settings
InvalidationStrategy InvalidationStrategy `json:"invalidation_strategy"`
TagsEnabled bool `json:"tags_enabled"`
MaxTags int `json:"max_tags"`
// Cache warming
WarmingEnabled bool `json:"warming_enabled"`
WarmingInterval time.Duration `json:"warming_interval"`
WarmingConcurrency int `json:"warming_concurrency"`
WarmingBatchSize int `json:"warming_batch_size"`
// Performance optimization
PipelineSize int `json:"pipeline_size"`
PoolSize int `json:"pool_size"`
MinIdleConns int `json:"min_idle_conns"`
ReadPreference ReadPreference `json:"read_preference"`
// Monitoring
EnableMetrics bool `json:"enable_metrics"`
MetricsInterval time.Duration `json:"metrics_interval"`
EnableTracing bool `json:"enable_tracing"`
}
RedisClusterCacheConfig defines configuration for Redis cluster caching
func DefaultRedisClusterCacheConfig ¶ added in v0.2.0
func DefaultRedisClusterCacheConfig() RedisClusterCacheConfig
DefaultRedisClusterCacheConfig returns default configuration
type ReplicationConfig ¶ added in v0.2.0
type ReplicationManager ¶ added in v0.2.0
type ReplicationManager struct {
// contains filtered or unexported fields
}
ReplicationManager handles data replication
func NewReplicationManager ¶ added in v0.2.0
func NewReplicationManager(config ReplicationConfig, redis *redis.Client, logger Logger) *ReplicationManager
func (*ReplicationManager) Start ¶ added in v0.2.0
func (rm *ReplicationManager) Start() error
func (*ReplicationManager) Stop ¶ added in v0.2.0
func (rm *ReplicationManager) Stop() error
type ReplicationMetrics ¶ added in v0.2.0
type ReplicationMetrics struct{}
type ReportExporter ¶ added in v0.2.0
type ReportExporter interface {
Export(report []byte, format string, destination string) error
GetName() string
}
ReportExporter exports reports to different destinations
type ReportPeriod ¶ added in v0.2.0
ReportPeriod defines the time period for reports
type ReportTemplate ¶ added in v0.2.0
type ReportTemplate interface {
Generate(data *PerformanceReport) ([]byte, error)
GetFormat() string
GetName() string
}
ReportTemplate defines report templates
type ReporterConfig ¶ added in v0.2.0
type ReporterMetrics ¶ added in v0.2.0
type RequestRouter ¶
type RequestRouter struct {
// contains filtered or unexported fields
}
RequestRouter handles request routing and distribution
type ResourceAllocator ¶
type ResourceAllocator struct {
// contains filtered or unexported fields
}
ResourceAllocator handles intelligent resource allocation
type ResourceConfig ¶
type ResourceConfig struct {
Memory MemoryConfig `json:"memory"`
CPU CPUConfig `json:"cpu"`
IO IOConfig `json:"io"`
Network NetworkConfig `json:"network"`
Pools []ResourcePoolConfig `json:"pools"`
}
ResourceConfig defines resource management settings
type ResourceMetrics ¶
type ResourceMonitor ¶
type ResourceMonitor struct {
// contains filtered or unexported fields
}
ResourceMonitor tracks resource usage and health
type ResourcePool ¶
type ResourcePool interface {
Acquire(ctx context.Context) (Resource, error)
Release(resource Resource) error
Resize(newSize int) error
GetStats() PoolStats
Close() error
}
ResourcePool interface for different resource types
type ResourcePoolConfig ¶
type ResourcePoolConfig struct{}
type ResourcePoolManager ¶
type ResourcePoolManager interface {
// Pool operations
CreatePool(name string, config ResourcePoolConfig) error
GetPool(name string) (ResourcePool, error)
DeletePool(name string) error
// Resource operations
Acquire(ctx context.Context, poolName string) (Resource, error)
Release(poolName string, resource Resource) error
// Management
GetMetrics() ResourceMetrics
GetPoolInfo(poolName string) (PoolInfo, error)
ListPools() []PoolInfo
// Lifecycle
Start(ctx context.Context) error
Stop() error
Health() error
}
ResourcePoolManager interface for resource management
type ResourcePoolManagerImpl ¶
type ResourcePoolManagerImpl struct {
// contains filtered or unexported fields
}
ResourcePoolManager manages various resource pools with intelligent allocation
func NewResourcePoolManager ¶
func NewResourcePoolManager(config ResourcePoolConfig, logger Logger) *ResourcePoolManagerImpl
func (*ResourcePoolManagerImpl) CreateBufferPool ¶
func (m *ResourcePoolManagerImpl) CreateBufferPool(config BufferPoolConfig) (ResourcePool, error)
func (*ResourcePoolManagerImpl) CreateConnectionPool ¶
func (m *ResourcePoolManagerImpl) CreateConnectionPool(config ConnectionPoolConfig) (ResourcePool, error)
func (*ResourcePoolManagerImpl) CreateMemoryPool ¶
func (m *ResourcePoolManagerImpl) CreateMemoryPool(config MemoryPoolConfig) (ResourcePool, error)
func (*ResourcePoolManagerImpl) GetMetrics ¶
func (m *ResourcePoolManagerImpl) GetMetrics() *ResourceMetrics
func (*ResourcePoolManagerImpl) GetPool ¶
func (m *ResourcePoolManagerImpl) GetPool(id string) (ResourcePool, error)
func (*ResourcePoolManagerImpl) GetStats ¶
func (m *ResourcePoolManagerImpl) GetStats() *ResourceStats
func (*ResourcePoolManagerImpl) OptimizeForSystem ¶
func (m *ResourcePoolManagerImpl) OptimizeForSystem()
func (*ResourcePoolManagerImpl) Start ¶
func (m *ResourcePoolManagerImpl) Start() error
func (*ResourcePoolManagerImpl) Stop ¶
func (m *ResourcePoolManagerImpl) Stop() error
type ResourceRecycler ¶
type ResourceRecycler struct {
// contains filtered or unexported fields
}
ResourceRecycler handles resource cleanup and reuse
type ResourceStats ¶ added in v0.2.0
type ResourceType ¶
type ResourceType string
const ( ResourceTypeConnection ResourceType = "connection" ResourceTypeBuffer ResourceType = "buffer" ResourceTypeThread ResourceType = "thread" ResourceTypeMemory ResourceType = "memory" )
type RoundRobinAlgorithm ¶
type RoundRobinAlgorithm struct {
// contains filtered or unexported fields
}
RoundRobinAlgorithm implements simple round-robin selection
func (*RoundRobinAlgorithm) Configure ¶
func (rr *RoundRobinAlgorithm) Configure(config map[string]interface{}) error
func (*RoundRobinAlgorithm) GetName ¶
func (rr *RoundRobinAlgorithm) GetName() string
func (*RoundRobinAlgorithm) SelectNode ¶
func (rr *RoundRobinAlgorithm) SelectNode(nodes []*LoadBalancerNode, request *Request) (*LoadBalancerNode, error)
type ScalingCondition ¶ added in v0.2.0
type ScalingCondition struct {
Metric string `json:"metric"`
Operator ThresholdOperator `json:"operator"`
Value float64 `json:"value"`
Duration time.Duration `json:"duration"`
}
ScalingCondition defines additional scaling conditions
type ScalingEvent ¶ added in v0.2.0
type ScalingHistory ¶ added in v0.2.0
type ScalingHistory struct {
Events []ScalingEvent `json:"events"`
// contains filtered or unexported fields
}
Data structures
type ScalingMetrics ¶ added in v0.2.0
type ScalingPolicy ¶ added in v0.2.0
type ScalingPolicy struct {
Name string `json:"name"`
Type ScalingType `json:"type"`
Metric string `json:"metric"`
Threshold float64 `json:"threshold"`
Operator ThresholdOperator `json:"operator"`
ScaleAmount int `json:"scale_amount"`
Cooldown time.Duration `json:"cooldown"`
Priority int `json:"priority"`
Conditions []ScalingCondition `json:"conditions"`
}
ScalingPolicy defines scaling behavior
type ScalingTrigger ¶ added in v0.2.0
type ScalingTrigger struct {
Policy *ScalingPolicy `json:"policy"`
LastTrigger time.Time `json:"last_trigger"`
Active bool `json:"active"`
}
type ScalingType ¶ added in v0.2.0
type ScalingType string
ScalingType defines scaling types
const ( ScalingTypeUp ScalingType = "scale_up" ScalingTypeDown ScalingType = "scale_down" ScalingTypePredictive ScalingType = "predictive" ScalingTypeScheduled ScalingType = "scheduled" )
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages task scheduling and prioritization
func NewScheduler ¶
func NewScheduler(config SchedulerConfig, logger Logger) *Scheduler
func (*Scheduler) GetMetrics ¶
func (s *Scheduler) GetMetrics() *SchedulerMetrics
func (*Scheduler) SubmitTask ¶
type SchedulerConfig ¶ added in v0.2.0
type SchedulerConfig struct {
Algorithm SchedulingAlgorithm `json:"algorithm"`
PriorityLevels int `json:"priority_levels"`
QueueTimeout time.Duration `json:"queue_timeout"`
EnablePreemption bool `json:"enable_preemption"`
}
type SchedulerMetrics ¶ added in v0.2.0
type SchedulingAlgorithm ¶ added in v0.2.0
type SchedulingAlgorithm string
SchedulingAlgorithm defines task scheduling algorithms
const ( SchedulingFIFO SchedulingAlgorithm = "fifo" SchedulingPriority SchedulingAlgorithm = "priority" SchedulingRoundRobin SchedulingAlgorithm = "round_robin" SchedulingLeastLoad SchedulingAlgorithm = "least_load" SchedulingAdaptive SchedulingAlgorithm = "adaptive" )
type ServiceDiscovery ¶ added in v0.2.0
type ServiceDiscovery struct {
// contains filtered or unexported fields
}
type ShardingConfig ¶
type ShardingConfig struct {
Enabled bool `json:"enabled"`
ShardCount int `json:"shard_count"`
Algorithm string `json:"algorithm"`
KeyExtractor string `json:"key_extractor"`
}
ShardingConfig defines cache sharding configuration
type SimulatedAnnealingAlgorithm ¶
type SimulatedAnnealingAlgorithm struct {
// contains filtered or unexported fields
}
Simulated Annealing Algorithm
func (*SimulatedAnnealingAlgorithm) Configure ¶
func (saa *SimulatedAnnealingAlgorithm) Configure(config map[string]interface{}) error
func (*SimulatedAnnealingAlgorithm) GetName ¶
func (saa *SimulatedAnnealingAlgorithm) GetName() string
func (*SimulatedAnnealingAlgorithm) IsApplicable ¶
func (saa *SimulatedAnnealingAlgorithm) IsApplicable(context OptimizationContext) bool
func (*SimulatedAnnealingAlgorithm) Optimize ¶
func (saa *SimulatedAnnealingAlgorithm) Optimize(context OptimizationContext) (*OptimizationResult, error)
type SlicePool ¶
type SlicePool struct {
// contains filtered or unexported fields
}
SlicePool manages slices
type StageMetrics ¶ added in v0.2.0
type StageProcessor ¶ added in v0.2.0
type StageProcessor interface {
ProcessStage(ctx context.Context, task Task) (Task, error)
GetStageName() string
IsParallel() bool
}
StageProcessor processes tasks in a pipeline stage
type StageWorker ¶ added in v0.2.0
type StageWorker struct {
// contains filtered or unexported fields
}
type StringBuilderFactory ¶ added in v0.2.0
type StringBuilderFactory struct{}
StringBuilderFactory creates string builder pools
func (*StringBuilderFactory) CreateObject ¶ added in v0.2.0
func (f *StringBuilderFactory) CreateObject() interface{}
func (*StringBuilderFactory) GetObjectType ¶ added in v0.2.0
func (f *StringBuilderFactory) GetObjectType() string
type StringBuilderReset ¶ added in v0.2.0
type StringBuilderReset struct{}
StringBuilderReset resets string builders
func (*StringBuilderReset) ResetObject ¶ added in v0.2.0
func (r *StringBuilderReset) ResetObject(obj interface{}) error
type SystemProfiler ¶
type SystemProfiler struct {
// contains filtered or unexported fields
}
SystemProfiler profiles system resource usage
func NewSystemProfiler ¶
func NewSystemProfiler(config ProfilerConfig, logger Logger) *SystemProfiler
func (*SystemProfiler) GetMetrics ¶
func (p *SystemProfiler) GetMetrics() *ProfilerMetrics
func (*SystemProfiler) GetProfile ¶
func (p *SystemProfiler) GetProfile() *SystemProfile
func (*SystemProfiler) Start ¶
func (p *SystemProfiler) Start() error
func (*SystemProfiler) Stop ¶
func (p *SystemProfiler) Stop()
type TagIndex ¶ added in v0.2.0
type TagIndex struct {
// contains filtered or unexported fields
}
TagIndex maintains an index of cache entries by tags
type TargetHealthStatus ¶ added in v0.2.0
type TargetHealthStatus string
TargetHealthStatus represents target health states
const ( TargetHealthy TargetHealthStatus = "healthy" TargetDegraded TargetHealthStatus = "degraded" TargetUnhealthy TargetHealthStatus = "unhealthy" TargetMaintenance TargetHealthStatus = "maintenance" TargetUnknown TargetHealthStatus = "unknown" )
type TargetStatistics ¶ added in v0.2.0
type TargetStatistics struct {
TotalRequests int64 `json:"total_requests"`
SuccessfulRequests int64 `json:"successful_requests"`
FailedRequests int64 `json:"failed_requests"`
AverageLatency time.Duration `json:"average_latency"`
P95Latency time.Duration `json:"p95_latency"`
P99Latency time.Duration `json:"p99_latency"`
Throughput float64 `json:"throughput"`
ErrorRate float64 `json:"error_rate"`
LastUpdated time.Time `json:"last_updated"`
LatencyHistory []time.Duration `json:"latency_history"`
}
TargetStatistics tracks detailed target performance
type TaskConstraints ¶ added in v0.2.0
type TaskConstraints struct {
Affinity []AffinityRule `json:"affinity"`
AntiAffinity []AffinityRule `json:"anti_affinity"`
NodeSelector map[string]string `json:"node_selector"`
Tolerance []Toleration `json:"tolerance"`
MaxRetries int `json:"max_retries"`
Timeout time.Duration `json:"timeout"`
Deadline *time.Time `json:"deadline,omitempty"`
}
TaskConstraints defines execution constraints
type TaskExecutor ¶
type TaskExecutor struct {
// contains filtered or unexported fields
}
TaskExecutor coordinates task execution across different patterns
type TaskMonitor ¶ added in v0.2.0
type TaskMonitor struct{}
type TaskOrchestrator ¶ added in v0.2.0
type TaskOrchestrator struct {
// contains filtered or unexported fields
}
TaskOrchestrator manages distributed task execution
func NewTaskOrchestrator ¶ added in v0.2.0
func NewTaskOrchestrator(config OrchestratorConfig, redis *redis.Client, logger Logger) *TaskOrchestrator
func (*TaskOrchestrator) CancelTask ¶ added in v0.2.0
func (to *TaskOrchestrator) CancelTask(taskID string) error
func (*TaskOrchestrator) GetActiveTasks ¶ added in v0.2.0
func (to *TaskOrchestrator) GetActiveTasks() []*DistributedTask
func (*TaskOrchestrator) GetTaskStatus ¶ added in v0.2.0
func (to *TaskOrchestrator) GetTaskStatus(taskID string) (*DistributedTask, error)
func (*TaskOrchestrator) RebalanceTasks ¶ added in v0.2.0
func (to *TaskOrchestrator) RebalanceTasks()
func (*TaskOrchestrator) Start ¶ added in v0.2.0
func (to *TaskOrchestrator) Start() error
func (*TaskOrchestrator) Stop ¶ added in v0.2.0
func (to *TaskOrchestrator) Stop() error
func (*TaskOrchestrator) SubmitBatch ¶ added in v0.2.0
func (to *TaskOrchestrator) SubmitBatch(tasks []*DistributedTask) error
func (*TaskOrchestrator) SubmitTask ¶ added in v0.2.0
func (to *TaskOrchestrator) SubmitTask(task *DistributedTask) error
type TaskPartition ¶ added in v0.2.0
type TaskPartition struct {
ID string `json:"id"`
Index int `json:"index"`
Data map[string]interface{} `json:"data"`
Node string `json:"node"`
Status PartitionStatus `json:"status"`
Result interface{} `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}
TaskPartition represents a partition of a task
type TaskPartitioner ¶ added in v0.2.0
type TaskPartitioner struct{}
type TaskProcessor ¶ added in v0.2.0
type TaskProcessor interface {
CanProcess(task Task) bool
Process(ctx context.Context, task Task) (interface{}, error)
GetCapacity() int
GetLoad() float64
}
TaskProcessor processes specific types of tasks
type TaskRecovery ¶ added in v0.2.0
type TaskRecovery struct{}
type TaskRequirements ¶ added in v0.2.0
type TaskRequirements struct {
CPU float64 `json:"cpu"`
Memory int64 `json:"memory"`
Network int64 `json:"network"`
Disk int64 `json:"disk"`
Capabilities []string `json:"capabilities"`
Region string `json:"region,omitempty"`
Zone string `json:"zone,omitempty"`
MinNodes int `json:"min_nodes"`
MaxNodes int `json:"max_nodes"`
Isolation bool `json:"isolation"`
}
TaskRequirements defines what a task needs to execute
type TaskScheduler ¶ added in v0.2.0
type TaskScheduler struct {
// contains filtered or unexported fields
}
TaskScheduler schedules tasks across workers and pools
func NewTaskScheduler ¶ added in v0.2.0
func NewTaskScheduler(config SchedulerConfig, coordinator *WorkerCoordinator, logger Logger) *TaskScheduler
func (*TaskScheduler) ScheduleTask ¶ added in v0.2.0
func (ts *TaskScheduler) ScheduleTask(task Task) error
func (*TaskScheduler) Start ¶ added in v0.2.0
func (ts *TaskScheduler) Start() error
func (*TaskScheduler) Stop ¶ added in v0.2.0
func (ts *TaskScheduler) Stop() error
type TaskStatus ¶ added in v0.2.0
type TaskStatus string
TaskStatus represents task execution status
const ( TaskStatusPending TaskStatus = "pending" TaskStatusScheduled TaskStatus = "scheduled" TaskStatusRunning TaskStatus = "running" TaskStatusCompleted TaskStatus = "completed" TaskStatusFailed TaskStatus = "failed" TaskStatusCancelled TaskStatus = "cancelled" TaskStatusRetrying TaskStatus = "retrying" )
type ThreadPool ¶
type ThreadPool struct {
// contains filtered or unexported fields
}
ThreadPool manages OS threads
type ThresholdOperator ¶ added in v0.2.0
type ThresholdOperator string
ThresholdOperator defines threshold comparison operators
const ( OperatorGreaterThan ThresholdOperator = "gt" OperatorLessThan ThresholdOperator = "lt" OperatorGreaterEqual ThresholdOperator = "gte" OperatorLessEqual ThresholdOperator = "lte" OperatorEqual ThresholdOperator = "eq" OperatorNotEqual ThresholdOperator = "ne" )
type ThrottlingConfig ¶
type ThrottlingConfig struct {
Enabled bool `json:"enabled"`
RateLimit float64 `json:"rate_limit"`
BurstSize int `json:"burst_size"`
Window time.Duration `json:"window"`
Algorithm string `json:"algorithm"`
}
ThrottlingConfig defines rate limiting and throttling
type Toleration ¶ added in v0.2.0
type Toleration struct {
Key string `json:"key"`
Operator string `json:"operator"`
Value string `json:"value"`
Effect string `json:"effect"`
}
Toleration allows tasks to be scheduled on nodes with matching taints
type TraceProfiler ¶ added in v0.2.0
type TraceProfiler struct {
// contains filtered or unexported fields
}
func (*TraceProfiler) Collect ¶ added in v0.2.0
func (tp *TraceProfiler) Collect() (*ProfileData, error)
func (*TraceProfiler) GetName ¶ added in v0.2.0
func (tp *TraceProfiler) GetName() string
func (*TraceProfiler) IsEnabled ¶ added in v0.2.0
func (tp *TraceProfiler) IsEnabled() bool
func (*TraceProfiler) Start ¶ added in v0.2.0
func (tp *TraceProfiler) Start() error
func (*TraceProfiler) Stop ¶ added in v0.2.0
func (tp *TraceProfiler) Stop() error
type Trend ¶ added in v0.2.0
type Trend struct {
Direction TrendDirection `json:"direction"`
Magnitude float64 `json:"magnitude"`
Confidence float64 `json:"confidence"`
DataPoints []DataPoint `json:"data_points"`
}
Trend represents a performance trend
type TrendAnalysis ¶ added in v0.2.0
type TrendAnalysis struct {
CPUTrend *Trend `json:"cpu_trend"`
MemoryTrend *Trend `json:"memory_trend"`
LatencyTrend *Trend `json:"latency_trend"`
ThroughputTrend *Trend `json:"throughput_trend"`
LastUpdated time.Time `json:"last_updated"`
}
TrendAnalysis analyzes performance trends over time
type TrendDirection ¶
type TrendDirection string
TrendDirection defines trend directions
const ( NoTrend TrendDirection = iota IncreasingTrend DecreasingTrend StableTrend )
const ( TrendImproving TrendDirection = "improving" TrendStable TrendDirection = "stable" TrendDegrading TrendDirection = "degrading" )
type TuningParameter ¶
type TuningRecommendation ¶
type VoteRecord ¶ added in v0.2.0
type VoteRecord struct{}
type WarmerMetrics ¶ added in v0.2.0
type WarmingExecutor ¶ added in v0.2.0
type WarmingExecutor struct {
// contains filtered or unexported fields
}
type WarmingJob ¶ added in v0.2.0
type WarmingScheduler ¶ added in v0.2.0
type WarmingScheduler struct {
// contains filtered or unexported fields
}
type WarmingStrategy ¶ added in v0.2.0
type WarmingStrategy interface {
ShouldWarm(key string, entry *CacheEntry) bool
GetPriority(key string, entry *CacheEntry) int
GetWarmingData(key string) (interface{}, error)
}
WarmingStrategy defines cache warming strategies
type WarmingWorker ¶ added in v0.2.0
type WarmingWorker struct {
// contains filtered or unexported fields
}
type WeightAlgorithm ¶ added in v0.2.0
type WeightAlgorithm string
const ( WeightStatic WeightAlgorithm = "static" WeightDynamic WeightAlgorithm = "dynamic" WeightAdaptive WeightAlgorithm = "adaptive" WeightMLBased WeightAlgorithm = "ml_based" )
type WeightConfig ¶ added in v0.2.0
type WeightedRoundRobinAlgorithm ¶
type WeightedRoundRobinAlgorithm struct {
// contains filtered or unexported fields
}
WeightedRoundRobinAlgorithm implements weighted round-robin selection
func (*WeightedRoundRobinAlgorithm) Configure ¶
func (wrr *WeightedRoundRobinAlgorithm) Configure(config map[string]interface{}) error
func (*WeightedRoundRobinAlgorithm) GetName ¶
func (wrr *WeightedRoundRobinAlgorithm) GetName() string
func (*WeightedRoundRobinAlgorithm) SelectNode ¶
func (wrr *WeightedRoundRobinAlgorithm) SelectNode(nodes []*LoadBalancerNode, request *Request) (*LoadBalancerNode, error)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker represents an individual worker
func NewWorker ¶
func NewWorker(id string, pool *WorkerPool, processor TaskProcessor) *Worker
func (*Worker) GetMetrics ¶
func (w *Worker) GetMetrics() *WorkerMetrics
type WorkerCoordinator ¶ added in v0.2.0
type WorkerCoordinator struct {
// contains filtered or unexported fields
}
WorkerCoordinator coordinates workers across pools and nodes
func NewWorkerCoordinator ¶ added in v0.2.0
func NewWorkerCoordinator(config CoordinatorConfig, logger Logger) *WorkerCoordinator
Placeholder implementations for missing functions
func (*WorkerCoordinator) Start ¶ added in v0.2.0
func (wc *WorkerCoordinator) Start() error
func (*WorkerCoordinator) Stop ¶ added in v0.2.0
func (wc *WorkerCoordinator) Stop() error
type WorkerMetrics ¶ added in v0.2.0
type WorkerMetrics struct {
WorkerID string `json:"worker_id"`
TasksProcessed int64 `json:"tasks_processed"`
TasksFailed int64 `json:"tasks_failed"`
AverageLatency time.Duration `json:"average_latency"`
LastTaskTime time.Time `json:"last_task_time"`
Status WorkerStatus `json:"status"`
Load float64 `json:"load"`
}
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool manages a pool of workers for specific task types
func NewWorkerPool ¶
func NewWorkerPool(config WorkerPoolConfig, logger Logger) *WorkerPool
func (*WorkerPool) AddWorker ¶ added in v0.2.0
func (wp *WorkerPool) AddWorker() error
func (*WorkerPool) GetActiveWorkers ¶
func (p *WorkerPool) GetActiveWorkers() int
func (*WorkerPool) GetMetrics ¶
func (p *WorkerPool) GetMetrics() *WorkerPoolMetrics
func (*WorkerPool) RemoveWorker ¶ added in v0.2.0
func (wp *WorkerPool) RemoveWorker() error
func (*WorkerPool) SubmitTask ¶
func (p *WorkerPool) SubmitTask(task Task) error
type WorkerPoolConfig ¶
type WorkerPoolConfig struct {
Name string `json:"name"`
MinWorkers int `json:"min_workers"`
MaxWorkers int `json:"max_workers"`
QueueSize int `json:"queue_size"`
IdleTimeout time.Duration `json:"idle_timeout"`
TaskTimeout time.Duration `json:"task_timeout"`
}
WorkerPoolConfig defines worker pool configuration
type WorkerPoolInfo ¶
type WorkerStatus ¶ added in v0.2.0
type WorkerStatus string
WorkerStatus represents worker states
const ( WorkerStatusIdle WorkerStatus = "idle" WorkerStatusProcessing WorkerStatus = "processing" WorkerStatusStopped WorkerStatus = "stopped" WorkerStatusError WorkerStatus = "error" )
type WorkloadCoordinator ¶
type WorkloadCoordinator struct {
// contains filtered or unexported fields
}
WorkloadCoordinator manages overall workload distribution