Documentation
¶
Index ¶
- type ClientSubscription
- type MpaServer
- type SubscriptionManager
- func (sm *SubscriptionManager) Broadcast(data *collector.ContainerMetricsSnapshot, timestamp time.Time)
- func (sm *SubscriptionManager) GetInterests(clientID string) []WorkloadInterest
- func (sm *SubscriptionManager) Register(ch chan *gen.MpaStreamResponse) string
- func (sm *SubscriptionManager) Unregister(id string)
- func (sm *SubscriptionManager) UpdateSubscription(clientID string, sub *gen.MpaWorkloadSubscription)
- type WorkloadInterest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientSubscription ¶
type ClientSubscription struct {
ID string
Channel chan *gen.MpaStreamResponse
Interests []WorkloadInterest
}
type MpaServer ¶
type MpaServer struct {
gen.UnimplementedMpaServiceServer
// contains filtered or unexported fields
}
MpaServer implements the gRPC service for in-cluster MPA metric streaming
func NewMpaServer ¶
func NewMpaServer( logger logr.Logger, historicalCollector *collector.HistoricalMetricsCollector, healthManager *health.HealthManager, ) *MpaServer
NewMpaServer creates a new MpaServer. historicalCollector may be nil if Prometheus is not available.
func (*MpaServer) PublishMetrics ¶
func (s *MpaServer) PublishMetrics( metrics *collector.ContainerMetricsSnapshot, timestamp time.Time, )
PublishMetrics is called by the collector to broadcast new metrics
func (*MpaServer) StreamWorkloadMetrics ¶
func (s *MpaServer) StreamWorkloadMetrics(stream gen.MpaService_StreamWorkloadMetricsServer) error
type SubscriptionManager ¶
type SubscriptionManager struct {
// contains filtered or unexported fields
}
SubscriptionManager manages active streams and their interests
func NewSubscriptionManager ¶
func NewSubscriptionManager(logger logr.Logger) *SubscriptionManager
func (*SubscriptionManager) Broadcast ¶
func (sm *SubscriptionManager) Broadcast( data *collector.ContainerMetricsSnapshot, timestamp time.Time, )
Broadcast filters and dispatches metrics to interested clients
func (*SubscriptionManager) GetInterests ¶ added in v0.0.61
func (sm *SubscriptionManager) GetInterests(clientID string) []WorkloadInterest
GetInterests returns the current interests for a client.
func (*SubscriptionManager) Register ¶
func (sm *SubscriptionManager) Register(ch chan *gen.MpaStreamResponse) string
func (*SubscriptionManager) Unregister ¶
func (sm *SubscriptionManager) Unregister(id string)
func (*SubscriptionManager) UpdateSubscription ¶
func (sm *SubscriptionManager) UpdateSubscription( clientID string, sub *gen.MpaWorkloadSubscription, )
Click to show internal directories.
Click to hide internal directories.