monitor

package
v0.0.0-...-49e170d Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents the internal representation of a monitor, specifically containing references to the logging components, monitor client etc needed

func CreateMonitor

func CreateMonitor(ms Settings, l *logrus.Logger) *Client

CreateMonitor simply creates a pointer to a Client TODO return error

func (*Client) CloseMonitorConnection

func (mon *Client) CloseMonitorConnection()

CloseMonitorConnection simple closes the InfluxDB client when processing is complete

func (*Client) WriteBytesCopied

func (mon *Client) WriteBytesCopied(srcIsServer bool, totalBytesCopied int64, dst, src net.Conn)

WriteBytesCopied writes the number of bytes copied to the monitor connection

func (*Client) WriteConnectionAccepted

func (mon *Client) WriteConnectionAccepted(src net.Conn)

WriteConnectionAccepted writes a point to the monitor to indicate that a connection was accepted

func (*Client) WriteConnectionPoolStats

func (mon *Client) WriteConnectionPoolStats(src net.Conn, connectionsInUse, connectionPoolSize int)

WriteConnectionPoolStats writes a the number of connections in use and the pool size to the monitor

func (*Client) WriteConnectionRejected

func (mon *Client) WriteConnectionRejected(src net.Conn)

WriteConnectionRejected writes a point to indicate that a connection was rejected

func (*Client) WriteContainerCreated

func (mon *Client) WriteContainerCreated(numContainersCreated int)

WriteContainerCreated writes the number of connections created to the monitor

func (*Client) WriteContainerDestroyed

func (mon *Client) WriteContainerDestroyed(numContainersDestroyed int)

WriteContainerDestroyed writes the number of connections destroyed to the monitor

type Monitor

type Monitor interface {
	WriteBytesCopied(srcIsServer bool, totalBytesCopied int64, dst, src net.Conn)
	WriteConnectionAccepted(src net.Conn)
	WriteConnectionPoolStats(src net.Conn, connectionsInUse, connectionPoolSize int)
	WriteContainerCreated(numContainersCreated int)
	WriteContainerDestroyed(numContainersDestroyed int)
	CloseMonitorConnection()
}

Monitor should be implemented to write to a time-series database for the various methods required

type Settings

type Settings struct {
	Address  string
	Database string
}

Settings represents the various configuration parameters for a monitor and are typically read from an external configuration file

Jump to

Keyboard shortcuts

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