本文整理匯總了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);
}
};
}
示例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();
}
示例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());
}
示例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);
}
示例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);
}
示例6: atlasConfig
import com.netflix.spectator.atlas.AtlasConfig; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(AtlasConfig.class)
public AtlasConfig atlasConfig(AtlasProperties props) {
return new DefaultAtlasConfig(props);
}
示例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);
}