From ca4c97ad7086430ba149422905c11d1fc0269470 Mon Sep 17 00:00:00 2001 From: Egor Cherniak Date: Wed, 28 Sep 2022 13:17:59 +0300 Subject: [PATCH] Use max value for duplicate metrics (#20) --- src/main/java/dev/vality/beholder/service/MetricsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/vality/beholder/service/MetricsService.java b/src/main/java/dev/vality/beholder/service/MetricsService.java index 0e1c522..584c66a 100644 --- a/src/main/java/dev/vality/beholder/service/MetricsService.java +++ b/src/main/java/dev/vality/beholder/service/MetricsService.java @@ -128,7 +128,7 @@ public class MetricsService { .flatMap(formDataResponse -> formDataResponse.getNetworkLogs().stream() .map(log -> convertToResourceLoadingEntry(formDataResponse, log))) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, Math::max)); } private Map.Entry convertToResourceLoadingEntry(FormDataResponse formDataResponse,