com.netflix.hystrix.strategy.metrics.HystrixMetricsPublisherCommand Java Examples

The following examples show how to use com.netflix.hystrix.strategy.metrics.HystrixMetricsPublisherCommand. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HystrixPrometheusMetricsPublisherCommand.java    From prometheus-hystrix with Apache License 2.0 6 votes vote down vote up
public HystrixPrometheusMetricsPublisherCommand(
        HystrixMetricsCollector collector, HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey,
        HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker,
        HystrixCommandProperties properties, boolean exportProperties, boolean exportDeprecatedMetrics,
        HystrixMetricsPublisherCommand delegate) {

    this.labels = new TreeMap<String, String>();
    this.labels.put("command_group", (commandGroupKey != null) ? commandGroupKey.name() : "default");
    this.labels.put("command_name", commandKey.name());

    this.exportProperties = exportProperties;

    this.circuitBreaker = circuitBreaker;
    this.properties = properties;
    this.collector = collector;
    this.metrics = metrics;
    this.commandKey = commandKey;
    this.delegate = delegate;
    this.exportDeprecatedMetrics = exportDeprecatedMetrics;
}
 
Example #2
Source File: MicrometerMetricsPublisher.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
public HystrixMetricsPublisherCommand getMetricsPublisherForCommand(HystrixCommandKey commandKey,
                                                                    HystrixCommandGroupKey commandGroupKey,
                                                                    HystrixCommandMetrics metrics,
                                                                    HystrixCircuitBreaker circuitBreaker,
                                                                    HystrixCommandProperties properties) {
    HystrixMetricsPublisherCommand metricsPublisherForCommand =
        metricsPublisher.getMetricsPublisherForCommand(commandKey, commandGroupKey, metrics, circuitBreaker, properties);
    return new MicrometerMetricsPublisherCommand(registry, commandKey, commandGroupKey, metrics, circuitBreaker, metricsPublisherForCommand);
}
 
Example #3
Source File: MicrometerMetricsPublisherCommand.java    From micrometer with Apache License 2.0 5 votes vote down vote up
public MicrometerMetricsPublisherCommand(MeterRegistry meterRegistry, HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixMetricsPublisherCommand metricsPublisherForCommand) {
    this.meterRegistry = meterRegistry;
    this.metrics = metrics;
    this.circuitBreaker = circuitBreaker;
    this.commandKey = commandKey;
    this.metricsPublisherForCommand = metricsPublisherForCommand;

    tags = Tags.of("group", commandGroupKey.name(), "key", commandKey.name());
}
 
Example #4
Source File: HystrixPrometheusMetricsPublisher.java    From prometheus-hystrix with Apache License 2.0 5 votes vote down vote up
@Override
public HystrixMetricsPublisherCommand getMetricsPublisherForCommand(
        HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey,
        HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker,
        HystrixCommandProperties properties) {
    HystrixMetricsPublisherCommand delegate = metricsPublisherDelegate.getMetricsPublisherForCommand(commandKey,
            commandGroupKey, metrics, circuitBreaker, properties);

    return new HystrixPrometheusMetricsPublisherCommand(
            collector, commandKey, commandGroupKey, metrics, circuitBreaker, properties, exportProperties,
            exportDeprecatedMetrics, delegate);
}
 
Example #5
Source File: YammerMetricsPublisher.java    From tenacity with Apache License 2.0 4 votes vote down vote up
@Override
public HystrixMetricsPublisherCommand getMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixCommandProperties properties) {
    return new YammerMetricsPublisherCommand(commandKey, commandGroupKey, metrics, circuitBreaker, properties, metricRegistry);
}