当前位置: 首页>>代码示例>>Java>>正文


Java MetricSampleQuantiles类代码示例

本文整理汇总了Java中org.apache.hadoop.metrics2.util.MetricSampleQuantiles的典型用法代码示例。如果您正苦于以下问题:Java MetricSampleQuantiles类的具体用法?Java MetricSampleQuantiles怎么用?Java MetricSampleQuantiles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MetricSampleQuantiles类属于org.apache.hadoop.metrics2.util包,在下文中一共展示了MetricSampleQuantiles类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MetricMutableQuantiles

import org.apache.hadoop.metrics2.util.MetricSampleQuantiles; //导入依赖的package包/类
/**
 * Instantiates a new {@link MetricMutableQuantiles} for a metric that rolls itself over on the
 * specified time interval.
 *
 * @param name        of the metric
 * @param description long-form textual description of the metric
 * @param sampleName  type of items in the stream (e.g., "Ops")
 * @param valueName   type of the values
 * @param interval    rollover interval (in seconds) of the estimator
 */
public MetricMutableQuantiles(String name, String description, String sampleName,
                              String valueName, int interval) {
  String ucName = StringUtils.capitalize(name);
  String usName = StringUtils.capitalize(sampleName);
  String uvName = StringUtils.capitalize(valueName);
  String desc = StringUtils.uncapitalize(description);
  String lsName = StringUtils.uncapitalize(sampleName);
  String lvName = StringUtils.uncapitalize(valueName);

  numInfo = info(ucName + "Num" + usName, String.format(
      "Number of %s for %s with %ds interval", lsName, desc, interval));
  // Construct the MetricsInfos for the quantiles, converting to percentiles
  quantileInfos = new MetricsInfo[quantiles.length];
  String nameTemplate = "%s%dthPercentile%dsInterval%s";
  String descTemplate = "%d percentile %s with %d second interval for %s";
  for (int i = 0; i < quantiles.length; i++) {
    int percentile = (int) (100 * quantiles[i].quantile);
    quantileInfos[i] = info(String.format(nameTemplate, ucName, percentile, interval, uvName),
        String.format(descTemplate, percentile, lvName, interval, desc));
  }

  estimator = new MetricSampleQuantiles(quantiles);
  executor = new MetricsExecutorImpl();
  this.interval = interval;
  executor.getExecutor().scheduleAtFixedRate(new RolloverSample(this),
      interval,
      interval,
      TimeUnit.SECONDS);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:40,代码来源:MetricMutableQuantiles.java

示例2: MetricMutableQuantiles

import org.apache.hadoop.metrics2.util.MetricSampleQuantiles; //导入依赖的package包/类
/**
 * Instantiates a new {@link MetricMutableQuantiles} for a metric that rolls itself over on the
 * specified time interval.
 *
 * @param name        of the metric
 * @param description long-form textual description of the metric
 * @param sampleName  type of items in the stream (e.g., "Ops")
 * @param valueName   type of the values
 * @param interval    rollover interval (in seconds) of the estimator
 */
public MetricMutableQuantiles(String name, String description, String sampleName,
                              String valueName, int interval) {
  super(name, description);

  estimator = new MetricSampleQuantiles(quantiles);

  executor = new MetricsExecutorImpl();

  this.interval = interval;
  executor.getExecutor().scheduleAtFixedRate(new RolloverSample(this),
      interval,
      interval,
      TimeUnit.SECONDS);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:25,代码来源:MetricMutableQuantiles.java

示例3: MetricMutableQuantiles

import org.apache.hadoop.metrics2.util.MetricSampleQuantiles; //导入依赖的package包/类
/**
 * Instantiates a new {@link MetricMutableQuantiles} for a metric that rolls itself over on the
 * specified time interval.
 *
 * @param name        of the metric
 * @param description long-form textual description of the metric
 * @param sampleName  type of items in the stream (e.g., "Ops")
 * @param valueName   type of the values
 * @param interval    rollover interval (in seconds) of the estimator
 */
public MetricMutableQuantiles(String name, String description, String sampleName,
                              String valueName, int interval) {
  String ucName = StringUtils.capitalize(name);
  String usName = StringUtils.capitalize(sampleName);
  String uvName = StringUtils.capitalize(valueName);
  String desc = StringUtils.uncapitalize(description);
  String lsName = StringUtils.uncapitalize(sampleName);
  String lvName = StringUtils.uncapitalize(valueName);

  numInfo = info(ucName + "Num" + usName, String.format(
      "Number of %s for %s with %ds interval", lsName, desc, interval));
  // Construct the MetricsInfos for the quantiles, converting to percentiles
  quantileInfos = new MetricsInfo[quantiles.length];
  String nameTemplate = ucName + "%dthPercentile" + interval + "sInterval"
      + uvName;
  String descTemplate = "%d percentile " + lvName + " with " + interval
      + " second interval for " + desc;
  for (int i = 0; i < quantiles.length; i++) {
    int percentile = (int) (100 * quantiles[i].quantile);
    quantileInfos[i] = info(String.format(nameTemplate, percentile),
        String.format(descTemplate, percentile));
  }

  estimator = new MetricSampleQuantiles(quantiles);
  executor = new MetricsExecutorImpl();
  this.interval = interval;
  executor.getExecutor().scheduleAtFixedRate(new RolloverSample(this),
      interval,
      interval,
      TimeUnit.SECONDS);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:42,代码来源:MetricMutableQuantiles.java


注:本文中的org.apache.hadoop.metrics2.util.MetricSampleQuantiles类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。