Skip to content

Commit

Permalink
clear client stats
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Apr 25, 2017
1 parent 4402ebf commit 18c603c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions grpclb.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func (b *balancer) processServerList(l *lbpb.ServerList, seq int) {
}

func (b *balancer) sendLoadReport(s *balanceLoadClientStream, interval time.Duration, done <-chan struct{}) {
b.clientStats = lbpb.ClientStats{} // Clear client stats.
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
Expand Down
2 changes: 1 addition & 1 deletion grpclb/grpclb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ func TestGRPCLBStatsStreaming(t *testing.T) {
}
cc.Close()

time.Sleep(1 * time.Second)
time.Sleep(3 * time.Second)
if tss.ls.stats.NumCallsStarted != int64(countNormalRPC+countFailedToSend) {
t.Errorf("num calls started = %v, want %v+%v", tss.ls.stats.NumCallsStarted, countNormalRPC, countFailedToSend)
}
Expand Down

0 comments on commit 18c603c

Please sign in to comment.