Documentation ¶
Overview ¶
Package scaling provides the autoscaling capability for Vertex objects.
A workqueue is implemented in this package to watch vertices in the cluster, calculate the desired replica number for each of them periodically, and patch the vertex spec.
Function StartWatching() and StopWatching() are also provided in the package, so that vertices can be added into and removed from the workqueue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyOfVertex ¶
KeyOfVertex returns the unique key of a vertex
Types ¶
type Option ¶
type Option func(*options)
func WithBackPressureThreshold ¶
WithBackPressureThreshold sets the threshold of considering there's back pressure, a float value less than 1.
func WithClientsCacheSize ¶ added in v0.9.0
WithClientsCacheSize sets the size of the daemon clients cache.
func WithTaskInterval ¶
WithTaskInterval sets the interval of picking up a task from the work queue.
func WithWorkers ¶
WithWorkers sets the number of workers working on autoscaling.
type Scaler ¶
type Scaler struct {
// contains filtered or unexported fields
}
func (*Scaler) Start ¶
Start function starts the autoscaling worker group. Each worker keeps picking up scaling tasks (which contains vertex keys) to calculate the desired replicas, and patch the vertex spec with the new replica number if needed.
func (*Scaler) StartWatching ¶
StartWatching put a key (namespace/name) into the Scaler
func (*Scaler) StopWatching ¶
StopWatching stops autoscaling on the key (namespace/name)