mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-03 03:43:54 +01:00
Merge branch '2.0.x'
This commit is contained in:
+4
-3
@@ -43,8 +43,6 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class PropertiesMeterFilter implements MeterFilter {
|
||||
|
||||
private static final ServiceLevelAgreementBoundary[] EMPTY_SLA = {};
|
||||
|
||||
private final MetricsProperties properties;
|
||||
|
||||
private final MeterFilter mapFilter;
|
||||
@@ -90,7 +88,10 @@ public class PropertiesMeterFilter implements MeterFilter {
|
||||
}
|
||||
|
||||
private long[] convertSla(Meter.Type meterType, ServiceLevelAgreementBoundary[] sla) {
|
||||
long[] converted = Arrays.stream((sla != null) ? sla : EMPTY_SLA)
|
||||
if (sla == null) {
|
||||
return null;
|
||||
}
|
||||
long[] converted = Arrays.stream(sla)
|
||||
.map((candidate) -> candidate.getValue(meterType))
|
||||
.filter(Objects::nonNull).mapToLong(Long::longValue).toArray();
|
||||
return (converted.length != 0) ? converted : null;
|
||||
|
||||
Reference in New Issue
Block a user