mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
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).
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user