web

package
Version: v0.0.0-...-bc062f4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config model.Config

Global config used throughout the service, set on flag parsing

Functions

func Api

func Api() *rest.Api

Api sets the routes for websocket and stats, prom if enabled also starts the ticker for gathering metrics

func ClientApi

func ClientApi()

ClientApi sets the route and starts the server for client management

func DeletePromMetricPerNode

func DeletePromMetricPerNode(m *model.Metrics)

DeletePromMetricsPerNode deletes the values stored in the prometheus gauges

func GetMetrics

func GetMetrics(w rest.ResponseWriter, _ *rest.Request)

GetMetrics returns all the NodeStats gathered in an array keyed by their address

func InitialiseConfig

func InitialiseConfig()

Initialises the config by parsing flags, then refreshing config from file (if enabled)

func NewConnection

func NewConnection(w rest.ResponseWriter, r *rest.Request)

NewConnection upgrades a HTTP connection to ws, leaving it open until error or disconnect

func ServeProm

func ServeProm(w rest.ResponseWriter, r *rest.Request)

ServeProm transforms the go-json-rest reader/writer to the in-built for the prom client

func SetClients

func SetClients(w rest.ResponseWriter, r *rest.Request)

SetClients receives POST data and updates the nodes to scrape metrics

func SetNodeConfig

func SetNodeConfig()

SetNodeConfig refreshes the client nodes from file

func StartMonitor

func StartMonitor()

StartMonitor creates the ticker to gather metrics based on user input

func ToFloat64

func ToFloat64(v interface{}) float64

ToFloat64 converts a string to float64

func UpdateConfigs

func UpdateConfigs(cs []*model.NodeConfig)

UpdateConfig refreshes the client metrics map used by all controllers based on the config

func UpdatePromMetrics

func UpdatePromMetrics()

UpdatePromMetrics refreshes all the prometheus client gauges for output

func UpdateWsClients

func UpdateWsClients()

UpdateWsClients refreshes the output given to every connected client

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL