Java源码示例:io.github.resilience4j.micrometer.tagged.TaggedCircuitBreakerMetrics

示例1
TaggedCircuitBreakerMetrics createMetrics(CircuitBreakerRegistry registry, String mappingName) {
    String bufferedCallsMetricName = metricName(mappingName, CIRCUIT_BREAKER_METRICS_NAME, "buffered-calls");
    String callsMetricName = metricName(mappingName, CIRCUIT_BREAKER_METRICS_NAME, "calls");
    String stateMetricName = metricName(mappingName, CIRCUIT_BREAKER_METRICS_NAME, "state");
    String failureRateMetricName = metricName(mappingName, CIRCUIT_BREAKER_METRICS_NAME, "failure-rate");
    String slowCallRateMetricName = metricName(mappingName, CIRCUIT_BREAKER_METRICS_NAME, "slow-calls-rate");
    String slowCallsMetricName = metricName(mappingName, CIRCUIT_BREAKER_METRICS_NAME, "slow-calls");
    TaggedCircuitBreakerMetrics.MetricNames metricNames = TaggedCircuitBreakerMetrics.MetricNames.custom()
            .bufferedCallsMetricName(bufferedCallsMetricName)
            .callsMetricName(callsMetricName)
            .stateMetricName(stateMetricName)
            .failureRateMetricName(failureRateMetricName)
            .slowCallRateMetricName(slowCallRateMetricName)
            .slowCallsMetricName(slowCallsMetricName)
            .build();
    return ofCircuitBreakerRegistry(metricNames, registry);
}
 
示例2
@PostConstruct
public void init() {
	if (factory != null) {
		TaggedCircuitBreakerMetrics
				.ofCircuitBreakerRegistry(factory.getCircuitBreakerRegistry())
				.bindTo(meterRegistry);
	}
}
 
示例3
@PostConstruct
public void init() {
	if (factory != null) {
		TaggedCircuitBreakerMetrics
				.ofCircuitBreakerRegistry(factory.getCircuitBreakerRegistry())
				.bindTo(meterRegistry);
	}
}
 
示例4
@Bean
@ConditionalOnProperty(value = "resilience4j.circuitbreaker.metrics.legacy.enabled", havingValue = "true")
@ConditionalOnMissingBean
public TaggedCircuitBreakerMetrics registerCircuitBreakerMetrics(
    CircuitBreakerRegistry circuitBreakerRegistry) {
    return TaggedCircuitBreakerMetrics.ofCircuitBreakerRegistry(circuitBreakerRegistry);
}