events handling: early skipping of extremely frequent exec_* events

The exec_create, exec_start, exec_die and other events are generated by health checks
This commit is contained in:
Sergey Ponomarev 2020-11-18 23:03:48 +02:00
parent 009201ed0c
commit ba126e6e7c

View File

@ -87,7 +87,11 @@ func (cm *Docker) watchEvents() {
} }
actionName := e.Action actionName := e.Action
// Action may have additional param: "exec_create: redis-cli ping" or "health_status: healthy" // fast skip all exec_* events: exec_create, exec_start, exec_die
if strings.HasPrefix(actionName, "exec_") {
continue
}
// Action may have additional param i.e. "health_status: healthy"
// We need to strip to have only action name // We need to strip to have only action name
sepIdx := strings.Index(actionName, ": ") sepIdx := strings.Index(actionName, ": ")
if sepIdx != -1 { if sepIdx != -1 {