stats

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2017 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(ups, backend string)

func Incr

func Incr(dbackend *DeltaBackend, dglb *DeltaGlb)

Types

type BackendCounter

type BackendCounter struct {
	ActiveClients uint   `json:"active_clients"` // active clients
	RxBytes       uint64 `json:"rx_bytes"`       // nb of received bytes
	TxBytes       uint64 `json:"tx_bytes"`       // nb of transmitted bytes
	Requests      uint64 `json:"requests"`       // nb of requests
	RxRate        uint   `json:"rx_rate"`        // received bytes / second
	TxRate        uint   `json:"tx_rate"`        // transmitted bytes / second
	ReqRate       uint   `json:"requests_rate"`  // requests / second
	// contains filtered or unexported fields
}

BackendCounter hold one upstream-backend's current statistics

func (*BackendCounter) MarshalJSON

func (c *BackendCounter) MarshalJSON() ([]byte, error)

type BackendCounterAlias

type BackendCounterAlias BackendCounter

type DeltaBackend

type DeltaBackend struct {
	Uid string
	Bid string
	Ac  int
	Rx  uint64
	Tx  uint64
	Req uint64
}

type DeltaGlb

type DeltaGlb struct {
	Rx   uint64
	Tx   uint64
	Req  uint64
	Fail uint64
}

type GlobalCounter

type GlobalCounter struct {
	RxBytes  uint64 `json:"rx_bytes"`      // nb of received bytes
	TxBytes  uint64 `json:"tx_bytes"`      // nb of transmitted bytes
	Requests uint64 `json:"requests"`      // nb of client requests
	Fails    uint64 `json:"fails"`         // nb of failed requesets
	RxRate   uint   `json:"rx_rate"`       // received bytes / second
	TxRate   uint   `json:"tx_rate"`       // transmitted bytes / second
	ReqRate  uint   `json:"requests_rate"` // requests / second
	FailRate uint   `json:"fails_rate"`    // failed requests / second
	// contains filtered or unexported fields
}

GlobalCounter hold current global statistics

func (*GlobalCounter) MarshalJSON

func (c *GlobalCounter) MarshalJSON() ([]byte, error)

type GlobalCounterAlias

type GlobalCounterAlias GlobalCounter

type Stats

type Stats struct {
	Global   *GlobalCounter  `json:"global"`   // global counter
	Upstream UpstreamCounter `json:"upstream"` // upstream -> backend -> counter
	// contains filtered or unexported fields
}

Stats holds all of statistics data.

func Get

func Get() *Stats

type UpstreamCounter

type UpstreamCounter map[string]map[string]*BackendCounter

UpstreamCounter hold upstream & backends current statistics

func UpstreamStats

func UpstreamStats() UpstreamCounter

Jump to

Keyboard shortcuts

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