當前位置: 首頁>>代碼示例>>Java>>正文


Java AtlasConfig類代碼示例

本文整理匯總了Java中com.netflix.spectator.atlas.AtlasConfig的典型用法代碼示例。如果您正苦於以下問題:Java AtlasConfig類的具體用法?Java AtlasConfig怎麽用?Java AtlasConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AtlasConfig類屬於com.netflix.spectator.atlas包,在下文中一共展示了AtlasConfig類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: pollingConfig

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
/**
 * Convenience method for building an Atlas configuration that polls on a {@code step} interval.
 */
public static AtlasConfig pollingConfig(String uri, Duration step) {
    return new AtlasConfig() {
        @Override
        public String uri() {
            return uri;
        }

        @Override
        public Duration step() {
            return step;
        }

        @Override
        public String get(String k) {
            return System.getProperty(k);
        }
    };
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:22,代碼來源:AtlasUtils.java

示例2: AtlasMeterRegistry

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
public AtlasMeterRegistry(AtlasConfig config, Clock clock) {
    super(clock);

    this.atlasConfig = config;

    this.registry = new AtlasRegistry(new com.netflix.spectator.api.Clock() {
        @Override
        public long wallTime() {
            return clock.wallTime();
        }

        @Override
        public long monotonicTime() {
            return clock.monotonicTime();
        }
    }, config);

    // invalid character replacement happens in the spectator-reg-atlas module, so doesn't need
    // to be duplicated here.
    this.config().namingConvention(NamingConvention.camelCase);

    start();
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:24,代碼來源:AtlasMeterRegistry.java

示例3: registry

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
@Override
public MeterRegistry registry() {
    return new AtlasMeterRegistry(new AtlasConfig() {
        @Override
        public boolean enabled() {
            return false;
        }

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

        @Override
        public Duration step() {
            return Duration.ofMinutes(1);
        }
    }, new MockClock());
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:20,代碼來源:AtlasMeterRegistryCompatibilityTest.java

示例4: timerMax

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
@Test
void timerMax() {
    AtlasConfig atlasConfig = k -> null;
    AtlasMeterRegistry registry = new AtlasMeterRegistry(atlasConfig, new MockClock());
    Timer timer = registry.timer("timer");

    timer.record(1, TimeUnit.SECONDS);
    clock(registry).add(atlasConfig.step());
    assertThat(timer.max(TimeUnit.MILLISECONDS)).isEqualTo(1000);
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:11,代碼來源:SpectatorTimerTest.java

示例5: atlas

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
public static AtlasMeterRegistry atlas() {
    return new AtlasMeterRegistry(new AtlasConfig() {
        @Override
        public Duration step() {
            return Duration.ofSeconds(10);
        }

        @Override
        public String get(String k) {
            return null;
        }
    }, Clock.SYSTEM);
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:14,代碼來源:SampleRegistries.java

示例6: atlasConfig

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(AtlasConfig.class)
public AtlasConfig atlasConfig(AtlasProperties props) {
    return new DefaultAtlasConfig(props);
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:6,代碼來源:AtlasExportConfiguration.java

示例7: atlasExporter

import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
@Bean
@ConditionalOnProperty(value = "management.metrics.export.atlas.enabled", matchIfMissing = true)
public MetricsExporter atlasExporter(AtlasConfig config, Clock clock) {
    return () -> new AtlasMeterRegistry(config, clock);
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:6,代碼來源:AtlasExportConfiguration.java


注:本文中的com.netflix.spectator.atlas.AtlasConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。