summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/diagnostics.go54
-rw-r--r--app/diagnostics_test.go1
2 files changed, 54 insertions, 1 deletions
diff --git a/app/diagnostics.go b/app/diagnostics.go
index c0499bd89..4974d6444 100644
--- a/app/diagnostics.go
+++ b/app/diagnostics.go
@@ -47,6 +47,7 @@ const (
TRACK_ACTIVITY = "activity"
TRACK_LICENSE = "license"
TRACK_SERVER = "server"
+ TRACK_PLUGINS = "plugins"
)
var client *analytics.Client
@@ -57,6 +58,7 @@ func (a *App) SendDailyDiagnostics() {
a.trackActivity()
a.trackConfig()
trackLicense()
+ a.trackPlugins()
a.trackServer()
}
}
@@ -445,7 +447,9 @@ func (a *App) trackConfig() {
})
SendDiagnostic(TRACK_CONFIG_PLUGIN, map[string]interface{}{
- "enable_jira": pluginSetting(&cfg.PluginSettings, "jira", "enabled", false),
+ "enable_jira": pluginSetting(&cfg.PluginSettings, "jira", "enabled", false),
+ "enable": *utils.Cfg.PluginSettings.Enable,
+ "enable_uploads": *utils.Cfg.PluginSettings.EnableUploads,
})
SendDiagnostic(TRACK_CONFIG_DATA_RETENTION, map[string]interface{}{
@@ -477,6 +481,54 @@ func trackLicense() {
}
}
+func (a *App) trackPlugins() {
+ if *a.Config().PluginSettings.Enable {
+ totalActiveCount := -1 // -1 to indicate disabled or error
+ webappActiveCount := 0
+ backendActiveCount := 0
+ totalInactiveCount := -1 // -1 to indicate disabled or error
+ webappInactiveCount := 0
+ backendInactiveCount := 0
+
+ plugins, _ := a.GetPluginManifests()
+
+ if plugins != nil {
+ totalActiveCount = len(plugins.Active)
+
+ for _, plugin := range plugins.Active {
+ if plugin.Webapp != nil {
+ webappActiveCount += 1
+ }
+
+ if plugin.Backend != nil {
+ backendActiveCount += 1
+ }
+ }
+
+ totalInactiveCount = len(plugins.Inactive)
+
+ for _, plugin := range plugins.Inactive {
+ if plugin.Webapp != nil {
+ webappInactiveCount += 1
+ }
+
+ if plugin.Backend != nil {
+ backendInactiveCount += 1
+ }
+ }
+ }
+
+ SendDiagnostic(TRACK_PLUGINS, map[string]interface{}{
+ "active_plugins": totalActiveCount,
+ "active_webapp_plugins": webappActiveCount,
+ "active_backend_plugins": backendActiveCount,
+ "inactive_plugins": totalInactiveCount,
+ "inactive_webapp_plugins": webappInactiveCount,
+ "inactive_backend_plugins": backendInactiveCount,
+ })
+ }
+}
+
func (a *App) trackServer() {
data := map[string]interface{}{
"edition": model.BuildEnterpriseReady,
diff --git a/app/diagnostics_test.go b/app/diagnostics_test.go
index 842322e9c..47a5d8a27 100644
--- a/app/diagnostics_test.go
+++ b/app/diagnostics_test.go
@@ -135,6 +135,7 @@ func TestDiagnostics(t *testing.T) {
TRACK_CONFIG_PLUGIN,
TRACK_ACTIVITY,
TRACK_SERVER,
+ TRACK_PLUGINS,
} {
if !strings.Contains(info, item) {
t.Fatal("Sent diagnostics missing item: " + item)