diff options
author | 2016-11-29 11:02:43 +0000 | |
---|---|---|
committer | 2016-11-29 11:02:43 +0000 | |
commit | 8c8b37a30ea400603c9cb381cc9b71c4da93a536 (patch) | |
tree | ec6d2b430c89e082f12cde34b97b10db890879e7 /request | |
parent | 4cfd19c7c97490dac47cd748166ec3f976e315aa (diff) | |
download | coredns-8c8b37a30ea400603c9cb381cc9b71c4da93a536.tar.gz coredns-8c8b37a30ea400603c9cb381cc9b71c4da93a536.tar.zst coredns-8c8b37a30ea400603c9cb381cc9b71c4da93a536.zip |
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).
Diffstat (limited to 'request')
-rw-r--r-- | request/request.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |