diff --git a/probes/dns/dns.go b/probes/dns/dns.go index 8d9036d7..1294c0a0 100644 --- a/probes/dns/dns.go +++ b/probes/dns/dns.go @@ -26,7 +26,6 @@ package dns import ( "context" "errors" - "fmt" "net" "sync" "time" @@ -83,16 +82,9 @@ type probeRunResult struct { } func newProbeRunResult(target string) probeRunResult { - prr := probeRunResult{ + return probeRunResult{ target: target, } - // Borgmon and friends expect results to be in milliseconds. We should - // change expectations at the Borgmon end once the transition to the new - // metrics model is complete. - prr.rtt.Str = func(i int64) string { - return fmt.Sprintf("%.3f", float64(i)/1000) - } - return prr } // Metrics converts probeRunResult into metrics.EventMetrics object diff --git a/probes/http/http.go b/probes/http/http.go index 5de18374..d2ebd576 100644 --- a/probes/http/http.go +++ b/probes/http/http.go @@ -67,18 +67,11 @@ type probeRunResult struct { } func newProbeRunResult(target string) probeRunResult { - prr := probeRunResult{ + return probeRunResult{ target: target, respCodes: metrics.NewMap("code", &metrics.Int{}), respBodies: metrics.NewMap("resp", &metrics.Int{}), } - // Borgmon and friends expect results to be in milliseconds. We should - // change expectations at the Borgmon end once the transition to the new - // metrics model is complete. - prr.rtt.Str = func(i int64) string { - return fmt.Sprintf("%.3f", float64(i)/1000) - } - return prr } // Metrics converts probeRunResult into a slice of the metrics that is suitable for diff --git a/probes/ping/ping.go b/probes/ping/ping.go index e59fa236..69a8c4e8 100644 --- a/probes/ping/ping.go +++ b/probes/ping/ping.go @@ -386,7 +386,7 @@ func (p *Probe) Start(ctx context.Context, dataChan chan *metrics.EventMetrics) em := metrics.NewEventMetrics(ts). AddMetric("sent", metrics.NewInt(p.sent[t])). AddMetric("rcvd", metrics.NewInt(p.received[t])). - AddMetric("rtt", metrics.NewInt(p.latencyUsec[t]/1000)). + AddMetric("rtt", metrics.NewInt(p.latencyUsec[t])). AddLabel("ptype", "ping"). AddLabel("probe", p.name). AddLabel("dst", t) diff --git a/probes/udp/udp.go b/probes/udp/udp.go index 40a26138..6678171f 100644 --- a/probes/udp/udp.go +++ b/probes/udp/udp.go @@ -62,16 +62,9 @@ type probeRunResult struct { } func newProbeRunResult(target string) probeRunResult { - prr := probeRunResult{ + return probeRunResult{ target: target, } - // Borgmon and friends expect results to be in milliseconds. We should - // change expectations at the Borgmon end once the transition to the new - // metrics model is complete. - prr.rtt.Str = func(i int64) string { - return fmt.Sprintf("%.3f", float64(i)/1000) - } - return prr } // Target returns the p.target. diff --git a/utils/proberesults_test.go b/utils/proberesults_test.go index b950f3fe..52d69a40 100644 --- a/utils/proberesults_test.go +++ b/utils/proberesults_test.go @@ -16,7 +16,6 @@ package utils import ( "context" - "fmt" "testing" "time" @@ -36,16 +35,9 @@ type probeRunResult struct { } func newProbeRunResult(target string) probeRunResult { - prr := probeRunResult{ + return probeRunResult{ target: target, } - // Borgmon and friends expect results to be in milliseconds. We should - // change expectations at the Borgmon end once the transition to the new - // metrics model is complete. - prr.rtt.Str = func(i int64) string { - return fmt.Sprintf("%.3f", float64(i)/1000) - } - return prr } // Metrics converts probeRunResult into a map of the metrics that is suitable for