本文整理了Java中io.micrometer.core.instrument.Tags.empty()
方法的一些代码示例,展示了Tags.empty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tags.empty()
方法的具体详情如下:
包路径:io.micrometer.core.instrument.Tags
类名称:Tags
方法名:empty
暂无
代码示例来源:origin: org.apache.camel/camel-micrometer
public MicrometerModule(TimeUnit timeUnit) {
this(timeUnit, name -> true, Tags.empty());
}
代码示例来源:origin: org.apache.camel/camel-micrometer
Iterable<Tag> getMetricsTag(Map<String, Object> parameters) {
String tagsString = getAndRemoveParameter(parameters, "tags", String.class, "");
if (tagsString != null && !tagsString.isEmpty()) {
String[] tagStrings = tagsString.split("\\s*,\\s*");
return Stream.of(tagStrings)
.map(s -> Tags.of(s.split("\\s*=\\s*")))
.reduce(Tags.empty(), Tags::and);
}
return Tags.empty();
}
代码示例来源:origin: org.eclipse.che.core/che-core-metrics-core
@Override
public TomcatMetrics get() {
return new TomcatMetrics(manager, Tags.empty());
}
}
代码示例来源:origin: io.micrometer/micrometer-registry-new-relic
private String event(Meter.Id id, Attribute... attributes) {
return event(id, Tags.empty(), attributes);
}
代码示例来源:origin: org.apache.camel/camel-micrometer
@Override
public ScheduledExecutorService newScheduledThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory) {
ScheduledExecutorService executorService = threadPoolFactory.newScheduledThreadPool(profile, threadFactory);
String executorServiceName = name(profile.getId());
return new TimedScheduledExecutorService(meterRegistry, executorService, executorServiceName, Tags.empty());
}
代码示例来源:origin: org.apache.camel/camel-micrometer
@Override
public void process(Exchange exchange) {
Message in = exchange.getIn();
String defaultMetricsName = simple(exchange, getEndpoint().getMetricsName(), String.class);
String finalMetricsName = getStringHeader(in, HEADER_METRIC_NAME, defaultMetricsName);
Iterable<Tag> defaultTags = getEndpoint().getTags();
Iterable<Tag> headerTags = getTagHeader(in, HEADER_METRIC_TAGS, Tags.empty());
Iterable<Tag> finalTags = Tags.concat(defaultTags, headerTags).stream()
.map(tag -> Tag.of(
simple(exchange, tag.getKey(), String.class),
simple(exchange, tag.getValue(), String.class)))
.reduce(Tags.empty(), Tags::and, Tags::and)
.and(Tags.of(
CAMEL_CONTEXT_TAG, getEndpoint().getCamelContext().getName()));
try {
doProcess(exchange, finalMetricsName, finalTags);
} catch (Exception e) {
exchange.setException(e);
} finally {
clearMetricsHeaders(in);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-metrics-core
@Override
public void bindTo(MeterRegistry registry) {
for (FileStore fileStore : FileSystems.getDefault().getFileStores()) {
LOG.debug("Add gauge metric for {}", fileStore.name());
Iterable<Tag> tagsWithPath = Tags.concat(Tags.empty(), "path", fileStore.toString());
Gauge.builder("disk.free", fileStore, exceptionToNonWrapper(FileStore::getUnallocatedSpace))
.tags(tagsWithPath)
.description("Unallocated space for file store")
.baseUnit("bytes")
.strongReference(true)
.register(registry);
Gauge.builder("disk.total", fileStore, exceptionToNonWrapper(FileStore::getTotalSpace))
.tags(tagsWithPath)
.description("Total space for file store")
.baseUnit("bytes")
.strongReference(true)
.register(registry);
Gauge.builder("disk.usable", fileStore, exceptionToNonWrapper(FileStore::getUsableSpace))
.tags(tagsWithPath)
.description("Usable space for file store")
.baseUnit("bytes")
.strongReference(true)
.register(registry);
}
}
内容来源于网络,如有侵权,请联系作者删除!