Measure RTT for network queries
This commit is contained in:
parent
d1ad3d7086
commit
c84ed33697
|
@ -172,6 +172,7 @@
|
|||
s
|
||||
(udp-address server-host-name server-port)))
|
||||
(define subscription-id (list s (dns-message-id query)))
|
||||
(define start-time (current-inexact-milliseconds))
|
||||
(list (send-message req)
|
||||
(send-message (set-timer subscription-id (* timeout 1000) #t))
|
||||
(subscribe subscription-id
|
||||
|
@ -183,6 +184,9 @@
|
|||
(k 'no-answer))]
|
||||
[(dns-reply reply-message source (== s))
|
||||
;; TODO: maybe receive only specifically from the queried IP address?
|
||||
(write `(,q --> ,(dns-message-answers reply-message) from ,server-ip in
|
||||
,(inexact->exact (round (- (current-inexact-milliseconds) start-time)))
|
||||
ms)) (newline)
|
||||
(if (not (= (dns-message-id reply-message) (dns-message-id query)))
|
||||
w
|
||||
(transition w
|
||||
|
|
Loading…
Reference in New Issue