本文整理汇总了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();
}
示例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)
);
}
示例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);
}
示例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;
}
示例5: measure
import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
public Iterable<Measurement> measure() {
return measurements;
}
示例6: CompositeCustomMeter
import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
CompositeCustomMeter(Id id, Type type, Iterable<Measurement> measurements) {
super(id, type, measurements);
}
示例7: measure
import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
public List<Measurement> measure() {
return emptyList();
}
示例8: newMeter
import io.micrometer.core.instrument.Measurement; //导入依赖的package包/类
@Override
protected Meter newMeter(Id id, Type type, Iterable<Measurement> measurements) {
return new NoopMeter(id);
}