当前位置: 首页>>代码示例>>Java>>正文


Java Measurement类代码示例

本文整理汇总了Java中io.micrometer.core.instrument.Measurement的典型用法代码示例。如果您正苦于以下问题:Java Measurement类的具体用法?Java Measurement怎么用?Java Measurement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Measurement类属于io.micrometer.core.instrument包,在下文中一共展示了Measurement类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: measurementName

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
private static String measurementName(Meter.Id id, Measurement measurement) {
    final StringBuilder buf = new StringBuilder();

    // Append name.
    buf.append(id.getName());

    // Append statistic.
    buf.append('#');
    buf.append(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, measurement.getStatistic().name()));

    // Append tags if there are any.
    final Iterator<Tag> tagsIterator = id.getTags().iterator();
    if (tagsIterator.hasNext()) {
        buf.append('{');
        tagsIterator.forEachRemaining(tag -> buf.append(tag.getKey()).append('=')
                                                .append(tag.getValue()).append(','));
        buf.setCharAt(buf.length() - 1, '}');
    }
    return buf.toString();
}
 
开发者ID:line,项目名称:armeria,代码行数:21,代码来源:MoreMeters.java

示例2: measure

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
public Iterable<Measurement> measure() {
    return Arrays.asList(
        new Measurement(() -> (double) count(), Statistic.Count),
        new Measurement(this::totalAmount, Statistic.Total),
        new Measurement(this::max, Statistic.Max)
    );
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:9,代码来源:CumulativeDistributionSummary.java

示例3: customMeasurementsThatDifferOnlyInTagValue

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Test
void customMeasurementsThatDifferOnlyInTagValue() {
    Meter.builder("my.custom", Meter.Type.Gauge, Arrays.asList(
        new Measurement(() -> 1.0, Statistic.Count),
        new Measurement(() -> 2.0, Statistic.Total)
    )).register(registry);
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:8,代码来源:DropwizardMeterRegistryTest.java

示例4: DefaultMeter

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
public DefaultMeter(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements) {
    super(id);
    this.type = type;
    this.measurements = measurements;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:6,代码来源:DefaultMeter.java

示例5: measure

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
public Iterable<Measurement> measure() {
    return measurements;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:5,代码来源:DefaultMeter.java

示例6: CompositeCustomMeter

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
CompositeCustomMeter(Id id, Type type, Iterable<Measurement> measurements) {
    super(id, type, measurements);
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:4,代码来源:CompositeCustomMeter.java

示例7: measure

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
public List<Measurement> measure() {
    return emptyList();
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:5,代码来源:NoopMeter.java

示例8: newMeter

import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
protected Meter newMeter(Id id, Type type, Iterable<Measurement> measurements) {
    return new NoopMeter(id);
}
 
开发者ID:line,项目名称:armeria,代码行数:5,代码来源:NoopMeterRegistry.java


注:本文中的io.micrometer.core.instrument.Measurement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。