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

@@ -53,7 +53,7 @@ func New(r *dns.Msg, rr *dnsrecorder.Recorder, emptyValue string) Replacer {
rcode = strconv.Itoa(rr.Rcode)
}
rep.replacements["{rcode}"] = rcode
rep.replacements["{size}"] = strconv.Itoa(rr.Size)
rep.replacements["{size}"] = strconv.Itoa(rr.Len)
rep.replacements["{duration}"] = time.Since(rr.Start).String()
}