@@ -54,7 +54,7 @@ type plug struct {
5454}
5555
5656func (p * plug ) Shutdown () {
57- pi .Log .Infof ("%s: Shutdown" , p .name )
57+ pi .Log .Debugf ("%s: Shutdown" , p .name )
5858 p .gateState .flushPile ()
5959}
6060
@@ -124,8 +124,7 @@ func (p *plug) guardMainEventLoop(ctx context.Context) {
124124 p .reportPileTicker .Stop ()
125125 p .podMonitorTicker .Stop ()
126126 p .gateState .flushPile ()
127- pi .Log .Infof ("Statistics: %s" , p .gateState .stat .Log ())
128- pi .Log .Infof ("%s Done!" , plugName )
127+ pi .Log .Infof ("%s: Done with the following statistics: %s" , plugName , p .gateState .stat .Log ())
129128 }()
130129
131130 for {
@@ -151,6 +150,7 @@ func (p *plug) guardMainEventLoop(ctx context.Context) {
151150func (p * plug ) preInit (ctx context.Context , c map [string ]string , sid string , ns string , logger pi.Logger ) (context.Context , context.CancelFunc ) {
152151 var ok bool
153152 var v string
153+ var loadInterval , pileInterval , monitorInterval string
154154
155155 ctx , cancelFunction := context .WithCancel (ctx )
156156
@@ -176,21 +176,22 @@ func (p *plug) preInit(ctx context.Context, c map[string]string, sid string, ns
176176 if v , ok = c ["monitor-pod" ]; ok && ! strings .EqualFold (v , "true" ) {
177177 monitorPod = false
178178 }
179- p .guardianLoadTicker = utils .NewTicker (utils .MinimumInterval )
180- p .reportPileTicker = utils .NewTicker (utils .MinimumInterval )
181- p .podMonitorTicker = utils .NewTicker (utils .MinimumInterval )
182- p .guardianLoadTicker .Parse (c ["guardian-load-interval" ], guardianLoadIntervalDefault )
183- p .reportPileTicker .Parse (c ["report-pile-interval" ], reportPileIntervalDefault )
184- p .podMonitorTicker .Parse (c ["pod-monitor-interval" ], podMonitorIntervalDefault )
185-
186- pi .Log .Debugf ("guard-gate configuration: sid=%s, ns=%s, useCm=%t, guardUrl=%s, p.monitorPod=%t, guardian-load-interval %v, report-pile-interval %v, pod-monitor-interval %v" ,
187- sid , ns , useCm , guardServiceUrl , monitorPod , c ["guardian-load-interval" ], c ["report-pile-interval" ], c ["pod-monitor-interval" ])
188- } else {
189- p .guardianLoadTicker .Parse ("" , guardianLoadIntervalDefault )
190- p .reportPileTicker .Parse ("" , reportPileIntervalDefault )
191- p .podMonitorTicker .Parse ("" , podMonitorIntervalDefault )
179+ loadInterval = c ["guardian-load-interval" ]
180+ pileInterval = c ["report-pile-interval" ]
181+ monitorInterval = c ["pod-monitor-interval" ]
192182 }
193183
184+ p .guardianLoadTicker = utils .NewTicker (utils .MinimumInterval )
185+ p .reportPileTicker = utils .NewTicker (utils .MinimumInterval )
186+ p .podMonitorTicker = utils .NewTicker (utils .MinimumInterval )
187+
188+ p .guardianLoadTicker .Parse (loadInterval , guardianLoadIntervalDefault )
189+ p .reportPileTicker .Parse (pileInterval , reportPileIntervalDefault )
190+ p .podMonitorTicker .Parse (monitorInterval , podMonitorIntervalDefault )
191+
192+ pi .Log .Debugf ("guard-gate configuration: sid=%s, ns=%s, useCm=%t, guardUrl=%s, p.monitorPod=%t, guardian-load-interval %v, report-pile-interval %v, pod-monitor-interval %v" ,
193+ sid , ns , useCm , guardServiceUrl , monitorPod , loadInterval , pileInterval , monitorInterval )
194+
194195 // serviceName should never be "ns.{namespace}" as this is a reserved name
195196 if strings .HasPrefix (sid , "ns." ) {
196197 // mandatory
@@ -199,7 +200,6 @@ func (p *plug) preInit(ctx context.Context, c map[string]string, sid string, ns
199200
200201 p .gateState = new (gateState )
201202 p .gateState .init (cancelFunction , monitorPod , guardServiceUrl , sid , ns , useCm )
202- pi .Log .Infof ("guardServiceUrl %s" , guardServiceUrl )
203203 return ctx , cancelFunction
204204}
205205
0 commit comments