File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
bin /
2
+ .idea /
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
16
16
"github.com/gianarb/orbiter/api"
17
17
"github.com/gianarb/orbiter/autoscaler"
18
18
"github.com/gianarb/orbiter/core"
19
+ "github.com/pkg/profile"
19
20
"time"
20
21
)
21
22
@@ -24,6 +25,10 @@ type DaemonCmd struct {
24
25
}
25
26
26
27
func (c * DaemonCmd ) Run (args []string ) int {
28
+
29
+ var prof interface {
30
+ Stop ()
31
+ }
27
32
logrus .Info ("orbiter started" )
28
33
var port string
29
34
var configPath string
@@ -39,6 +44,9 @@ func (c *DaemonCmd) Run(args []string) int {
39
44
if debug == true {
40
45
logrus .SetLevel (logrus .DebugLevel )
41
46
logrus .Debug ("Daemon started in debug mode" )
47
+
48
+ prof = profile .Start (profile .CPUProfile , profile .NoShutdownHook )
49
+
42
50
}
43
51
coreEngine := core.Core {
44
52
Autoscalers : autoscaler.Autoscalers {},
@@ -75,6 +83,9 @@ func (c *DaemonCmd) Run(args []string) int {
75
83
<- sigchan
76
84
timer1 .Stop ()
77
85
logrus .Info ("Stopping and cleaning. Bye!" )
86
+ if logrus .GetLevel () == logrus .DebugLevel {
87
+ prof .Stop ()
88
+ }
78
89
os .Exit (0 )
79
90
}()
80
91
You can’t perform that action at this time.
0 commit comments