瀏覽代碼

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
 	}