surveyor

package
v0.0.0-...-6647289 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package surveyor is used to garner data from a NATS deployment for Prometheus

Package surveyor is used to garner data from a NATS deployment for Prometheus

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultListenPort      = 7777
	DefaultListenAddress   = "0.0.0.0"
	DefaultURL             = nats.DefaultURL
	DefaultExpectedServers = 3
	DefaultPollTimeout     = time.Second * 5
)

Defaults

Functions

This section is empty.

Types

type Options

type Options struct {
	URLs            string
	Credentials     string
	PollTimeout     time.Duration
	ExpectedServers int
	ListenAddress   string
	ListenPort      int
	CertFile        string
	KeyFile         string
	CaFile          string
	NATSServerURL   string
	HTTPUser        string // User in metrics scrape by Prometheus.
	HTTPPassword    string
	Prefix          string // TODO
}

Options are used to configure the NATS collector

func GetDefaultOptions

func GetDefaultOptions() *Options

GetDefaultOptions returns the default set of options

type StatzCollector

type StatzCollector struct {
	sync.Mutex
	// contains filtered or unexported fields
}

StatzCollector collects statz from a server deployment

func NewStatzCollector

func NewStatzCollector(nc *nats.Conn, numServers int, pollTimeout time.Duration) *StatzCollector

NewStatzCollector creates a NATS Statz Collector

func (*StatzCollector) Collect

func (sc *StatzCollector) Collect(ch chan<- prometheus.Metric)

Collect gathers the streaming server serverz metrics.

func (*StatzCollector) Describe

func (sc *StatzCollector) Describe(ch chan<- *prometheus.Desc)

Describe is the Prometheus interface to describe metrics for the prometheus system

func (*StatzCollector) Polling

func (sc *StatzCollector) Polling() bool

Polling determines if the collector is in a polling cycle

type Surveyor

type Surveyor struct {
	sync.Mutex
	// contains filtered or unexported fields
}

A Surveyor instance

func NewSurveyor

func NewSurveyor(opts *Options) (*Surveyor, error)

NewSurveyor creates a surveyor

func (*Surveyor) Start

func (s *Surveyor) Start() error

Start starts the surveyor

func (*Surveyor) Stop

func (s *Surveyor) Stop()

Stop stops the surveyor

Jump to

Keyboard shortcuts

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