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


Java UniformSample类代码示例

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


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

示例1: MetricsHistogram

import com.yammer.metrics.stats.UniformSample; //导入依赖的package包/类
/**
 * Constructor to create a new histogram metric
 * @param nam           the name to publish the metric under
 * @param registry      where the metrics object will be registered
 * @param description   the metric's description
 * @param forwardBiased true if you want this histogram to give more 
 *                      weight to recent data, 
 *                      false if you want all data to have uniform weight
 */
public MetricsHistogram(final String nam, final MetricsRegistry registry, 
    final String description, boolean forwardBiased) {
  super(nam, description);

  this.min = new AtomicLong();
  this.max = new AtomicLong();
  this.sum = new AtomicLong();
  this.sample = forwardBiased ? 
      new ExponentiallyDecayingSample(DEFAULT_SAMPLE_SIZE, DEFAULT_ALPHA) 
  : new UniformSample(DEFAULT_SAMPLE_SIZE);

  this.variance =  new AtomicReference<double[]>(new double[]{-1, 0});
  this.count = new AtomicLong();

  this.clear();

  if (registry != null) {
    registry.add(nam, this);      
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:30,代码来源:MetricsHistogram.java

示例2: testSetup

import com.yammer.metrics.stats.UniformSample; //导入依赖的package包/类
void testSetup() throws IOException {
  if (!opts.oneCon) {
    this.connection = ConnectionFactory.createConnection(conf);
  }
  onStartup();
  latency = YammerHistogramUtils.newHistogram(new UniformSample(1024 * 500));
  valueSize = YammerHistogramUtils.newHistogram(new UniformSample(1024 * 500));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:PerformanceEvaluation.java

示例3: testSetup

import com.yammer.metrics.stats.UniformSample; //导入依赖的package包/类
void testSetup() throws IOException {
  this.connection = HConnectionManager.createConnection(conf);
  this.table = connection.getTable(opts.tableName);
  this.table.setAutoFlush(opts.autoFlush, true);

  try {
    Constructor<?> ctor =
        Histogram.class.getDeclaredConstructor(com.yammer.metrics.stats.Sample.class);
    ctor.setAccessible(true);
    latency = (Histogram) ctor.newInstance(new UniformSample(1024 * 500));
  } catch (Exception e) {
    throw new RuntimeException(e);
  }

}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:16,代码来源:PerformanceEvaluation.java


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