Java Code Examples for io.micrometer.core.instrument.util.HierarchicalNameMapper#DEFAULT

The following examples show how to use io.micrometer.core.instrument.util.HierarchicalNameMapper#DEFAULT . 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: EtsyStatsdLineBuilderTest.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Test
void changingNamingConvention() {
    Counter c = registry.counter("my.counter", "my.tag", "value");
    EtsyStatsdLineBuilder lb = new EtsyStatsdLineBuilder(c.getId(), registry.config(), HierarchicalNameMapper.DEFAULT);

    registry.config().namingConvention(NamingConvention.dot);
    assertThat(lb.line("1", Statistic.COUNT, "c")).isEqualTo("my.counter.my.tag.value.statistic.count:1|c");

    registry.config().namingConvention(NamingConvention.camelCase);
    assertThat(lb.line("1", Statistic.COUNT, "c")).isEqualTo("myCounter.myTag.value.statistic.count:1|c");
}
 
Example 4
Source File: EtsyStatsdLineBuilderTest.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Issue("#739")
@Test
void sanitizeColons() {
    Counter c = registry.counter("my:counter", "my:tag", "my:value");
    EtsyStatsdLineBuilder lb = new EtsyStatsdLineBuilder(c.getId(), registry.config(), HierarchicalNameMapper.DEFAULT);

    registry.config().namingConvention(NamingConvention.dot);
    assertThat(lb.line("1", Statistic.COUNT, "c")).isEqualTo("my_counter.my_tag.my_value.statistic.count:1|c");
}
 
Example 5
Source File: GraphiteMeterRegistryCompatibilityTest.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
public MeterRegistry registry() {
    return new GraphiteMeterRegistry(new GraphiteConfig() {
        @Override
        public boolean enabled() {
            return false;
        }

        @Override
        @Nullable
        public String get(String key) {
            return null;
        }
    }, new MockClock(), HierarchicalNameMapper.DEFAULT);
}
 
Example 6
Source File: JmxMeterRegistry.java    From micrometer with Apache License 2.0 4 votes vote down vote up
public JmxMeterRegistry(JmxConfig config, Clock clock) {
    this(config, clock, HierarchicalNameMapper.DEFAULT);
}
 
Example 7
Source File: JmxMeterRegistryCompatibilityTest.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
public MeterRegistry registry() {
    return new JmxMeterRegistry(JmxConfig.DEFAULT, new MockClock(), HierarchicalNameMapper.DEFAULT);
}
 
Example 8
Source File: StatsdMeterRegistry.java    From micrometer with Apache License 2.0 4 votes vote down vote up
public StatsdMeterRegistry(StatsdConfig config, Clock clock) {
    this(config, HierarchicalNameMapper.DEFAULT, clock);
}
 
Example 9
Source File: GangliaMeterRegistry.java    From micrometer with Apache License 2.0 2 votes vote down vote up
/**
 * @param config The registry configuration.
 * @param clock  The clock to use for timings.
 */
public GangliaMeterRegistry(GangliaConfig config, Clock clock) {
    this(config, clock, HierarchicalNameMapper.DEFAULT, DEFAULT_THREAD_FACTORY);
}