utilization

package
v0.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const FilterExpiredMetricsEnvName = "COLLECTOR_FILTER_EXPIRED_UTILIZATION_METRICS"

Variables

View Source
var AdditionalGrpcServers []AdditionalGrpcServer

AdditionalGrpcServers are registered as additional services.

Functions

This section is empty.

Types

type AdditionalGrpcServer added in v0.6.2

type AdditionalGrpcServer struct {
	// RegisterServer is called to register a grpc server for both protobuf and json serving via gRPC gateway.
	RegisterServer func(s grpc.ServiceRegistrar)

	// RegisterHandler is called only to register for json serving via gRPC gateway, it won't be called when nil.
	RegisterHandler func(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
}

AdditionalGrpcServer contains the information necessary to add a new gRPC server to be registered.

type Server

type Server struct {
	ResponseMutex sync.RWMutex

	// Responses has the last response for each node keyed by the node name
	Responses map[string]*api.ListMetricsResponse `json:"responses" yaml:"responses"`

	api.UnimplementedMetricsCollectorServer // required
	api.UnimplementedHealthServer           // required

	collectorcontrollerv1alpha1.UtilizationServer

	ServeResults    atomic.Bool
	IsReadyResult   atomic.Bool
	IsCached        atomic.Bool
	IsHealthyResult atomic.Bool
	// contains filtered or unexported fields
}

func (*Server) CacheMetrics

func (s *Server) CacheMetrics(msg *api.ListMetricsResponse)

CacheMetrics caches msg

func (*Server) ClearMetrics

func (s *Server) ClearMetrics(key string)

ClearMetrics deletes the metrics with the given key from the cache

func (*Server) Collect

func (s *Server) Collect(ch chan<- prometheus.Metric, metrics map[string]*api.ListMetricsResponse)

func (*Server) GetContainerUsageSummary

func (s *Server) GetContainerUsageSummary(metrics map[string]*api.ListMetricsResponse) map[sampler.ContainerKey]*api.ContainerMetrics

GetContainerUsageSummary maps containers to their cached metric values. metrics are passed as an argument to reduce lock contention.

func (*Server) GetMetrics

func (s *Server) GetMetrics() map[string]*api.ListMetricsResponse

func (*Server) GetNodeNames added in v0.6.2

func (s *Server) GetNodeNames() sets.String

GetNodeNames returns the names of the nodes we have results for

func (*Server) IsReady added in v0.6.2

IsReady returns success if the service should be accepting traffic

func (*Server) PushMetrics

func (s *Server) PushMetrics(req api.MetricsCollector_PushMetricsServer) error

PushMetrics receives metrics pushed to the collector by node-samplers

func (*Server) Start

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

Jump to

Keyboard shortcuts

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