Sfoglia il codice sorgente

add hosts to telemetry data

Abhishek Kondur 2 anni fa
parent
commit
cbf718fed3
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      logic/telemetry.go

+ 3 - 0
logic/telemetry.go

@@ -59,6 +59,7 @@ func sendTelemetry() error {
 		Event:      "daily checkin",
 		Properties: posthog.NewProperties().
 			Set("nodes", d.Nodes).
+			Set("hosts", d.Hosts).
 			Set("servers", d.Servers).
 			Set("non-server nodes", d.Count.NonServer).
 			Set("extclients", d.ExtClients).
@@ -83,6 +84,7 @@ func fetchTelemetryData() (telemetryData, error) {
 	data.ExtClients = getDBLength(database.EXT_CLIENT_TABLE_NAME)
 	data.Users = getDBLength(database.USERS_TABLE_NAME)
 	data.Networks = getDBLength(database.NETWORKS_TABLE_NAME)
+	data.Hosts = getDBLength(database.HOSTS_TABLE_NAME)
 	data.Version = servercfg.GetVersion()
 	//data.Servers = GetServerCount()
 	nodes, err := GetAllNodes()
@@ -157,6 +159,7 @@ func getDBLength(dbname string) int {
 // telemetryData - What data to send to posthog
 type telemetryData struct {
 	Nodes      int
+	Hosts      int
 	ExtClients int
 	Users      int
 	Count      clientCount