소스 검색

debug query time

Chris Bannister 10 년 전
부모
커밋
56f17ddc42
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      conn.go

+ 2 - 0
conn.go

@@ -376,6 +376,7 @@ func (c *Conn) handleTimeout() {
 
 func (c *Conn) exec(req frameWriter, tracer Tracer) (frame, error) {
 	// TODO: move tracer onto conn
+	start := time.Now()
 	stream := <-c.uniq
 
 	call := &c.calls[stream]
@@ -407,6 +408,7 @@ func (c *Conn) exec(req frameWriter, tracer Tracer) (frame, error) {
 		}
 	case <-time.After(c.timeout):
 		c.handleTimeout()
+		log.Printf("querytime=%v\n", time.Now().Sub(start))
 		return nil, ErrTimeoutNoResponse
 	}