promserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConcurrency is the default probe concurrency.
	DefaultConcurrency = 10
	// DefaultDeviceTimeout is the default max time for devices to respond to probes.
	DefaultDeviceTimeout = 5 * time.Second
	// DefaultNamespace is the default namespace for metrics.
	DefaultNamespace = "shelly"
	// DefaultSubsystem is the default subsystem for metrics.
	DefaultSubsystem = "status"
)

Variables

This section is empty.

Functions

func NewServer

func NewServer(ctx context.Context, discoverer *discovery.Discoverer, opts ...Option) http.Handler

Types

type Option

type Option func(*Server)

func WithConcurrency

func WithConcurrency(c int) Option

WithConcurrency defines the number of concurrent probes which will be made.

func WithDeviceTimeout

func WithDeviceTimeout(t time.Duration) Option

WithDeviceTimeout describes the maximum time allowed for a device to respond to it probe.

func WithPrometheusNamespace

func WithPrometheusNamespace(ns string) Option

WithPrometheusNamespace sets the namespace string to use for prometheus metric names.

func WithPrometheusSubsystem

func WithPrometheusSubsystem(subsystem string) Option

WithPrometheusSubsystem sets the subsystem section of the prometheus metric names.

type Server

type Server struct {
	http.Handler
	// contains filtered or unexported fields
}

func (*Server) Collect

func (s *Server) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*Server) Describe

func (s *Server) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

Jump to

Keyboard shortcuts

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