File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ func (c *customPluginMonitor) Stop() {
120
120
}
121
121
122
122
// 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.
123
125
func (c * customPluginMonitor ) monitorLoop () {
124
126
if ! * c .config .PluginGlobalConfig .SkipInitialStatus {
125
127
c .initializeStatus ()
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ func (p *Plugin) runRules() {
93
93
glog .V (3 ).Info ("Start to run custom plugins" )
94
94
95
95
for _ , rule := range p .config .Rules {
96
+ // syncChan limits concurrent goroutines to configured PluginGlobalConfig.Concurrency value
96
97
p .syncChan <- struct {}{}
97
98
p .Add (1 )
98
99
go func (rule * cpmtypes.CustomRule ) {
@@ -116,6 +117,7 @@ func (p *Plugin) runRules() {
116
117
Message : message ,
117
118
}
118
119
120
+ // pipes result into resultChan which customPluginMonitor instance generates status from
119
121
p .resultChan <- result
120
122
121
123
// Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.
You can’t perform that action at this time.
0 commit comments