org.apache.hadoop.metrics2.lib.MetricsRegistry.add()方法的使用及代码示例

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

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

MetricsRegistry.add介绍

[英]Add sample to a stat metric by name.
[中]按名称将样本添加到统计指标。

代码示例

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

/**
 * Add a rate sample for a rate metric
 * @param name of the rate metric
 * @param elapsed time
 */
public void add(String name, long elapsed) {
 registry.add(name, elapsed);
}

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

/**
 * Add sample to a stat metric by name.
 * @param name  of the metric
 * @param value of the snapshot to add
 */
public synchronized void add(String name, long value) {
 MutableMetric m = metricsMap.get(name);
 if (m != null) {
  if (m instanceof MutableStat) {
   ((MutableStat) m).add(value);
  }
  else {
   throw new MetricsException("Unsupported add(value) for metric "+ name);
  }
 }
 else {
  metricsMap.put(name, newRate(name)); // default is a rate metric
  add(name, value);
 }
}

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

MutableMetric newForMethod(Object source, Method method, Metric annotation,
              MetricsRegistry registry) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("method "+ method +" with annotation "+ annotation);
 }
 MetricsInfo info = getInfo(annotation, method);
 MutableMetric metric = newForMethod(source, method, annotation);
 metric = metric != null ? metric :
   new MethodMetric(source, method, info, annotation.type());
 registry.add(info.name(), metric);
 return metric;
}

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

@Override
public void add(String name, long time) {
 registry.add(name, time);
}

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

MutableMetric metric = newForField(field, annotation);
if (metric != null) {
 registry.add(info.name(), metric);
 return metric;

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

protected void snapshot() {
 // Only add these metrics if the replication table is online and there are peers
 if (TableState.ONLINE == Tables.getTableState(master.getContext(), ReplicationTable.ID)
   && !replicationUtil.getPeers().isEmpty()) {
  registry.add(PENDING_FILES, getNumFilesPendingReplication());
  addReplicationQueueTimeMetrics();
 } else {
  registry.add(PENDING_FILES, 0);
 }
 registry.add(NUM_PEERS, getNumConfiguredPeers());
 registry.add(MAX_REPLICATION_THREADS, getMaxReplicationThreads());
}

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

/**
 * Add a rate sample for a rate metric
 * @param name of the rate metric
 * @param elapsed time
 */
public void add(String name, long elapsed) {
 registry.add(name, elapsed);
}

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

/**
 * Add a rate sample for a rate metric
 * @param name of the rate metric
 * @param elapsed time
 */
public void add(String name, long elapsed) {
 registry.add(name, elapsed);
}

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

/**
 * Add a rate sample for a rate metric
 * @param name of the rate metric
 * @param elapsed time
 */
public void add(String name, long elapsed) {
 registry.add(name, elapsed);
}

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

/**
 * Add a rate sample for a rate metric
 * @param name of the rate metric
 * @param elapsed time
 */
public void add(String name, long elapsed) {
 registry.add(name, elapsed);
}

代码示例来源:origin: org.apache.accumulo/accumulo-server-base

@Override
public void add(String name, long time) {
 registry.add(name, time);
}

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

@Override
 public void run() { r.add("c1", 42); }
});

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

@Override
 public void run() { r.add("g1", 42); }
});

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

@Override
 public void run() { r.add("c1", 42); }
});

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

@Override
 public void run() { r.add("g1", 42); }
});

代码示例来源:origin: org.apache.accumulo/accumulo-master

protected void snapshot() {
 // Only add these metrics if the replication table is online and there are peers
 if (TableState.ONLINE == Tables.getTableState(master.getInstance(), ReplicationTable.ID)
   && !replicationUtil.getPeers().isEmpty()) {
  registry.add(PENDING_FILES, getNumFilesPendingReplication());
  addReplicationQueueTimeMetrics();
 } else {
  registry.add(PENDING_FILES, 0);
 }
 registry.add(NUM_PEERS, getNumConfiguredPeers());
 registry.add(MAX_REPLICATION_THREADS, getMaxReplicationThreads());
}

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

MutableMetric newForMethod(Object source, Method method, Metric annotation,
              MetricsRegistry registry) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("method "+ method +" with annotation "+ annotation);
 }
 MetricsInfo info = getInfo(annotation, method);
 MutableMetric metric = newForMethod(source, method, annotation);
 metric = metric != null ? metric :
   new MethodMetric(source, method, info, annotation.type());
 registry.add(info.name(), metric);
 return metric;
}

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

MutableMetric newForMethod(Object source, Method method, Metric annotation,
              MetricsRegistry registry) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("method "+ method +" with annotation "+ annotation);
 }
 MetricsInfo info = getInfo(annotation, method);
 MutableMetric metric = newForMethod(source, method, annotation);
 metric = metric != null ? metric :
   new MethodMetric(source, method, info, annotation.type());
 registry.add(info.name(), metric);
 return metric;
}

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

MutableMetric newForMethod(Object source, Method method, Metric annotation,
              MetricsRegistry registry) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("method "+ method +" with annotation "+ annotation);
 }
 MetricsInfo info = getInfo(annotation, method);
 MutableMetric metric = newForMethod(source, method, annotation);
 metric = metric != null ? metric :
   new MethodMetric(source, method, info, annotation.type());
 registry.add(info.name(), metric);
 return metric;
}

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

MutableMetric newForMethod(Object source, Method method, Metric annotation,
              MetricsRegistry registry) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("method "+ method +" with annotation "+ annotation);
 }
 MetricsInfo info = getInfo(annotation, method);
 MutableMetric metric = newForMethod(source, method, annotation);
 metric = metric != null ? metric :
   new MethodMetric(source, method, info, annotation.type());
 registry.add(info.name(), metric);
 return metric;
}

相关文章