Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
*/
public class PropertiesMeterFilter implements MeterFilter {

private static final ServiceLevelAgreementBoundary[] EMPTY_SLA = {};

private final MetricsProperties properties;

private final MeterFilter mapFilter;
Expand Down Expand Up @@ -90,7 +88,10 @@ public DistributionStatisticConfig configure(Meter.Id id,
}

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;
Expand Down