MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Start

Method Start

internal/stats/bandwidth_stat_manager.go:91–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91func (this *BandwidthStatManager) Start() {
92 // 初始化DAU统计
93 {
94 err := SharedDAUManager.Init()
95 if err != nil {
96 remotelogs.Error("DAU_MANAGER", "initialize DAU manager failed: "+err.Error())
97 }
98 }
99
100 // 从上次数据中恢复
101 this.locker.Lock()
102 this.recover()
103 this.locker.Unlock()
104
105 // 循环上报数据
106 for range this.ticker.C {
107 err := this.Loop()
108 if err != nil && !rpc.IsConnError(err) {
109 remotelogs.Error("BANDWIDTH_STAT_MANAGER", err.Error())
110 }
111 }
112}
113
114func (this *BandwidthStatManager) Loop() error {
115 var regionId int64

Callers

nothing calls this directly

Calls 8

recoverMethod · 0.95
LoopMethod · 0.95
ErrorFunction · 0.92
IsConnErrorFunction · 0.92
InitMethod · 0.65
ErrorMethod · 0.45
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected