mirror of
https://github.com/openfaas/faas.git
synced 2025-06-10 17:26:47 +00:00
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>
17 lines
467 B
Go
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
|
|
}
|