浏览代码

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 8 年之前
父节点
当前提交
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 {