Jelajahi Sumber

debug query time

Chris Bannister 10 tahun lalu
induk
melakukan
56f17ddc42
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  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) {
 func (c *Conn) exec(req frameWriter, tracer Tracer) (frame, error) {
 	// TODO: move tracer onto conn
 	// TODO: move tracer onto conn
+	start := time.Now()
 	stream := <-c.uniq
 	stream := <-c.uniq
 
 
 	call := &c.calls[stream]
 	call := &c.calls[stream]
@@ -407,6 +408,7 @@ func (c *Conn) exec(req frameWriter, tracer Tracer) (frame, error) {
 		}
 		}
 	case <-time.After(c.timeout):
 	case <-time.After(c.timeout):
 		c.handleTimeout()
 		c.handleTimeout()
+		log.Printf("querytime=%v\n", time.Now().Sub(start))
 		return nil, ErrTimeoutNoResponse
 		return nil, ErrTimeoutNoResponse
 	}
 	}