From 4c33c4f725e6d13d4b6d5171eeca3d47afbc2e3b Mon Sep 17 00:00:00 2001 From: Drew Dennison Date: Sun, 3 Sep 2017 14:41:14 -0700 Subject: [PATCH] fix bug because of order of operations --- .../filters/StatusAndRouteLatencyFilter.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/com/github/stijndehaes/playprometheusfilters/filters/StatusAndRouteLatencyFilter.scala b/app/com/github/stijndehaes/playprometheusfilters/filters/StatusAndRouteLatencyFilter.scala index fc227e1..8aec5c6 100644 --- a/app/com/github/stijndehaes/playprometheusfilters/filters/StatusAndRouteLatencyFilter.scala +++ b/app/com/github/stijndehaes/playprometheusfilters/filters/StatusAndRouteLatencyFilter.scala @@ -24,7 +24,7 @@ class StatusAndRouteLatencyFilter @Inject()(registry: CollectorRegistry) (implic nextFilter(requestHeader).map { result => val endTime = System.nanoTime - val requestTime = endTime - startTime / Collector.NANOSECONDS_PER_SECOND + val requestTime = (endTime - startTime) / Collector.NANOSECONDS_PER_SECOND val routeLabel = requestHeader.attrs .get(Router.Attrs.HandlerDef) .map(_.method) @@ -39,4 +39,4 @@ class StatusAndRouteLatencyFilter @Inject()(registry: CollectorRegistry) (implic object StatusAndRouteLatencyFilter { val unmatchedRoute: String = "unmatchedRoute" -} \ No newline at end of file +}