faas/gateway/handlers/service_query.go
Simon Pelczer 7fe67d7af6 Implemented the autoscaling steps to be proportions of the max replicas.
Introduced an new label to set the scaling factor that is used to calculate th proportions, setting it to 0 also allows to disable scaling.
Updated the tests to reflect the changes and added a new test which shows that setting the scaling factor to 0 indeed does disable scaling.
Ensured that the scaling factor is always between [0 and 100].

Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
2018-04-11 19:30:43 -07:00

17 lines
467 B
Go

package handlers
// ServiceQuery provides interface for replica querying/setting
type ServiceQuery interface {
GetReplicas(service string) (response ServiceQueryResponse, err error)
SetReplicas(service string, count uint64) error
}
// ServiceQueryResponse response from querying a function status
type ServiceQueryResponse struct {
Replicas uint64
MaxReplicas uint64
MinReplicas uint64
ScalingFactor uint64
AvailableReplicas uint64
}