stats

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReserveDays = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTrafficInPayload

type AddTrafficInPayload struct {
	ProxyName    string
	TrafficBytes int64
}

type AddTrafficOutPayload

type AddTrafficOutPayload struct {
	ProxyName    string
	TrafficBytes int64
}

type CloseClientPayload

type CloseClientPayload struct{}

type CloseConnectionPayload

type CloseConnectionPayload struct {
	ProxyName string
}

type CloseProxyPayload

type CloseProxyPayload struct {
	Name      string
	ProxyType string
}

type Collector

type Collector interface {
	Mark(statsType StatsType, payload interface{})
	Run() error
	GetServer() *ServerStats
	GetProxiesByType(proxyType string) []*ProxyStats
	GetProxiesByTypeAndName(proxyType string, proxyName string) *ProxyStats
	GetProxyTraffic(name string) *ProxyTrafficInfo
}

func NewInternalCollector

func NewInternalCollector(enable bool) Collector

type NewClientPayload

type NewClientPayload struct{}

type NewProxyPayload

type NewProxyPayload struct {
	Name      string
	ProxyType string
}

type OpenConnectionPayload

type OpenConnectionPayload struct {
	ProxyName string
}

type ProxyStatistics

type ProxyStatistics struct {
	Name          string
	ProxyType     string
	TrafficIn     metric.DateCounter
	TrafficOut    metric.DateCounter
	CurConns      metric.Counter
	LastStartTime time.Time
	LastCloseTime time.Time
}

type ProxyStats

type ProxyStats struct {
	Name            string
	Type            string
	TodayTrafficIn  int64
	TodayTrafficOut int64
	LastStartTime   string
	LastCloseTime   string
	CurConns        int64
}

type ProxyTrafficInfo

type ProxyTrafficInfo struct {
	Name       string
	TrafficIn  []int64
	TrafficOut []int64
}

type ServerStatistics

type ServerStatistics struct {
	TotalTrafficIn  metric.DateCounter
	TotalTrafficOut metric.DateCounter
	CurConns        metric.Counter

	// counter for clients
	ClientCounts metric.Counter

	// counter for proxy types
	ProxyTypeCounts map[string]metric.Counter

	// statistics for different proxies
	// key is proxy name
	ProxyStatistics map[string]*ProxyStatistics
}

type ServerStats

type ServerStats struct {
	TotalTrafficIn  int64
	TotalTrafficOut int64
	CurConns        int64
	ClientCounts    int64
	ProxyTypeCounts map[string]int64
}

type StatsType

type StatsType int
const (
	TypeNewClient StatsType = iota
	TypeCloseClient
	TypeNewProxy
	TypeCloseProxy
	TypeOpenConnection
	TypeCloseConnection
	TypeAddTrafficIn
	TypeAddTrafficOut
)

Jump to

Keyboard shortcuts

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