Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoStrategy ¶
type AutoStrategy struct {
// contains filtered or unexported fields
}
AutoStrategy implements auto-scaling with slot-based capacity
func (*AutoStrategy) DesiredInstances ¶
func (s *AutoStrategy) DesiredInstances() int
func (*AutoStrategy) InitializeTracker ¶
func (s *AutoStrategy) InitializeTracker() *ConcurrencyTracker
func (*AutoStrategy) LeaseSize ¶
func (s *AutoStrategy) LeaseSize() int
func (*AutoStrategy) ScaleDownDelay ¶
func (s *AutoStrategy) ScaleDownDelay() time.Duration
type ConcurrencyStrategy ¶
type ConcurrencyStrategy interface {
// InitializeTracker creates a new tracker for a sandbox
InitializeTracker() *ConcurrencyTracker
// LeaseSize returns how much capacity to allocate per lease (for two-tier leasing)
LeaseSize() int
// ScaleDownDelay returns how long to wait before retiring idle sandbox
ScaleDownDelay() time.Duration
// DesiredInstances returns how many instances should always run (0 = scale to zero)
DesiredInstances() int
// contains filtered or unexported methods
}
ConcurrencyStrategy encapsulates mode-specific capacity management logic. Implementations of this interface are package-internal only - the lowercase methods (checkCapacity, releaseCapacity) enforce implementation locality.
func NewStrategy ¶
func NewStrategy(svc *core_v1alpha.ServiceConcurrency) ConcurrencyStrategy
NewStrategy creates a strategy from ServiceConcurrency config
type ConcurrencyTracker ¶
type ConcurrencyTracker struct {
// contains filtered or unexported fields
}
ConcurrencyTracker manages capacity state for a single sandbox
func (*ConcurrencyTracker) AcquireLease ¶
func (t *ConcurrencyTracker) AcquireLease() int
AcquireLease allocates capacity and returns the lease size. Caller must check HasCapacity() before calling this method.
func (*ConcurrencyTracker) HasCapacity ¶
func (t *ConcurrencyTracker) HasCapacity() bool
func (*ConcurrencyTracker) Max ¶
func (t *ConcurrencyTracker) Max() int
func (*ConcurrencyTracker) ReleaseLease ¶
func (t *ConcurrencyTracker) ReleaseLease(size int)
func (*ConcurrencyTracker) Used ¶
func (t *ConcurrencyTracker) Used() int
type FixedStrategy ¶
type FixedStrategy struct {
// contains filtered or unexported fields
}
FixedStrategy implements fixed instance count (no slot-based capacity)
func (*FixedStrategy) DesiredInstances ¶
func (s *FixedStrategy) DesiredInstances() int
func (*FixedStrategy) InitializeTracker ¶
func (s *FixedStrategy) InitializeTracker() *ConcurrencyTracker
func (*FixedStrategy) LeaseSize ¶
func (s *FixedStrategy) LeaseSize() int
func (*FixedStrategy) ScaleDownDelay ¶
func (s *FixedStrategy) ScaleDownDelay() time.Duration
Click to show internal directories.
Click to hide internal directories.