Commit 2c9c45f3 authored by Matt Joiner's avatar Matt Joiner
Browse files

Try adding a pprof label to invocation of transactionQuerySender

parent e75595a7
......@@ -7,6 +7,7 @@ import (
"fmt"
"io"
"net"
"runtime/pprof"
"text/tabwriter"
"time"
......@@ -724,7 +725,9 @@ func (s *Server) queryContext(ctx context.Context, addr Addr, q string, a *krpc.
sendErr := make(chan error, 1)
sendCtx, cancelSend := context.WithCancel(ctx)
defer cancelSend()
go s.transactionQuerySender(sendCtx, sendErr, s.makeQueryBytes(q, a, tid), &writes, addr)
go pprof.Do(sendCtx, pprof.Labels("q", q), func(ctx context.Context) {
s.transactionQuerySender(ctx, sendErr, s.makeQueryBytes(q, a, tid), &writes, addr)
})
expvars.Add(fmt.Sprintf("outbound %s queries", q), 1)
select {
case reply = <-replyChan:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment