Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MeasureConn ¶
func MeasureConn(conn onet.DuplexConn, bytesSent, bytesReceived *int64) onet.DuplexConn
Types ¶
type ProxyMetrics ¶
type ShadowsocksMetrics ¶
type ShadowsocksMetrics interface {
GetLocation(net.Addr) (string, error)
SetNumAccessKeys(numKeys int, numPorts int)
// TCP metrics
AddOpenTCPConnection(clientLocation string)
AddClosedTCPConnection(clientLocation, accessKey, status string, data ProxyMetrics, timeToCipher, duration time.Duration)
AddTCPProbe(clientLocation, status, drainResult string, port int, data ProxyMetrics)
// UDP metrics
AddUDPPacketFromClient(clientLocation, accessKey, status string, clientProxyBytes, proxyTargetBytes int, timeToCipher time.Duration)
AddUDPPacketFromTarget(clientLocation, accessKey, status string, targetProxyBytes, proxyClientBytes int)
AddUDPNatEntry()
RemoveUDPNatEntry()
}
ShadowsocksMetrics registers metrics for the Shadowsocks service.
func NewPrometheusShadowsocksMetrics ¶ added in v1.1.2
func NewPrometheusShadowsocksMetrics(ipCountryDB *geoip2.Reader, registerer prometheus.Registerer) ShadowsocksMetrics
NewPrometheusShadowsocksMetrics constructs a metrics object that uses `ipCountryDB` to convert IP addresses to countries, and reports all metrics to Prometheus via `registerer`. `ipCountryDB` may be nil, but `registerer` must not be.
Click to show internal directories.
Click to hide internal directories.