From 6b36b65687e606e5913708c4259e107f8559abda Mon Sep 17 00:00:00 2001 From: shaquilleq Date: Mon, 27 Jul 2020 13:39:36 -0700 Subject: [PATCH] internal/teeproxy: fix metrics being recorded in ns instead of ms Change-Id: Iebba0d9ab510aa2391d0dcb1c2043e10149c5a7c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/245097 Reviewed-by: Julie Qiu --- internal/teeproxy/teeproxy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/teeproxy/teeproxy.go b/internal/teeproxy/teeproxy.go index 7165e17d..3760277a 100644 --- a/internal/teeproxy/teeproxy.go +++ b/internal/teeproxy/teeproxy.go @@ -378,8 +378,8 @@ func (s *Server) makePkgGoDevRequest(ctx context.Context, redirectHost, redirect // recordTeeProxyMetric records the latencies and counts of requests from // godoc.org and to pkg.go.dev, tagged with the response status code. func recordTeeProxyMetric(status int, host string, gddoLatency, pkgGoDevLatency time.Duration) { - gddoL := gddoLatency.Seconds() / 1000 - pkgGoDevL := pkgGoDevLatency.Seconds() / 1000 + gddoL := gddoLatency.Seconds() * 1000 + pkgGoDevL := pkgGoDevLatency.Seconds() * 1000 stats.RecordWithTags(context.Background(), []tag.Mutator{ tag.Upsert(keyTeeproxyStatus, strconv.Itoa(status)),