optimize: 优化自动更新相关代码

This commit is contained in:
Akkia
2022-04-12 17:43:57 +08:00
committed by Akkia
parent c65028188c
commit e1ca2d5a1c
4 changed files with 26 additions and 20 deletions

View File

@@ -37,6 +37,7 @@ var (
cachedBootTime time.Time
)
// GetHost 获取主机硬件信息
func GetHost(agentConfig *model.AgentConfig) *model.Host {
hi, _ := host.Info()
var cpuType string
@@ -155,6 +156,7 @@ func GetState(agentConfig *model.AgentConfig, skipConnectionCount bool, skipProc
}
}
// TrackNetworkSpeed NIC监控统计流量与速度
func TrackNetworkSpeed(agentConfig *model.AgentConfig) {
var innerNetInTransfer, innerNetOutTransfer uint64
nc, err := net.IOCounters(true)

View File

@@ -51,6 +51,7 @@ var (
httpClientV6 = utils.NewSingleStackHTTPClient(time.Second*20, time.Second*5, time.Second*10, true)
)
// UpdateIP 每30分钟汇报一次IP地址信息
func UpdateIP() {
for {
ipv4 := fetchGeoIP(geoIPApiList, false)