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:
Miek Gieben
2016-11-29 11:02:43 +00:00
committed by GitHub
parent 4cfd19c7c9
commit 8c8b37a30e
5 changed files with 12 additions and 9 deletions

View File

@@ -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 {