scaler

package
v0.0.0-...-260b785 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scaler

type Scaler struct {
	// contains filtered or unexported fields
}

Scaler is responsible to implement an external-push scaler for keda

func New

func New(prometheusAddr string) (*Scaler, error)

New creates an instance of the scaler object

func (*Scaler) GetMetricSpec

func (s *Scaler) GetMetricSpec(ctx context.Context, scaledObject *pb.ScaledObjectRef) (*pb.GetMetricSpecResponse, error)

GetMetricSpec defines the average target value for the metric

func (*Scaler) GetMetrics

func (s *Scaler) GetMetrics(ctx context.Context, metricRequest *pb.GetMetricsRequest) (*pb.GetMetricsResponse, error)

GetMetrics returns the total value for the metric

func (*Scaler) IsActive

func (s *Scaler) IsActive(ctx context.Context, scaledObject *pb.ScaledObjectRef) (*pb.IsActiveResponse, error)

IsActive is called by the keda controller to check if keda should scale the deployment from 0 to 1

func (*Scaler) ScaleUp

func (s *Scaler) ScaleUp(ctx context.Context, project, service, version string) error

ScaleUp instructs keda to scale the service from 0 to 1

func (*Scaler) Start

func (s *Scaler) Start()

Start begins the grpc server

func (*Scaler) StreamIsActive

func (s *Scaler) StreamIsActive(scaledObject *pb.ScaledObjectRef, epsServer pb.ExternalScaler_StreamIsActiveServer) error

StreamIsActive is called by keda controller once to allow us to stream isActive events to it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL