Browse Source

Merge pull request #231 from rod-hynes/master

Include all-protocol totals in "load" log messge
Rod Hynes 9 năm trước cách đây
mục cha
commit
869a9e8fb0
1 tập tin đã thay đổi với 11 bổ sung0 xóa
  1. 11 0
      psiphon/server/tunnelServer.go

+ 11 - 0
psiphon/server/tunnelServer.go

@@ -385,6 +385,17 @@ func (sshServer *sshServer) getLoadStats() map[string]map[string]int64 {
 		client.Unlock()
 	}
 
+	// Calculate and report totals across all protocols. It's easier to do this here
+	// than futher down the stats stack. Also useful for glancing at log files.
+
+	allProtocolsStats := make(map[string]int64)
+	for _, stats := range loadStats {
+		for name, value := range stats {
+			allProtocolsStats[name] += value
+		}
+	}
+	loadStats["ALL"] = allProtocolsStats
+
 	return loadStats
 }