Explorar o código

Report versioning usage in usage report

I consider it a bug that we didn't already and that this is covered
already under the agreement that we report which features are in use.
Jakob Borg %!s(int64=10) %!d(string=hai) anos
pai
achega
e11302172e
Modificáronse 1 ficheiros con 11 adicións e 4 borrados
  1. 11 4
      cmd/syncthing/usage_report.go

+ 11 - 4
cmd/syncthing/usage_report.go

@@ -121,10 +121,14 @@ func reportData(cfg *config.Wrapper, m *model.Model) map[string]interface{} {
 
 	var rescanIntvs []int
 	folderUses := map[string]int{
-		"readonly":      0,
-		"ignorePerms":   0,
-		"ignoreDelete":  0,
-		"autoNormalize": 0,
+		"readonly":            0,
+		"ignorePerms":         0,
+		"ignoreDelete":        0,
+		"autoNormalize":       0,
+		"simpleVersioning":    0,
+		"externalVersioning":  0,
+		"staggeredVersioning": 0,
+		"trashcanVersioning":  0,
 	}
 	for _, cfg := range cfg.Folders() {
 		rescanIntvs = append(rescanIntvs, cfg.RescanIntervalS)
@@ -141,6 +145,9 @@ func reportData(cfg *config.Wrapper, m *model.Model) map[string]interface{} {
 		if cfg.AutoNormalize {
 			folderUses["autoNormalize"]++
 		}
+		if cfg.Versioning.Type != "" {
+			folderUses[cfg.Versioning.Type+"Versioning"]++
+		}
 	}
 	sort.Ints(rescanIntvs)
 	res["rescanIntvs"] = rescanIntvs