对服务增加基础的数据统计

This commit is contained in:
GoEdgeLab
2021-01-25 16:40:31 +08:00
parent 5eef6ac267
commit f16d07c43f
11 changed files with 354 additions and 28 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/TeaOSLab/EdgeNode/internal/iplibrary"
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
"github.com/TeaOSLab/EdgeNode/internal/rpc"
"github.com/TeaOSLab/EdgeNode/internal/stats"
"github.com/TeaOSLab/EdgeNode/internal/utils"
"github.com/go-yaml/yaml"
"github.com/iwind/TeaGo/Tea"
@@ -121,6 +122,12 @@ func (this *Node) Start() {
// 连接API
go NewAPIStream().Start()
// 统计
go stats.SharedTrafficStatManager.Start(func() *nodeconfigs.NodeConfig {
return sharedNodeConfig
})
go stats.SharedHTTPRequestStatManager.Start()
// 启动端口
err = sharedListenerManager.Start(nodeConfig)
if err != nil {