statserver

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package statserver provides a WebSocket server which receives autoscaler statistics, typically from queue proxy sidecar containers, and sends them to a channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server receives autoscaler statistics over WebSocket and sends them to a channel.

func New

func New(statsServerAddr string, statsCh chan<- metrics.StatMessage, logger *zap.SugaredLogger) *Server

New creates a Server which will receive autoscaler statistics and forward them to statsCh until Shutdown is called.

func (*Server) Handler

func (s *Server) Handler(w http.ResponseWriter, r *http.Request)

Handler exposes a websocket handler for receiving stats from queue sidecar containers.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe listens on the address s.addr and handles incoming connections. It blocks until the server fails or Shutdown is called. It returns an error or, if Shutdown was called, nil.

func (*Server) Shutdown

func (s *Server) Shutdown(timeout time.Duration)

Shutdown terminates the server gracefully for the given timeout period and then returns.

Jump to

Keyboard shortcuts

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