Merge pull request #723 from jason1028kr/jasonjung/add-comments

add few comments for custom plugin monitor
This commit is contained in:
Kubernetes Prow Robot
2023-01-31 10:06:48 -08:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -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()

View File

@@ -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.