mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-03-03 10:10:52 +00:00
Merge pull request #723 from jason1028kr/jasonjung/add-comments
add few comments for custom plugin monitor
This commit is contained in:
@@ -120,6 +120,8 @@ func (c *customPluginMonitor) Stop() {
|
||||
}
|
||||
|
||||
// monitorLoop is the main loop of customPluginMonitor.
|
||||
// there is one customPluginMonitor, one plugin instance for each configPath.
|
||||
// each runs rules in parallel at pre-configured concurrency, and interval.
|
||||
func (c *customPluginMonitor) monitorLoop() {
|
||||
if !*c.config.PluginGlobalConfig.SkipInitialStatus {
|
||||
c.initializeStatus()
|
||||
|
||||
@@ -93,6 +93,7 @@ func (p *Plugin) runRules() {
|
||||
glog.V(3).Info("Start to run custom plugins")
|
||||
|
||||
for _, rule := range p.config.Rules {
|
||||
// syncChan limits concurrent goroutines to configured PluginGlobalConfig.Concurrency value
|
||||
p.syncChan <- struct{}{}
|
||||
p.Add(1)
|
||||
go func(rule *cpmtypes.CustomRule) {
|
||||
@@ -116,6 +117,7 @@ func (p *Plugin) runRules() {
|
||||
Message: message,
|
||||
}
|
||||
|
||||
// pipes result into resultChan which customPluginMonitor instance generates status from
|
||||
p.resultChan <- result
|
||||
|
||||
// Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.
|
||||
|
||||
Reference in New Issue
Block a user