Documentation
¶
Index ¶
- Constants
- Variables
- type AdditionalGrpcServer
- 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 (s *Server) Collect(ch chan<- prometheus.Metric, metrics map[string]*api.ListMetricsResponse)
- func (s *Server) GetContainerUsageSummary(metrics map[string]*api.ListMetricsResponse) map[sampler.ContainerKey]*api.ContainerMetrics
- func (s *Server) GetMetrics() map[string]*api.ListMetricsResponse
- func (s *Server) GetNodeNames() sets.String
- func (s *Server) IsReady(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 ¶
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) 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 (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
GetNodeNames returns the names of the nodes we have results for
func (*Server) IsReady ¶ added in v0.6.2
func (s *Server) IsReady(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
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
Click to show internal directories.
Click to hide internal directories.