Documentation ¶
Index ¶
- Variables
- func Api() *rest.Api
- func ClientApi()
- func DeletePromMetricPerNode(m *model.Metrics)
- func GetMetrics(w rest.ResponseWriter, _ *rest.Request)
- func InitialiseConfig()
- func NewConnection(w rest.ResponseWriter, r *rest.Request)
- func ServeProm(w rest.ResponseWriter, r *rest.Request)
- func SetClients(w rest.ResponseWriter, r *rest.Request)
- func SetNodeConfig()
- func StartMonitor()
- func ToFloat64(v interface{}) float64
- func UpdateConfigs(cs []*model.NodeConfig)
- func UpdatePromMetrics()
- func UpdateWsClients()
Constants ¶
This section is empty.
Variables ¶
var Config model.Config
Global config used throughout the service, set on flag parsing
Functions ¶
func 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 ¶
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 StartMonitor ¶
func StartMonitor()
StartMonitor creates the ticker to gather metrics based on user input
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.