analyzer

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 36 Imported by: 16

Documentation

Index

Constants

View Source
const (
	// FlowBulkInsertDefault maximum number of flows aggregated between two data store inserts
	FlowBulkInsertDefault int = 100

	// FlowBulkInsertDeadlineDefault deadline of each bulk insert in second
	FlowBulkInsertDeadlineDefault int = 5

	// FlowBulkMaxDelayDefault delay between two bulk
	FlowBulkMaxDelayDefault int = 5
)

Variables

This section is empty.

Functions

func AnalyzerClusterAuthenticationOpts added in v0.19.0

func AnalyzerClusterAuthenticationOpts() *shttp.AuthenticationOpts

func NewTopologyProbeBundleFromConfig added in v0.8.0

func NewTopologyProbeBundleFromConfig(g *graph.Graph) (*probe.ProbeBundle, error)

NewTopologyProbeBundleFromConfig creates a new topology server probes from configuration

Types

type ElectionStatus added in v0.13.0

type ElectionStatus struct {
	IsMaster bool
}

ElectionStatus describes the status of an election

type FlowClient added in v0.10.0

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

FlowClient describes a flow client connection

func NewFlowClient added in v0.10.0

func NewFlowClient(addr string, port int, authOpts *shttp.AuthenticationOpts) (*FlowClient, error)

NewFlowClient creates a flow client and creates a new connection to the server

func (*FlowClient) SendFlow added in v0.10.0

func (c *FlowClient) SendFlow(f *flow.Flow) error

SendFlow sends a flow to the server

func (*FlowClient) SendFlows added in v0.10.0

func (c *FlowClient) SendFlows(flows []*flow.Flow)

SendFlows sends flows to the server

type FlowClientConn added in v0.10.0

type FlowClientConn interface {
	Connect() error
	Close() error
	Send(data []byte) error
}

FlowClientConn is the interface to be implemented by the flow clients

type FlowClientPool added in v0.10.0

type FlowClientPool struct {
	common.RWMutex
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowClientPool describes a flow client pool.

func NewFlowClientPool added in v0.10.0

func NewFlowClientPool(pool ws.SpeakerPool, authOpts *shttp.AuthenticationOpts) *FlowClientPool

NewFlowClientPool returns a new FlowClientPool using the websocket connections to maintain the pool of client up to date according to the websocket connections status.

func (*FlowClientPool) Close added in v0.10.0

func (p *FlowClientPool) Close()

Close all connections

func (*FlowClientPool) OnConnected added in v0.10.0

func (p *FlowClientPool) OnConnected(c ws.Speaker)

OnConnected websocket event handler

func (*FlowClientPool) OnDisconnected added in v0.10.0

func (p *FlowClientPool) OnDisconnected(c ws.Speaker)

OnDisconnected websocket event handler

func (*FlowClientPool) SendFlows added in v0.10.0

func (p *FlowClientPool) SendFlows(flows []*flow.Flow)

SendFlows sends flows using a random connection

type FlowClientUDPConn added in v0.13.0

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

FlowClientUDPConn describes UDP client connection

func NewFlowClientUDPConn added in v0.13.0

func NewFlowClientUDPConn(addr string, port int) (*FlowClientUDPConn, error)

NewFlowClientUDPConn returns a new UDP flow client

func (*FlowClientUDPConn) Close added in v0.13.0

func (c *FlowClientUDPConn) Close() error

Close the connection

func (*FlowClientUDPConn) Connect added in v0.13.0

func (c *FlowClientUDPConn) Connect() (err error)

Connect to the UDP flow server

func (*FlowClientUDPConn) Send added in v0.13.0

func (c *FlowClientUDPConn) Send(data []byte) error

Send data over the wire

type FlowClientWebSocketConn added in v0.13.0

type FlowClientWebSocketConn struct {
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowClientWebSocketConn describes WebSocket client connection

func NewFlowClientWebSocketConn added in v0.13.0

func NewFlowClientWebSocketConn(url *url.URL, authOpts *shttp.AuthenticationOpts) (*FlowClientWebSocketConn, error)

NewFlowClientWebSocketConn returns a new WebSocket flow client

func (*FlowClientWebSocketConn) Close added in v0.13.0

func (c *FlowClientWebSocketConn) Close() error

Close the connection

func (*FlowClientWebSocketConn) Connect added in v0.13.0

func (c *FlowClientWebSocketConn) Connect() (err error)

Connect to the WebSocket flow server

func (*FlowClientWebSocketConn) Send added in v0.13.0

func (c *FlowClientWebSocketConn) Send(data []byte) error

Send data over the wire

type FlowServer added in v0.10.0

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

FlowServer describes a flow server

func NewFlowServer added in v0.10.0

func NewFlowServer(s *shttp.Server, g *graph.Graph, store storage.Storage, probe *probe.ProbeBundle, auth shttp.AuthenticationBackend) (*FlowServer, error)

NewFlowServer creates a new flow server listening at address/port, based on configuration

func (*FlowServer) Start added in v0.10.0

func (s *FlowServer) Start()

Start the flow server

func (*FlowServer) Stop added in v0.10.0

func (s *FlowServer) Stop()

Stop the server

type FlowServerConn added in v0.10.0

type FlowServerConn interface {
	Serve(ch chan *flow.Flow, quit chan struct{}, wg *sync.WaitGroup)
}

FlowServerConn describes a flow server connection

type FlowServerUDPConn added in v0.13.0

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

FlowServerUDPConn describes a UDP flow server connection

func NewFlowServerUDPConn added in v0.13.0

func NewFlowServerUDPConn(addr string, port int) (*FlowServerUDPConn, error)

NewFlowServerUDPConn return a new UDP flow server

func (*FlowServerUDPConn) Serve added in v0.13.0

func (c *FlowServerUDPConn) Serve(ch chan *flow.Flow, quit chan struct{}, wg *sync.WaitGroup)

Serve UDP connections

type FlowServerWebSocketConn added in v0.13.0

type FlowServerWebSocketConn struct {
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowServerWebSocketConn describes a WebSocket flow server connection

func NewFlowServerWebSocketConn added in v0.13.0

func NewFlowServerWebSocketConn(server *shttp.Server, auth shttp.AuthenticationBackend) (*FlowServerWebSocketConn, error)

NewFlowServerWebSocketConn returns a new WebSocket flow server

func (*FlowServerWebSocketConn) OnMessage added in v0.13.0

func (c *FlowServerWebSocketConn) OnMessage(client ws.Speaker, m ws.Message)

OnMessage event

func (*FlowServerWebSocketConn) Serve added in v0.13.0

func (c *FlowServerWebSocketConn) Serve(ch chan *flow.Flow, quit chan struct{}, wg *sync.WaitGroup)

Serve starts a WebSocket flow server

type PeersStatus added in v0.15.0

type PeersStatus struct {
	Incomers map[string]ws.ConnStatus
	Outgoers map[string]ws.ConnStatus
}

PeersStatus describes the state of a peer

type PersistencePolicy added in v0.15.0

type PersistencePolicy string

PersistencePolicy defines Persistent policy for publishers

const (
	// Persistent means that the graph elements created will always remain
	Persistent PersistencePolicy = "Persistent"
	// DeleteOnDisconnect means the graph elements created will be deleted on client disconnect
	DeleteOnDisconnect PersistencePolicy = "DeleteOnDisconnect"
)

type Server

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

Server describes an Analyzer servers mechanism like http, websocket, topology, ondemand probes, ...

func NewServerFromConfig

func NewServerFromConfig() (*Server, error)

NewServerFromConfig creates a new empty server

func (*Server) GetStatus added in v0.13.0

func (s *Server) GetStatus() interface{}

GetStatus returns the status of an analyzer

func (*Server) Start added in v0.10.0

func (s *Server) Start() error

Start the analyzer server

func (*Server) Stop

func (s *Server) Stop()

Stop the analyzer server

type Status added in v0.19.1

type Status struct {
	Agents      map[string]ws.ConnStatus
	Peers       PeersStatus
	Publishers  map[string]ws.ConnStatus
	Subscribers map[string]ws.ConnStatus
	Alerts      ElectionStatus
	Captures    ElectionStatus
	Probes      []string
}

Status describes the status of an analyzer

type TopologyAgentEndpoint added in v0.15.0

type TopologyAgentEndpoint struct {
	common.RWMutex
	ws.DefaultSpeakerEventHandler

	Graph *graph.Graph
	// contains filtered or unexported fields
}

TopologyAgentEndpoint serves the graph for agents.

func NewTopologyAgentEndpoint added in v0.15.0

func NewTopologyAgentEndpoint(pool ws.StructSpeakerPool, cached *graph.CachedBackend, g *graph.Graph) (*TopologyAgentEndpoint, error)

NewTopologyAgentEndpoint returns a new server that handles messages from the agents

func (*TopologyAgentEndpoint) OnDisconnected added in v0.15.0

func (t *TopologyAgentEndpoint) OnDisconnected(c ws.Speaker)

OnDisconnected called when an agent disconnected.

func (*TopologyAgentEndpoint) OnStructMessage added in v0.19.1

func (t *TopologyAgentEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)

OnStructMessage is triggered when a message from the agent is received.

type TopologyPublisherEndpoint added in v0.15.0

type TopologyPublisherEndpoint struct {
	common.RWMutex
	ws.DefaultSpeakerEventHandler

	Graph *graph.Graph
	// contains filtered or unexported fields
}

TopologyPublisherEndpoint serves the graph for external publishers, for instance an external program that interacts with the Skydive graph.

func NewTopologyPublisherEndpoint added in v0.15.0

func NewTopologyPublisherEndpoint(pool ws.StructSpeakerPool, g *graph.Graph) (*TopologyPublisherEndpoint, error)

NewTopologyPublisherEndpoint returns a new server for external publishers.

func (*TopologyPublisherEndpoint) OnDisconnected added in v0.15.0

func (t *TopologyPublisherEndpoint) OnDisconnected(c ws.Speaker)

OnDisconnected called when a publisher got disconnected.

func (*TopologyPublisherEndpoint) OnStructMessage added in v0.19.1

func (t *TopologyPublisherEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)

OnStructMessage is triggered by message coming from a publisher.

type TopologyReplicationEndpoint added in v0.15.0

type TopologyReplicationEndpoint struct {
	common.RWMutex
	ws.DefaultSpeakerEventHandler

	Graph *graph.Graph
	// contains filtered or unexported fields
}

TopologyReplicationEndpoint serves the local Graph and send local modification to its peers.

func NewTopologyReplicationEndpoint added in v0.15.0

func NewTopologyReplicationEndpoint(pool ws.StructSpeakerPool, auth *shttp.AuthenticationOpts, cached *graph.CachedBackend, g *graph.Graph) (*TopologyReplicationEndpoint, error)

NewTopologyReplicationEndpoint returns a new server to be used by other analyzers for replication.

func (*TopologyReplicationEndpoint) ConnectPeers added in v0.15.0

func (t *TopologyReplicationEndpoint) ConnectPeers()

ConnectPeers starts a goroutine connecting all the peers.

func (*TopologyReplicationEndpoint) DisconnectPeers added in v0.15.0

func (t *TopologyReplicationEndpoint) DisconnectPeers()

DisconnectPeers disconnects all the peers and wait until all disconnected.

func (*TopologyReplicationEndpoint) GetSpeakers added in v0.15.0

func (t *TopologyReplicationEndpoint) GetSpeakers() []ws.Speaker

GetSpeakers return both incoming and outgoing speakers

func (*TopologyReplicationEndpoint) OnConnected added in v0.15.0

func (t *TopologyReplicationEndpoint) OnConnected(c ws.Speaker)

OnConnected is called when an incoming peer got connected.

func (*TopologyReplicationEndpoint) OnDisconnected added in v0.15.0

func (t *TopologyReplicationEndpoint) OnDisconnected(c ws.Speaker)

OnDisconnected is called when an incoming peer got disconnected.

func (*TopologyReplicationEndpoint) OnEdgeAdded added in v0.15.0

func (t *TopologyReplicationEndpoint) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded graph edge added event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnEdgeDeleted added in v0.15.0

func (t *TopologyReplicationEndpoint) OnEdgeDeleted(e *graph.Edge)

OnEdgeDeleted graph edge deleted event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnEdgeUpdated added in v0.15.0

func (t *TopologyReplicationEndpoint) OnEdgeUpdated(e *graph.Edge)

OnEdgeUpdated graph edge updated event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnNodeAdded added in v0.15.0

func (t *TopologyReplicationEndpoint) OnNodeAdded(n *graph.Node)

OnNodeAdded graph node added event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnNodeDeleted added in v0.15.0

func (t *TopologyReplicationEndpoint) OnNodeDeleted(n *graph.Node)

OnNodeDeleted graph node deleted event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnNodeUpdated added in v0.15.0

func (t *TopologyReplicationEndpoint) OnNodeUpdated(n *graph.Node)

OnNodeUpdated graph node updated event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnStructMessage added in v0.19.1

func (t *TopologyReplicationEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)

OnStructMessage is triggered by message coming from an other peer.

type TopologyReplicatorPeer added in v0.13.0

type TopologyReplicatorPeer struct {
	ws.DefaultSpeakerEventHandler
	URL         *url.URL
	Graph       *graph.Graph
	AuthOptions *shttp.AuthenticationOpts
	// contains filtered or unexported fields
}

TopologyReplicatorPeer is a remote connection to another Graph server. Only modification of the local Graph made either by the local server, by an agent message or by an external client will be forwarded to the peer.

func (*TopologyReplicatorPeer) OnConnected added in v0.13.0

func (p *TopologyReplicatorPeer) OnConnected(c ws.Speaker)

OnConnected is called when the peer gets connected then the whole graph is send to initialize it.

func (*TopologyReplicatorPeer) OnDisconnected added in v0.15.0

func (p *TopologyReplicatorPeer) OnDisconnected(c ws.Speaker)

OnDisconnected is called when the peer gets disconnected

Jump to

Keyboard shortcuts

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