endpoint

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package endpoint contains a service that is sufficient for pollers to receive their configuration and reception of metrics

Index

Constants

View Source
const (
	AgentErrorChanSize    = 1
	GreeterChanSize       = 10
	RegistrationsChanSize = 10
	MetricsPostsChanSize  = 50
	MetricsStoreChanSize  = 50
	CheckId               = "id"
	CheckFileSuffix       = ".json"
)
View Source
const (
	ExpectedAgentHeartbeatSec = 60
	ConnectionWriteAllowance  = 60 * time.Second
)
View Source
const (
	IncomingChanSize = 100
)

Variables

This section is empty.

Functions

func BuildMetricName

func BuildMetricName(entityId, agentId, checkType, checkId, field string) string

func LoadCertificateFromConfig

func LoadCertificateFromConfig(cfg *config.EndpointConfig) (*tls.Certificate, error)

func Run

func Run(endpointConfigFilePath string)

Types

type AgentTracker

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

func NewAgentTracker

func NewAgentTracker(cfg *config.EndpointConfig) *AgentTracker

func (*AgentTracker) CloseAgentByAddr

func (at *AgentTracker) CloseAgentByAddr(addr net.Addr)

func (*AgentTracker) NewAgentFromHello

func (at *AgentTracker) NewAgentFromHello(frame protocol.Frame, params *protocol.HandshakeParameters,
	responder *utils.SmartConn) <-chan error

Returns a channel where errors observed about this agent are conveyed

func (*AgentTracker) Start

func (at *AgentTracker) Start(ctx context.Context)

func (*AgentTracker) UseMetricsRouter

func (at *AgentTracker) UseMetricsRouter(mr *MetricsRouter)

type AgentTrackingError

type AgentTrackingError struct {
	Message  string
	SourceId string
}

func (AgentTrackingError) Error

func (e AgentTrackingError) Error() string

type BasicServer

type BasicServer struct {
	Certificate *tls.Certificate
	BindAddr    string

	*AgentTracker
}

func (*BasicServer) ApplyConfig

func (s *BasicServer) ApplyConfig(cfg *config.EndpointConfig) error

func (*BasicServer) ListenAndServe

func (s *BasicServer) ListenAndServe() error

func (*BasicServer) UseMetricsRouter

func (s *BasicServer) UseMetricsRouter(mr *MetricsRouter)

type EndpointServer

type EndpointServer interface {
	ApplyConfig(cfg *config.EndpointConfig) error

	UseMetricsRouter(mr *MetricsRouter)

	ListenAndServe() error
}

func NewEndpointServer

func NewEndpointServer(configFilePath string) (EndpointServer, error)

type Metric

type Metric struct {
	// Name is <entity_id>.<agent_id>.<check_type>.<check_id>.<field>
	Name       string
	Value      string
	MetricType string
}

type MetricsRouter

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

func NewMetricsRouter

func NewMetricsRouter(cfg *config.EndpointConfig) *MetricsRouter

func (*MetricsRouter) Route

func (mr *MetricsRouter) Route(metric Metric)

Jump to

Keyboard shortcuts

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