소스 검색

proxy: don't inc a cache miss count in a case of linearizable range

Requests of linearizable range don't touch the cache of grpcproxy. So
incrementing the miss count wouldn't be meaningful.
Hitoshi Mitake 9 년 전
부모
커밋
488df4db34
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      proxy/grpcproxy/kv.go

+ 2 - 1
proxy/grpcproxy/kv.go

@@ -48,8 +48,9 @@ func (p *kvProxy) Range(ctx context.Context, r *pb.RangeRequest) (*pb.RangeRespo
 			cacheHits.Inc()
 			cacheHits.Inc()
 			return nil, err
 			return nil, err
 		}
 		}
+
+		cachedMisses.Inc()
 	}
 	}
-	cachedMisses.Inc()
 
 
 	resp, err := p.kv.Do(ctx, RangeRequestToOp(r))
 	resp, err := p.kv.Do(ctx, RangeRequestToOp(r))
 	if err != nil {
 	if err != nil {