Skip to content

Commit 72049d0

Browse files
committed
dnsx/transport: when in debug, record total time as latency
1 parent 1fef47b commit 72049d0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

intra/dnsx/transport.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,8 @@ func (r *resolver) forward(q []byte, who, fid, uid string, chosenids ...string)
602602
// TODO? do not use defer func() and do copy: go.dev/play/p/oGUJepa3VUo
603603
defer func() {
604604
if settings.Debug {
605-
smm.Extra = smm.Extra + " / " + core.FmtTimeAsPeriod(starttime)
605+
smm.Extra = smm.Extra + " / " + core.FmtSecsFloat(smm.Latency)
606+
smm.Latency = time.Since(starttime).Seconds()
606607
}
607608
r.queueSummary(smm) // always call up to the listener
608609
}()

0 commit comments

Comments
 (0)