Ver Fonte

Fix: double counting in server_load "ALL" fields
- was incorrectly adding both "ALL" and per region
values for each tunnel protocol

Rod Hynes há 9 anos atrás
pai
commit
1c4c956718
1 ficheiros alterados com 3 adições e 5 exclusões
  1. 3 5
      psiphon/server/tunnelServer.go

+ 3 - 5
psiphon/server/tunnelServer.go

@@ -540,11 +540,9 @@ func (sshServer *sshServer) getLoadStats() map[string]interface{} {
 	allProtocolsStats["tcp_port_forward_failed_count"] = aggregatedQualityMetrics.tcpPortForwardFailedCount
 	allProtocolsStats["tcp_port_forward_failed_duration"] = int64(aggregatedQualityMetrics.tcpPortForwardFailedDuration)
 
-	for _, regionStats := range protocolStats {
-		for _, stats := range regionStats {
-			for name, value := range stats {
-				allProtocolsStats[name] += value
-			}
+	for _, stats := range protocolStats {
+		for name, value := range stats["ALL"] {
+			allProtocolsStats[name] += value
 		}
 	}