Documentation
¶
Index ¶
- func GetHostInfo() (*control_dto.HostInfo, error)
- func GetPopsAddrs(pops map[string]control_dto.ClientCacheInfo) (ret []string)
- func Ping2Addrs(addr1 string, addr2 string, pingCount int) (*control_dto.TargetNetworkInfo, *control_dto.TargetNetworkInfo, error)
- func PingAddr(addr string, iface string, pingCount int) (*control_dto.TargetNetworkInfo, error)
- func PingConsoleAndPops(consoleAddr string, pops map[string]control_dto.ClientCacheInfo, pingCount int) (*control_dto.TargetNetworkInfo, map[string]control_dto.TargetNetworkInfo, ...)
- func SumTotalMap(stats map[string]*SdpIOCountersStat) *net_stat.IOCountersStat
- func SumTotalSlices(stats []net_stat.IOCountersStat) *net_stat.IOCountersStat
- type ConnectionStat
- type ConntrackStat
- type ConntrackStatList
- type FilterStat
- type NetStat
- func (ns *NetStat) First() error
- func (ns *NetStat) GetCurrTotal() *SdpIOCountersStat
- func (ns *NetStat) GetIfaceCurr(iface string) *SdpIOCountersStat
- func (ns *NetStat) GetIfaceLatest(iface string) *SdpIOCountersStat
- func (ns *NetStat) GetLatestTotal() *SdpIOCountersStat
- func (ns *NetStat) Refresh() (map[string]*SdpIOCountersStat, error)
- func (ns *NetStat) RefreshWithIface(iface string) (map[string]*SdpIOCountersStat, *SdpIOCountersStat, error)
- func (s *NetStat) SetLogger(logger types.ILogger)
- type SdpIOCountersStat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*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分钟内的流量
type SdpIOCountersStat ¶ added in v0.1.56
type SdpIOCountersStat struct {
net_stat.IOCountersStat
TS time.Time
}
SdpIOCountersStat
Click to show internal directories.
Click to hide internal directories.