public class HystrixBundle<T extends Configuration> extends Object implements ConfiguredBundle<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
HystrixBundle.Builder
A builder that is convenient to use if you need to configure this bundle in any way
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_STREAM_PATH
The default path that will be used for binding the HystrixMetricsStreamServlet to the admin context.
|
static String |
SERVLET_NAME |
| Modifier and Type | Method and Description |
|---|---|
static HystrixBundle.Builder |
builder()
Creates a new @{link Builder} that may be used to configure this bundle's behaviour.
|
protected boolean |
canPublishHystrixMetrics(T configuration)
Determines whether Hystrix metrics should be published as Dropwizard Metrics.
|
void |
initialize(Bootstrap<?> bootstrap) |
void |
run(T configuration,
Environment environment)
Setup method for the
ConfiguredBundle |
static HystrixBundle |
withDefaultSettings()
Creates a bundle instance with default settings i.e the HystrixMetricsStreamServlet will be added to
the admin context mapped by the @{link #DEFAULT_STREAM_PATH} path and the Hystrix to
DropWizard metrics publisher is enabled
|
public static final String DEFAULT_STREAM_PATH
public static final String SERVLET_NAME
public static HystrixBundle withDefaultSettings()
public static HystrixBundle.Builder builder()
public void initialize(Bootstrap<?> bootstrap)
initialize in interface ConfiguredBundle<T extends Configuration>protected boolean canPublishHystrixMetrics(T configuration)
Example:
bootstrap.addBundle( new HystrixBundle() {
protected boolean canPublishHystrixMetrics(MyAppConfiguration configuration) {
return configuration.isEnableHystrixMetrics();
}
});
configuration - the current configuration as provided by DropWizardHystrixBundle.Builder.disableMetricsPublisher()public void run(T configuration, Environment environment)
ConfiguredBundlerun in interface ConfiguredBundle<T extends Configuration>configuration - the configuration as provided by DropWizardenvironment - the environment as provided by DropWizardConfiguredBundle.run(Object, Environment)Copyright © 2015–2017 Sondre Eikanger Kvalø. All rights reserved..