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

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

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

MetricsRegistry.checkMetricName介绍

暂无

代码示例

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

synchronized void add(String name, MutableMetric metric) {
 checkMetricName(name);
 metricsMap.put(name, metric);
}

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

public synchronized MutableRollingAverages newMutableRollingAverages(
  String name, String valueName) {
 checkMetricName(name);
 MutableRollingAverages rollingAverages =
   new MutableRollingAverages(valueName);
 metricsMap.put(name, rollingAverages);
 return rollingAverages;
}

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

public synchronized MutableRatesWithAggregation newRatesWithAggregation(
  String name) {
 checkMetricName(name);
 MutableRatesWithAggregation rates = new MutableRatesWithAggregation();
 metricsMap.put(name, rates);
 return rates;
}

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

/**
 * Create a mutable metric with stats
 * @param name  of the metric
 * @param desc  metric description
 * @param sampleName  of the metric (e.g., "Ops")
 * @param valueName   of the metric (e.g., "Time" or "Latency")
 * @param extended    produce extended stat (stdev, min/max etc.) if true.
 * @return a new mutable stat metric object
 */
public synchronized MutableStat newStat(String name, String desc,
  String sampleName, String valueName, boolean extended) {
 checkMetricName(name);
 MutableStat ret =
   new MutableStat(name, desc, sampleName, valueName, extended);
 metricsMap.put(name, ret);
 return ret;
}

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

@InterfaceAudience.Private
public synchronized MutableRate newRate(String name, String desc,
  boolean extended, boolean returnExisting) {
 if (returnExisting) {
  MutableMetric rate = metricsMap.get(name);
  if (rate != null) {
   if (rate instanceof MutableRate) return (MutableRate) rate;
   throw new MetricsException("Unexpected metrics type "+ rate.getClass()
                 +" for "+ name);
  }
 }
 checkMetricName(name);
 MutableRate ret = new MutableRate(name, desc, extended);
 metricsMap.put(name, ret);
 return ret;
}

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

/**
 * Create a mutable integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeInt newGauge(MetricsInfo info, int iVal) {
 checkMetricName(info.name());
 MutableGaugeInt ret = new MutableGaugeInt(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable long integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) {
 checkMetricName(info.name());
 MutableGaugeLong ret = new MutableGaugeLong(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable float gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeFloat newGauge(MetricsInfo info, float iVal) {
 checkMetricName(info.name());
 MutableGaugeFloat ret = new MutableGaugeFloat(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable integer counter
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new counter object
 */
public synchronized MutableCounterInt newCounter(MetricsInfo info, int iVal) {
 checkMetricName(info.name());
 MutableCounterInt ret = new MutableCounterInt(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable long integer counter
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new counter object
 */
public synchronized
MutableCounterLong newCounter(MetricsInfo info, long iVal) {
 checkMetricName(info.name());
 MutableCounterLong ret = new MutableCounterLong(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable metric that estimates quantiles of a stream of values
 * @param name of the metric
 * @param desc metric description
 * @param sampleName of the metric (e.g., "Ops")
 * @param valueName of the metric (e.g., "Time" or "Latency")
 * @param interval rollover interval of estimator in seconds
 * @return a new quantile estimator object
 * @throws MetricsException if interval is not a positive integer
 */
public synchronized MutableQuantiles newQuantiles(String name, String desc,
  String sampleName, String valueName, int interval) {
 checkMetricName(name);
 if (interval <= 0) {
  throw new MetricsException("Interval should be positive.  Value passed" +
    " is: " + interval);
 }
 MutableQuantiles ret =
   new MutableQuantiles(name, desc, sampleName, valueName, interval);
 metricsMap.put(name, ret);
 return ret;
}

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

public synchronized MutableRatesWithAggregation newRatesWithAggregation(
  String name) {
 checkMetricName(name);
 MutableRatesWithAggregation rates = new MutableRatesWithAggregation();
 metricsMap.put(name, rates);
 return rates;
}

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

public synchronized MutableRatesWithAggregation newRatesWithAggregation(
  String name) {
 checkMetricName(name);
 MutableRatesWithAggregation rates = new MutableRatesWithAggregation();
 metricsMap.put(name, rates);
 return rates;
}

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

/**
 * Create a mutable integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeInt newGauge(MetricsInfo info, int iVal) {
 checkMetricName(info.name());
 MutableGaugeInt ret = new MutableGaugeInt(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable long integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) {
 checkMetricName(info.name());
 MutableGaugeLong ret = new MutableGaugeLong(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable long integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) {
 checkMetricName(info.name());
 MutableGaugeLong ret = new MutableGaugeLong(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable long integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) {
 checkMetricName(info.name());
 MutableGaugeLong ret = new MutableGaugeLong(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable long integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) {
 checkMetricName(info.name());
 MutableGaugeLong ret = new MutableGaugeLong(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable integer gauge
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new gauge object
 */
public synchronized MutableGaugeInt newGauge(MetricsInfo info, int iVal) {
 checkMetricName(info.name());
 MutableGaugeInt ret = new MutableGaugeInt(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

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

/**
 * Create a mutable integer counter
 * @param info  metadata of the metric
 * @param iVal  initial value
 * @return a new counter object
 */
public synchronized MutableCounterInt newCounter(MetricsInfo info, int iVal) {
 checkMetricName(info.name());
 MutableCounterInt ret = new MutableCounterInt(info, iVal);
 metricsMap.put(info.name(), ret);
 return ret;
}

相关文章