Skip to content

Commit d1c8a8b

Browse files
authored
Merge pull request #723 from jason1028kr/jasonjung/add-comments
add few comments for custom plugin monitor
2 parents 80fc2c2 + cc6c049 commit d1c8a8b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/custompluginmonitor/custom_plugin_monitor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ func (c *customPluginMonitor) Stop() {
120120
}
121121

122122
// monitorLoop is the main loop of customPluginMonitor.
123+
// there is one customPluginMonitor, one plugin instance for each configPath.
124+
// each runs rules in parallel at pre-configured concurrency, and interval.
123125
func (c *customPluginMonitor) monitorLoop() {
124126
if !*c.config.PluginGlobalConfig.SkipInitialStatus {
125127
c.initializeStatus()

pkg/custompluginmonitor/plugin/plugin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (p *Plugin) runRules() {
9393
glog.V(3).Info("Start to run custom plugins")
9494

9595
for _, rule := range p.config.Rules {
96+
// syncChan limits concurrent goroutines to configured PluginGlobalConfig.Concurrency value
9697
p.syncChan <- struct{}{}
9798
p.Add(1)
9899
go func(rule *cpmtypes.CustomRule) {
@@ -116,6 +117,7 @@ func (p *Plugin) runRules() {
116117
Message: message,
117118
}
118119

120+
// pipes result into resultChan which customPluginMonitor instance generates status from
119121
p.resultChan <- result
120122

121123
// Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.

0 commit comments

Comments
 (0)