Use max value for duplicate metrics (#20)

This commit is contained in:
Egor Cherniak 2022-09-28 13:17:59 +03:00 committed by GitHub
parent f714835934
commit ca4c97ad70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<Tags, Double> convertToResourceLoadingEntry(FormDataResponse formDataResponse,