Documentation ¶
Index ¶
- Constants
- type Server
- func (s *Server) CacheMetrics(msg *api.ListMetricsResponse)
- func (s *Server) Check(ctx context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
- func (s *Server) ClearMetrics(key string)
- func (c *Server) Collect(ch chan<- prometheus.Metric, metrics map[string]*api.ListMetricsResponse)
- func (c *Server) GetContainerUsageSummary(metrics map[string]*api.ListMetricsResponse) map[sampler.ContainerKey]*api.ContainerMetrics
- func (s *Server) GetMetrics() map[string]*api.ListMetricsResponse
- func (s *Server) IsLeader(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
- func (s *Server) PushMetrics(req api.MetricsCollector_PushMetricsServer) error
- func (s *Server) Start(ctx context.Context) error
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) Check ¶
func (s *Server) Check(ctx context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*Server) ClearMetrics ¶
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 ¶
func (s *Server) IsLeader(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
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
Click to show internal directories.
Click to hide internal directories.