本文整理了Java中org.apache.hadoop.metrics2.lib.MetricsRegistry.metrics()
方法的一些代码示例,展示了MetricsRegistry.metrics()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetricsRegistry.metrics()
方法的具体详情如下:
包路径:org.apache.hadoop.metrics2.lib.MetricsRegistry
类名称:MetricsRegistry
方法名:metrics
暂无
代码示例来源:origin: org.apache.hadoop/hadoop-common
@Override
public String toString() {
return new StringJoiner(", ", this.getClass().getSimpleName() + "{", "}")
.add("info=" + metricsInfo.toString())
.add("tags=" + tags())
.add("metrics=" + metrics())
.toString();
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
/**
* Sample all the mutable metrics and put the snapshot in the builder
* @param builder to contain the metrics snapshot
* @param all get all the metrics even if the values are not changed.
*/
public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) {
for (MetricsTag tag : tags()) {
builder.add(tag);
}
for (MutableMetric metric : metrics()) {
metric.snapshot(builder, all);
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
@Override public String toString() {
return Objects.toStringHelper(this)
.add("info", metricsInfo).add("tags", tags()).add("metrics", metrics())
.toString();
}
}
代码示例来源:origin: io.hops/hadoop-common
@Override public String toString() {
return Objects.toStringHelper(this)
.add("info", metricsInfo).add("tags", tags()).add("metrics", metrics())
.toString();
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
@Override public String toString() {
return Objects.toStringHelper(this)
.add("info", metricsInfo).add("tags", tags()).add("metrics", metrics())
.toString();
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Sample all the mutable metrics and put the snapshot in the builder
* @param builder to contain the metrics snapshot
* @param all get all the metrics even if the values are not changed.
*/
public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) {
for (MetricsTag tag : tags()) {
builder.add(tag);
}
for (MutableMetric metric : metrics()) {
metric.snapshot(builder, all);
}
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Sample all the mutable metrics and put the snapshot in the builder
* @param builder to contain the metrics snapshot
* @param all get all the metrics even if the values are not changed.
*/
public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) {
for (MetricsTag tag : tags()) {
builder.add(tag);
}
for (MutableMetric metric : metrics()) {
metric.snapshot(builder, all);
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Sample all the mutable metrics and put the snapshot in the builder
* @param builder to contain the metrics snapshot
* @param all get all the metrics even if the values are not changed.
*/
public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) {
for (MetricsTag tag : tags()) {
builder.add(tag);
}
for (MutableMetric metric : metrics()) {
metric.snapshot(builder, all);
}
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
/**
* Sample all the mutable metrics and put the snapshot in the builder
* @param builder to contain the metrics snapshot
* @param all get all the metrics even if the values are not changed.
*/
public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) {
for (MetricsTag tag : tags()) {
builder.add(tag);
}
for (MutableMetric metric : metrics()) {
metric.snapshot(builder, all);
}
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
@Override public String toString() {
return Objects.toStringHelper(this)
.add("info", metricsInfo).add("tags", tags()).add("metrics", metrics())
.toString();
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
});
assertEquals("num metrics in registry", 3, r.metrics().size());
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
});
assertEquals("num metrics in registry", 3, r.metrics().size());
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Test various factory methods
*/
@Test public void testNewMetrics() {
final MetricsRegistry r = new MetricsRegistry("test");
r.newCounter("c1", "c1 desc", 1);
r.newCounter("c2", "c2 desc", 2L);
r.newGauge("g1", "g1 desc", 3);
r.newGauge("g2", "g2 desc", 4L);
r.newStat("s1", "s1 desc", "ops", "time");
assertEquals("num metrics in registry", 5, r.metrics().size());
assertTrue("c1 found", r.get("c1") instanceof MutableCounterInt);
assertTrue("c2 found", r.get("c2") instanceof MutableCounterLong);
assertTrue("g1 found", r.get("g1") instanceof MutableGaugeInt);
assertTrue("g2 found", r.get("g2") instanceof MutableGaugeLong);
assertTrue("s1 found", r.get("s1") instanceof MutableStat);
expectMetricsException("Metric name c1 already exists", new Runnable() {
@Override
public void run() { r.newCounter("c1", "test dup", 0); }
});
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Test various factory methods
*/
@Test public void testNewMetrics() {
final MetricsRegistry r = new MetricsRegistry("test");
r.newCounter("c1", "c1 desc", 1);
r.newCounter("c2", "c2 desc", 2L);
r.newGauge("g1", "g1 desc", 3);
r.newGauge("g2", "g2 desc", 4L);
r.newStat("s1", "s1 desc", "ops", "time");
assertEquals("num metrics in registry", 5, r.metrics().size());
assertTrue("c1 found", r.get("c1") instanceof MutableCounterInt);
assertTrue("c2 found", r.get("c2") instanceof MutableCounterLong);
assertTrue("g1 found", r.get("g1") instanceof MutableGaugeInt);
assertTrue("g2 found", r.get("g2") instanceof MutableGaugeLong);
assertTrue("s1 found", r.get("s1") instanceof MutableStat);
expectMetricsException("Metric name c1 already exists", new Runnable() {
@Override
public void run() { r.newCounter("c1", "test dup", 0); }
});
}
内容来源于网络,如有侵权,请联系作者删除!