From 8c8b37a30ea400603c9cb381cc9b71c4da93a536 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 29 Nov 2016 11:02:43 +0000 Subject: middleware/metrics: export actual size (#448) The `*_size*` metrics now export the actual packet length, not the advertised one (although that might be nice as well). --- request/request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'request/request.go') diff --git a/request/request.go b/request/request.go index b5da38771..00388caca 100644 --- a/request/request.go +++ b/request/request.go @@ -106,7 +106,10 @@ func (r *Request) Do() bool { return false } -// Size returns if UDP buffer size advertised in the requests OPT record. +// Len returns the length in bytes in the request. +func (r *Request) Len() int { return r.Req.Len() } + +// Size returns if buffer size *advertised* in the requests OPT record. // Or when the request was over TCP, we return the maximum allowed size of 64K. func (r *Request) Size() int { if r.size != 0 { -- cgit v1.2.3