Creates a new instance of {@link CircuitBreakerExports} with specified metrics names prefix and
{@link Iterable} of circuit breakers.

@param prefix the prefix of metrics names
@param circuitBreakers the circuit breakers
424629
public static CircuitBreakerExports ofIterable(String prefix, Iterable<CircuitBreaker> circuitBreakers) {
        requireNonNull(prefix);
        requireNonNull(circuitBreakers);
        return new CircuitBreakerExports(prefix, circuitBreakers);
    }
956776
def add_circuit_breaker(self, circ_breaker):
        
        if circ_breaker not in self._circuit_breakers and isinstance(circ_breaker, CircuitBreakerDing0):
            self._circuit_breakers.append(circ_breaker)
            self.graph_add_node(circ_breaker)
1323396
public static RateLimiterExports ofRateLimiter(String prefix, RateLimiter rateLimiter) {
        return new RateLimiterExports(prefix, Array.of(rateLimiter));
    }
256593
public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
    newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategy strategy) {
        return delegate -> new CircuitBreakerHttpClient(delegate, mapping, strategy);
    }
876557
private Object handleJoinPointCompletableFuture(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker) {
		return circuitBreaker.executeCompletionStage(() -> {
			try {
				return (CompletionStage<?>) proceedingJoinPoint.proceed();
			} catch (Throwable throwable) {
				throw new CompletionException(throwable);
			}
		});
	}
605767
public void readAndExport(MetricExporter metricExporter) {
    Span span =
        tracer
            .spanBuilder(spanName)
            .setRecordEvents(true)
            .setSampler(probabilitySampler)
            .startSpan();
    Scope scope = tracer.withSpan(span);
    try {
      ArrayList<Metric> metricsList = new ArrayList<>();
      for (MetricProducer metricProducer : metricProducerManager.getAllMetricProducer()) {
        metricsList.addAll(metricProducer.getMetrics());
      }
      metricExporter.export(metricsList);
    } catch (Throwable e) {
      logger.log(Level.WARNING, "Exception thrown by the metrics exporter.", e);
      span.setStatus(
          Status.UNKNOWN.withDescription("Exception when export metrics: " + exceptionMessage(e)));
    } finally {
      scope.close();
      span.end();
    }
  }
977542
public CircuitBreaker<R> withSuccessThreshold(int successThreshold) {
    Assert.isTrue(successThreshold >= 1, "successThreshold must be greater than or equal to 1");
    return withSuccessThreshold(successThreshold, successThreshold);
  }
572281
public CircuitBreaker build() {
        if (counterSlidingWindow.compareTo(counterUpdateInterval) <= 0) {
            throw new IllegalStateException(
                    "counterSlidingWindow: " + counterSlidingWindow + " (expected: > counterUpdateInterval)");
        }
        return new NonBlockingCircuitBreaker(
                ticker,
                new CircuitBreakerConfig(name, failureRateThreshold, minimumRequestThreshold,
                                         circuitOpenWindow, trialRequestInterval,
                                         counterSlidingWindow, counterUpdateInterval,
                                         Collections.unmodifiableList(listeners)));
    }
823201
public static BulkheadExports ofBulkhead(String prefix, Bulkhead bulkhead) {
        return new BulkheadExports(prefix, Array.of(bulkhead));
    }
1058801
public static RateLimiterMetrics ofRateLimiterRegistry(String prefix, RateLimiterRegistry rateLimiterRegistry) {
        return new RateLimiterMetrics(prefix, rateLimiterRegistry.getAllRateLimiters());
    }
252891
public static CircuitBreakerExports ofCircuitBreaker(CircuitBreaker circuitBreaker) {
        requireNonNull(circuitBreaker);
        return new CircuitBreakerExports(Array.of(circuitBreaker));
    }
533222
@Override
    public CircuitGroupBlockingMessage createCGB() {
        CircuitGroupBlockingMessage cgb = new CircuitGroupBlockingMessageImpl(_CGB_HOLDER.mandatoryCodes,
                _CGB_HOLDER.mandatoryVariableCodes, _CGB_HOLDER.optionalCodes, _CGB_HOLDER.mandatoryCodeToIndex,
                _CGB_HOLDER.mandatoryVariableCodeToIndex, _CGB_HOLDER.optionalCodeToIndex);
        return cgb;
    }
805121
static Fix createFix(
      ImmutableList<ImportTree> wildcardImports,
      Set<TypeToImport> typesToImport,
      VisitorState state) {
    Map<Symbol, List<TypeToImport>> toFix =
        typesToImport.stream().collect(Collectors.groupingBy(TypeToImport::owner));
    final SuggestedFix.Builder fix = SuggestedFix.builder();
    for (ImportTree importToDelete : wildcardImports) {
      String importSpecification = importToDelete.getQualifiedIdentifier().toString();
      if (importToDelete.isStatic()) {
        fix.removeStaticImport(importSpecification);
      } else {
        fix.removeImport(importSpecification);
      }
    }
    for (Map.Entry<Symbol, List<TypeToImport>> entry : toFix.entrySet()) {
      final Symbol owner = entry.getKey();
      if (entry.getKey().getKind() != ElementKind.PACKAGE
          && entry.getValue().size() > MAX_MEMBER_IMPORTS) {
        qualifiedNameFix(fix, owner, state);
      } else {
        for (TypeToImport toImport : entry.getValue()) {
          toImport.addFix(fix);
        }
      }
    }
    return fix.build();
  }
1358808
public void registerEventConsumer(CircuitBreakerRegistry circuitBreakerRegistry,
									  EventConsumerRegistry<CircuitBreakerEvent> eventConsumerRegistry) {
		circuitBreakerRegistry.getEventPublisher().onEntryAdded(event -> registerEventConsumer(eventConsumerRegistry, event.getAddedEntry()));
	}
318362
private static void checkCircuit(Map<Circuit, Collection<TileRef>> circuits,
                                     MapCircuitExtractor extractor,
                                     MapTile map,
                                     Tile tile)
    {
        final Circuit circuit = extractor.getCircuit(tile);
        if (circuit != null)
        {
            final TileRef ref = new TileRef(tile);
            getTiles(circuits, circuit).add(ref);
            checkTransitionGroups(circuits, circuit, map, ref);
        }
    }
1351085
public static ServerSocket createSocketFromPorts(Iterator<Integer> portsIterator, SocketFactory factory) {
		while (portsIterator.hasNext()) {
			int port = portsIterator.next();
			LOG.debug("Trying to open socket on port {}", port);
			try {
				return factory.createSocket(port);
			} catch (IOException | IllegalArgumentException e) {
				if (LOG.isDebugEnabled()) {
					LOG.debug("Unable to allocate socket on port", e);
				} else {
					LOG.info("Unable to allocate on port {}, due to error: {}", port, e.getMessage());
				}
			}
		}
		return null;
	}
1146393
public static CircuitBreakerMetricsCollector ofSupplier(Supplier<? extends Iterable<? extends CircuitBreaker>> supplier) {
        return new CircuitBreakerMetricsCollector(MetricNames.ofDefaults(), supplier);
    }