stats

package
v0.0.0-...-b6e34ba Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/* Stats update interval */
	INTERVAL = 2 * time.Second
)

Variables

View Source
var Store = struct {
	sync.RWMutex
	handlers map[string]*Handler
}{/* contains filtered or unexported fields */}

*

  • Handlers Store

Functions

func GetStats

func GetStats(name string) interface{}

*

  • Get stats for the server

Types

type Handler

type Handler struct {

	/* Backends counters */
	BackendsCounter *counters.BackendsBandwidthCounter

	/* Server traffic data */
	Traffic chan core.ReadWriteCount

	/* Server current connections count */
	Connections chan uint

	/* Current backends pool */
	Backends chan []core.Backend

	/* Input channel for latest stats */
	ServerStats chan counters.BandwidthStats
	// contains filtered or unexported fields
}

*

  • Handler processess data from server

func NewHandler

func NewHandler(name string) *Handler

*

  • Creates new stats handler for the server
  • with name 'name'

func (*Handler) Start

func (this *Handler) Start()

*

  • Start handler work asynchroniously

func (*Handler) Stop

func (this *Handler) Stop()

*

  • Request handler stop and clear resources

type Stats

type Stats struct {

	/* Current active client connections */
	ActiveConnections uint `json:"active_connections"`

	/* Total received bytes from backend */
	RxTotal uint64 `json:"rx_total"`

	/* Total transmitter bytes to backend */
	TxTotal uint64 `json:"tx_total"`

	/* Received bytes to backend / second */
	RxSecond uint `json:"rx_second"`

	/* Transmitted bytes to backend / second */
	TxSecond uint `json:"tx_second"`

	/* Current backends pool */
	Backends []core.Backend `json:"backends"`
}

*

  • Stats of the Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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