@Test public void customMetricNameBucketsOverrideDefaultOnes() { CollectorRegistry registry = new CollectorRegistry(); CircuitBreakerMetricsCollector.ofCircuitBreakerRegistry( MetricNames.ofDefaults(), MetricOptions.custom().buckets(new double[]{.005, .01}).build(), circuitBreakerRegistry).register(registry); circuitBreaker.onSuccess(2000, TimeUnit.NANOSECONDS); assertThat(registry.getSampleValue( DEFAULT_CIRCUIT_BREAKER_CALLS + "_bucket", new String[]{"name", "kind", "le"}, new String[]{circuitBreaker.getName(), "successful", "0.01"} )).isEqualTo(1d); assertThat(registry.getSampleValue( DEFAULT_CIRCUIT_BREAKER_CALLS + "_bucket", new String[]{"name", "kind", "le"}, new String[]{circuitBreaker.getName(), "successful", "0.025"} )).isNull(); }
public static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names, MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry) { return new CircuitBreakerMetricsCollector(names, options, circuitBreakerRegistry); }
CircuitBreakerMetricsCollector extends AbstractCircuitBreakerMetrics { public static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names, MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry) { return new CircuitBreakerMetricsCollector(names, options, circuitBreakerRegistry); } }
CircuitBreakerMetricsCollector extends AbstractCircuitBreakerMetrics { public static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names, MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry) { return new CircuitBreakerMetricsCollector(names, options, circuitBreakerRegistry); } private  CircuitBreakerMetricsCollector(MetricNames names, MetricOptions options,
        CircuitBreakerRegistry circuitBreakerRegistry); }
CircuitBreakerMetricsCollector extends AbstractCircuitBreakerMetrics { public static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names, MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry) { return new CircuitBreakerMetricsCollector(names, options, circuitBreakerRegistry); } private  CircuitBreakerMetricsCollector(MetricNames names, MetricOptions options,
        CircuitBreakerRegistry circuitBreakerRegistry); static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names,
        MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry); static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names,
        CircuitBreakerRegistry circuitBreakerRegistry); static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(
        CircuitBreakerRegistry circuitBreakerRegistry); @Override List<MetricFamilySamples> collect(); }
CircuitBreakerMetricsCollector extends AbstractCircuitBreakerMetrics { public static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names, MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry) { return new CircuitBreakerMetricsCollector(names, options, circuitBreakerRegistry); } private  CircuitBreakerMetricsCollector(MetricNames names, MetricOptions options,
        CircuitBreakerRegistry circuitBreakerRegistry); static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names,
        MetricOptions options, CircuitBreakerRegistry circuitBreakerRegistry); static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(MetricNames names,
        CircuitBreakerRegistry circuitBreakerRegistry); static CircuitBreakerMetricsCollector ofCircuitBreakerRegistry(
        CircuitBreakerRegistry circuitBreakerRegistry); @Override List<MetricFamilySamples> collect();  }