utilization

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const FilterExpiredMetricsEnvName = "COLLECTOR_FILTER_EXPIRED_UTILIZATION_METRICS"

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	ResponseMutext 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

	IsLeaderElected atomic.Bool
	IsHealthy       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 (c *Server) Collect(ch chan<- prometheus.Metric, metrics map[string]*api.ListMetricsResponse)

func (*Server) GetContainerUsageSummary

func (c *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) IsLeader

Ready 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