mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-26 15:16:27 +01:00
feat!: implements swarm mode with agents (#3058)
This commit is contained in:
28
internal/support/cli/analytics.go
Normal file
28
internal/support/cli/analytics.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/amir20/dozzle/internal/analytics"
|
||||
"github.com/amir20/dozzle/internal/docker"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func StartEvent(version string, mode string, agents []string, remoteClients []string, client docker.Client) {
|
||||
event := analytics.BeaconEvent{
|
||||
Name: "start",
|
||||
Version: version,
|
||||
Mode: mode,
|
||||
RemoteAgents: len(agents),
|
||||
RemoteClients: len(remoteClients),
|
||||
}
|
||||
|
||||
if client != nil {
|
||||
event.ServerID = client.SystemInfo().ID
|
||||
event.ServerVersion = client.SystemInfo().ServerVersion
|
||||
} else {
|
||||
event.ServerID = "n/a"
|
||||
}
|
||||
|
||||
if err := analytics.SendBeacon(event); err != nil {
|
||||
log.Debug(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user