observer

package
v0.0.0-...-c34bea4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options) error

Option customizes the configuration of the Manager.

func WithErrorAggregationWindow

func WithErrorAggregationWindow(d time.Duration) Option

WithErrorAggregationWindow sets a time window during which errors with the same error message are coalesced. The aggregated error is forwarded to the downstream consumer either when the window expires or when a new, different error occurs (whichever happens first)

func WithLogger

func WithLogger(l logrus.FieldLogger) Option

WithLogger sets the logger to use for logging.

func WithSortBufferDrainTimeout

func WithSortBufferDrainTimeout(d time.Duration) Option

WithSortBufferDrainTimeout sets the sort buffer drain timeout value. For flows requests where the total number of flows cannot be determined (typically for flows requests in follow mode), a flow is taken out of the buffer and sent to the client after duration d if the buffer is not full. This value must be greater than 0. Setting this value too low would render the flows sorting operation ineffective. A value between 500 milliseconds and 3 seconds should be constitute a good choice in most cases.

func WithSortBufferMaxLen

func WithSortBufferMaxLen(i int) Option

WithSortBufferMaxLen sets the maximum number of flows that can be buffered for sorting before being sent to the client. The provided value must be greater than 0 and is to be understood per client request. Therefore, it is advised to keep the value moderate (a value between 30 and 100 should constitute a good choice in most cases).

type PeerListReporter

type PeerListReporter interface {
	PeerLister
	PeerReporter
}

PeerListReporter is the interface that groups the List and ReportOffline methods.

type PeerLister

type PeerLister interface {
	// List returns a list of peers with active connections. If a peer cannot
	// be connected to; its Conn attribute must be nil.
	List() []poolTypes.Peer
}

PeerLister is the interface that wraps the List method.

type PeerReporter

type PeerReporter interface {
	// ReportOffline allows the caller to report a peer as being offline. The
	// peer is identified by its name.
	ReportOffline(name string)
}

PeerReporter is the interface that wraps the ReportOffline method.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements the observerpb.ObserverServer interface.

func NewServer

func NewServer(peers PeerListReporter, options ...Option) (*Server, error)

NewServer creates a new Server.

func (*Server) GetAgentEvents

GetAgentEvents implements observerpb.ObserverServer.GetAgentEvents by proxying requests to the hubble instance the proxy is connected to.

func (*Server) GetDebugEvents

GetDebugEvents implements observerpb.ObserverServer.GetDebugEvents by proxying requests to the hubble instance the proxy is connected to.

func (*Server) GetFlows

GetFlows implements observerpb.ObserverServer.GetFlows by proxying requests to the hubble instance the proxy is connected to.

func (*Server) GetNodes

GetNodes implements observerpb.ObserverClient.GetNodes.

func (*Server) ServerStatus

ServerStatus implements observerpb.ObserverServer.ServerStatus by aggregating the ServerStatus answer of all hubble peers.

Jump to

Keyboard shortcuts

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