io.micrometer.core.instrument.dropwizard.DropwizardConfig Java Examples

The following examples show how to use io.micrometer.core.instrument.dropwizard.DropwizardConfig. 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: JHipsterLoggingMetricsExportConfiguration.java    From jhipster with Apache License 2.0 6 votes vote down vote up
/**
 * <p>consoleLoggingRegistry.</p>
 *
 * @param dropwizardRegistry a {@link com.codahale.metrics.MetricRegistry} object.
 * @return a {@link io.micrometer.core.instrument.MeterRegistry} object.
 */
@Bean
public MeterRegistry consoleLoggingRegistry(MetricRegistry dropwizardRegistry) {
    DropwizardConfig dropwizardConfig = new DropwizardConfig() {
        @Override
        public String prefix() {
            return "console";
        }

        @Override
        public String get(String key) {
            return null;
        }
    };

    return new DropwizardMeterRegistry(dropwizardConfig, dropwizardRegistry, HierarchicalNameMapper.DEFAULT, Clock.SYSTEM) {
        @Override
        protected Double nullGaugeValue() {
            return null;
        }
    };
}
 
Example #2
Source File: MoreNamingConventionsTest.java    From armeria with Apache License 2.0 6 votes vote down vote up
private static DropwizardMeterRegistry newDropwizardRegistry() {
    return new DropwizardMeterRegistry(new DropwizardConfig() {
        @Override
        public String prefix() {
            return "dropwizard";
        }

        @Override
        @Nullable
        public String get(String k) {
            return null;
        }
    }, new MetricRegistry(), HierarchicalNameMapper.DEFAULT, Clock.SYSTEM) {
        @Override
        protected Double nullGaugeValue() {
            return 0.0;
        }
    };
}
 
Example #3
Source File: GraphiteConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> DropwizardConfig.validate(c),
            checkRequired("rateUnits", GraphiteConfig::rateUnits),
            checkRequired("durationUnits", GraphiteConfig::durationUnits),
            checkRequired("host", GraphiteConfig::host),
            check("port", GraphiteConfig::port),
            checkRequired("protocol", GraphiteConfig::protocol)
    );
}