forked from didi/falcon-log-agent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
31 lines (23 loc) · 683 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"github.com/didi/falcon-log-agent/http"
"github.com/didi/falcon-log-agent/common/proc/metric"
"github.com/didi/falcon-log-agent/common/proc/patrol"
"github.com/didi/falcon-log-agent/common/utils"
"github.com/didi/falcon-log-agent/common/dlog"
"github.com/didi/falcon-log-agent/common/g"
"github.com/didi/falcon-log-agent/worker"
"runtime"
)
func main() {
g.InitAll()
defer g.CloseLog()
maxCoreNum := utils.GetCPULimitNum(g.Conf().MaxCPURate)
dlog.Infof("bind [%d] cpu core", maxCoreNum)
runtime.GOMAXPROCS(maxCoreNum)
go metric.MetricLoop(60)
go worker.UpdateConfigsLoop()
go patrol.PatrolLoop()
go worker.PusherStart()
http.Start()
}