dem

package
v0.1.77 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostInfo

func GetHostInfo() (*control_dto.HostInfo, error)

GetHostInfo

func GetPopsAddrs

func GetPopsAddrs(pops map[string]control_dto.ClientCacheInfo) (ret []string)

GetPopsAddrs

func Ping2Addrs added in v0.1.7

func Ping2Addrs(addr1 string, addr2 string, pingCount int) (*control_dto.TargetNetworkInfo, *control_dto.TargetNetworkInfo, error)

return addr1-stat, addr2-stat

func PingAddr

func PingAddr(addr string, iface string, pingCount int) (*control_dto.TargetNetworkInfo, error)

PingAddr

func PingConsoleAndPops added in v0.1.7

func PingConsoleAndPops(consoleAddr string, pops map[string]control_dto.ClientCacheInfo, pingCount int) (*control_dto.TargetNetworkInfo, map[string]control_dto.TargetNetworkInfo, error)

console and pop

func SumTotalMap added in v0.1.56

func SumTotalMap(stats map[string]*SdpIOCountersStat) *net_stat.IOCountersStat

sum total map

func SumTotalSlices added in v0.1.56

func SumTotalSlices(stats []net_stat.IOCountersStat) *net_stat.IOCountersStat

sum total slice

Types

type ConnectionStat added in v0.1.56

type ConnectionStat = net.ConnectionStat

func GetNetConnections added in v0.1.56

func GetNetConnections() ([]ConnectionStat, error)

获取当前的连接信息

func GetNetConnectionsByIp added in v0.1.56

func GetNetConnectionsByIp(cidr *ip_util.CidrIp) ([]ConnectionStat, error)

type ConntrackStat added in v0.1.56

type ConntrackStat = net.ConntrackStat

func GetNetConntrackStat added in v0.1.56

func GetNetConntrackStat(percpu bool) ([]ConntrackStat, error)

percpu: 是否返回每个CPU的统计信息

type ConntrackStatList added in v0.1.56

type ConntrackStatList = net.ConntrackStatList

type FilterStat added in v0.1.56

type FilterStat = net.FilterStat

func FilterCounters added in v0.1.56

func FilterCounters() ([]FilterStat, error)

type NetStat added in v0.1.56

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

net stat

func NewNetStat added in v0.1.56

func NewNetStat(logger types.ILogger, keepTime time.Duration) *NetStat

初始化

func (*NetStat) First added in v0.1.56

func (ns *NetStat) First() error

call this function when start

func (*NetStat) GetCurrTotal added in v0.1.56

func (ns *NetStat) GetCurrTotal() *SdpIOCountersStat

获取当前的流量信息(curr)

func (*NetStat) GetIfaceCurr added in v0.1.56

func (ns *NetStat) GetIfaceCurr(iface string) *SdpIOCountersStat

获取当前的流量信息(区间)

func (*NetStat) GetIfaceLatest added in v0.1.56

func (ns *NetStat) GetIfaceLatest(iface string) *SdpIOCountersStat

获取最新一次的流量信息(total)

func (*NetStat) GetLatestTotal added in v0.1.56

func (ns *NetStat) GetLatestTotal() *SdpIOCountersStat

获取当前的流量信息(total)

func (*NetStat) Refresh added in v0.1.56

func (ns *NetStat) Refresh() (map[string]*SdpIOCountersStat, error)

返回的是当前时间到上一次的流量,是区间量,比如5分钟内的流量

func (*NetStat) RefreshWithIface added in v0.1.56

func (ns *NetStat) RefreshWithIface(iface string) (map[string]*SdpIOCountersStat, *SdpIOCountersStat, error)

返回的是当前时间到上一次的流量,是区间量,比如5分钟内的流量

func (*NetStat) SetLogger added in v0.1.58

func (s *NetStat) SetLogger(logger types.ILogger)

type SdpIOCountersStat added in v0.1.56

type SdpIOCountersStat struct {
	net_stat.IOCountersStat
	TS time.Time
}

SdpIOCountersStat

Jump to

Keyboard shortcuts

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