metricsservice

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcClient

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

func NewGrpcClient

func NewGrpcClient(url, certDir, authority string, clientMetrics *grpcprom.ClientMetrics) (*GrpcClient, error)

func (*GrpcClient) GetMetrics

func (c *GrpcClient) GetMetrics(ctx context.Context, scaledObjectName, scaledObjectNamespace, metricName string) (*external_metrics.ExternalMetricValueList, error)

func (*GrpcClient) GetServerURL added in v2.10.0

func (c *GrpcClient) GetServerURL() string

GetServerURL returns url of the gRPC server this client is connected to

func (*GrpcClient) WaitForConnectionReady

func (c *GrpcClient) WaitForConnectionReady(ctx context.Context, logger logr.Logger) bool

WaitForConnectionReady waits for gRPC connection to be ready returns true if the connection was successful, false if we hit a timeut from context

type GrpcServer

type GrpcServer struct {
	api.UnimplementedMetricsServiceServer
	// contains filtered or unexported fields
}

func NewGrpcServer

func NewGrpcServer(scaleHandler *scaling.ScaleHandler, address, certDir string, certsReady chan struct{}) GrpcServer

NewGrpcServer creates a new instance of GrpcServer

func (*GrpcServer) GetMetrics

GetMetrics returns metrics values in form of ExternalMetricValueList for specified ScaledObject reference

func (*GrpcServer) NeedLeaderElection

func (s *GrpcServer) NeedLeaderElection() bool

NeedLeaderElection is needed to implement LeaderElectionRunnable interface of controller-runtime. This assures that the component is started/stoped when this particular instance is selected/deselected as a leader.

func (*GrpcServer) Start

func (s *GrpcServer) Start(ctx context.Context) error

Start starts a new gRPC Metrics Service, this implements Runnable interface of controller-runtime Manager, so we can use mgr.Add() to start this component.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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