From 2fa98cd01e0d83fbc5fb741688d3d8e8cc78c758 Mon Sep 17 00:00:00 2001 From: zgat <1071107108@qq.com> Date: Sat, 9 May 2020 13:51:33 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20=E7=BA=A0=E6=AD=A3latency=E6=8B=BC?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/net/rpc/warden/balancer/wrr/wrr.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/net/rpc/warden/balancer/wrr/wrr.go b/pkg/net/rpc/warden/balancer/wrr/wrr.go index 22fd2adca..7e3477bbc 100644 --- a/pkg/net/rpc/warden/balancer/wrr/wrr.go +++ b/pkg/net/rpc/warden/balancer/wrr/wrr.go @@ -98,7 +98,7 @@ type statistics struct { ewt int64 cs float64 ss float64 - lantency float64 + latency float64 cpu float64 req int64 } @@ -273,7 +273,7 @@ func (p *wrrPicker) pick(ctx context.Context, opts balancer.PickInfo) (balancer. cs = 0.2 } conn.score = math.Sqrt((cs * ss * ss * 1e9) / (lagv * cpu)) - stats[i] = statistics{cs: cs, ss: ss, lantency: lagv, cpu: cpu, req: req} + stats[i] = statistics{cs: cs, ss: ss, latency: lagv, cpu: cpu, req: req} } stats[i].addr = conn.addr.Addr