org.apache.hadoop.metrics2.annotation.Metrics类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(333)

本文整理了Java中org.apache.hadoop.metrics2.annotation.Metrics类的一些代码示例,展示了Metrics类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metrics类的具体详情如下:
包路径:org.apache.hadoop.metrics2.annotation.Metrics
类名称:Metrics

Metrics介绍

暂无

代码示例

代码示例来源:origin: apache/hive

@Metrics(about = "LlapDaemon JVM Metrics", context = "jvm")
public class LlapDaemonJvmMetrics implements MetricsSource {
 private final String name;

代码示例来源:origin: org.apache.hadoop/hadoop-common

protected MetricsInfo getInfo(Class<?> cls, Metrics annotation) {
 String name = annotation.name();
 String about = annotation.about();
 String name2 = name.isEmpty() ? cls.getSimpleName() : name;
 return Interns.info(name2, about.isEmpty() ? name2 : about);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

private MetricsRegistry initRegistry(Object source) {
 Class<?> cls = source.getClass();
 MetricsRegistry r = null;
 // Get the registry if it already exists.
 for (Field field : ReflectionUtils.getDeclaredFieldsIncludingInherited(cls)) {
  if (field.getType() != MetricsRegistry.class) continue;
  try {
   field.setAccessible(true);
   r = (MetricsRegistry) field.get(source);
   hasRegistry = r != null;
   break;
  } catch (Exception e) {
   LOG.warn("Error accessing field "+ field, e);
   continue;
  }
 }
 // Create a new registry according to annotation
 for (Annotation annotation : cls.getAnnotations()) {
  if (annotation instanceof Metrics) {
   Metrics ma = (Metrics) annotation;
   info = factory.getInfo(cls, ma);
   if (r == null) {
    r = new MetricsRegistry(info);
   }
   r.setContext(ma.context());
  }
 }
 if (r == null) return new MetricsRegistry(cls.getSimpleName());
 return r;
}

代码示例来源:origin: apache/hive

@Metrics(about = "LlapDaemon IO Metrics", context = "io")
public class LlapDaemonIOMetrics implements MetricsSource {
 protected static final Logger LOG = LoggerFactory.getLogger(LlapDaemonIOMetrics.class);

代码示例来源:origin: ch.cern.hadoop/hadoop-common

protected MetricsInfo getInfo(Class<?> cls, Metrics annotation) {
 String name = annotation.name();
 String about = annotation.about();
 String name2 = name.isEmpty() ? cls.getSimpleName() : name;
 return Interns.info(name2, about.isEmpty() ? name2 : about);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

r = new MetricsRegistry(info);
r.setContext(ma.context());

代码示例来源:origin: apache/hive

@Metrics(about="Shuffle output metrics", context="mapred")
static class ShuffleMetrics implements ChannelFutureListener {
 @Metric("Shuffle output in bytes")
 MutableCounterLong shuffleOutputBytes;
 @Metric("# of failed shuffle outputs")
 MutableCounterInt shuffleOutputsFailed;
 @Metric("# of succeeded shuffle outputs")
 MutableCounterInt shuffleOutputsOK;
 @Metric("# of current shuffle connections")
 MutableGaugeInt shuffleConnections;
 @Override
 public void operationComplete(ChannelFuture future) throws Exception {
  if (future.isSuccess()) {
   shuffleOutputsOK.incr();
  } else {
   shuffleOutputsFailed.incr();
  }
  shuffleConnections.decr();
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

protected MetricsInfo getInfo(Class<?> cls, Metrics annotation) {
 String name = annotation.name();
 String about = annotation.about();
 String name2 = name.isEmpty() ? cls.getSimpleName() : name;
 return Interns.info(name2, about.isEmpty() ? name2 : about);
}

代码示例来源:origin: io.hops/hadoop-common

r = new MetricsRegistry(info);
r.setContext(ma.context());

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Metrics(about="Per method RPC metrics", context="rpcdetailed")
public class RpcDetailedMetrics {

代码示例来源:origin: io.hops/hadoop-common

protected MetricsInfo getInfo(Class<?> cls, Metrics annotation) {
 String name = annotation.name();
 String about = annotation.about();
 String name2 = name.isEmpty() ? cls.getSimpleName() : name;
 return Interns.info(name2, about.isEmpty() ? name2 : about);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

r = new MetricsRegistry(info);
r.setContext(ma.context());

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Metrics(about="Aggregate RetryCache metrics", context="rpc")
public class RetryCacheMetrics {

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

protected MetricsInfo getInfo(Class<?> cls, Metrics annotation) {
 String name = annotation.name();
 String about = annotation.about();
 String name2 = name.isEmpty() ? cls.getSimpleName() : name;
 return Interns.info(name2, about.isEmpty() ? name2 : about);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

r = new MetricsRegistry(info);
r.setContext(ma.context());

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Metrics(about="User and group related metrics", context="ugi")
static class UgiMetrics {
 final MetricsRegistry registry = new MetricsRegistry("UgiMetrics");

代码示例来源:origin: apache/kylin

@Metrics(name = "Query", about = "Query metrics", context = "Kylin")
public class QueryMetrics {

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Metrics(context="metricssystem")
public class MetricsSystemImpl extends MetricsSystem implements MetricsSource {

代码示例来源:origin: apache/hive

@Metrics(about = "LlapDaemon Cache Metrics", context = "cache")
public class LlapDaemonCacheMetrics implements MetricsSource {
 final String name;

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

@Metrics(about="Journal client metrics", context="dfs")
class IPCLoggerChannelMetrics {
 final MetricsRegistry registry = new MetricsRegistry("NameNode");

相关文章

微信公众号

最新文章

更多