You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In connector/docker.go:67 to subscribe to events ctop uses AddEventListener() from fsouza/go-dockerclient.
The problem is that there is a lot of types of events so ctop filters out all except of events with container type:
if e.Type != "container" {
continue
}
In fact docker Monitor Events API has a param filters that can be set to {"type":["container"]} to subscribe only to container events.
If we'll use then we may improve performance and remove the if e.Type != "container" { continue } line.
The problem is that the fsouza/go-dockerclient doesn't have a binding to filter param. We can create a PR but the go-dockerclient package seems obsolete and "was created before Docker had an official Go SDK. For new projects, using the official SDK is probably more appropriate as go-dockerclient lags behind the official SDK".
The official Docker Go SDK already supports the filters param:
So what do you think about to migrate to Official Docker SDK? If we migrate then we can the filters param.
As far I see ctop uses only few API calls and can be easily migrated to Official SDK but maybe I don't know something.
The text was updated successfully, but these errors were encountered:
stokito
added a commit
to stokito/ctop
that referenced
this issue
Nov 19, 2020
In connector/docker.go:67 to subscribe to events ctop uses
AddEventListener()
from fsouza/go-dockerclient.The problem is that there is a lot of types of events so ctop filters out all except of events with
container
type:In fact docker Monitor Events API has a param
filters
that can be set to{"type":["container"]}
to subscribe only to container events.If we'll use then we may improve performance and remove the
if e.Type != "container" { continue }
line.The problem is that the fsouza/go-dockerclient doesn't have a binding to filter param. We can create a PR but the
go-dockerclient
package seems obsolete and "was created before Docker had an official Go SDK. For new projects, using the official SDK is probably more appropriate as go-dockerclient lags behind the official SDK".The official Docker Go SDK already supports the
filters
param:So what do you think about to migrate to Official Docker SDK? If we migrate then we can the
filters
param.As far I see ctop uses only few API calls and can be easily migrated to Official SDK but maybe I don't know something.
The text was updated successfully, but these errors were encountered: