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


Java MetricProcessor类代码示例

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


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

示例1: processWith

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
@Override
public <T2> void processWith(MetricProcessor<T2> processor, MetricName name, T2 context) throws Exception {
  for (T h : _histograms) {
    if (h instanceof Metric) {
      ((Metric) h).processWith(processor, name, context);
    }
  }
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:9,代码来源:AggregatedHistogram.java

示例2: createCounter

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
static Counter createCounter(long count) throws Exception {
  final Counter mock = mock(Counter.class);
  when(mock.count()).thenReturn(count);
  return configureMatcher(mock, doAnswer(new MetricsProcessorAction() {
    @Override
    void delegateToProcessor(MetricProcessor<Object> processor, MetricName name, Object context) throws Exception {
      processor.processCounter(name, mock, context);
    }
  }));
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:11,代码来源:StatsDReporterTest.java

示例3: createHistogram

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
static Histogram createHistogram() throws Exception {
  final Histogram mock = mock(Histogram.class);
  setupSummarizableMock(mock);
  setupSamplingMock(mock);
  return configureMatcher(mock, doAnswer(new MetricsProcessorAction() {
    @Override
    void delegateToProcessor(MetricProcessor<Object> processor, MetricName name, Object context) throws Exception {
      processor.processHistogram(name, mock, context);
    }
  }));
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:12,代码来源:StatsDReporterTest.java

示例4: createGauge

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
static Gauge<Object> createGauge(Object value) throws Exception {
  @SuppressWarnings("unchecked")
  final Gauge<Object> mock = mock(Gauge.class);
  when(mock.value()).thenReturn(value);
  return configureMatcher(mock, doAnswer(new MetricsProcessorAction() {
    @Override
    void delegateToProcessor(MetricProcessor<Object> processor, MetricName name, Object context) throws Exception {
      processor.processGauge(name, mock, context);
    }
  }));
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:12,代码来源:StatsDReporterTest.java

示例5: createTimer

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
static Timer createTimer() throws Exception {
  final Timer mock = mock(Timer.class);
  when(mock.durationUnit()).thenReturn(TimeUnit.MILLISECONDS);
  setupSummarizableMock(mock);
  setupMeteredMock(mock);
  setupSamplingMock(mock);
  return configureMatcher(mock, doAnswer(new MetricsProcessorAction() {
    @Override
    void delegateToProcessor(MetricProcessor<Object> processor, MetricName name, Object context) throws Exception {
      processor.processTimer(name, mock, context);
    }
  }));
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:14,代码来源:StatsDReporterTest.java

示例6: createMeter

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
static Meter createMeter() throws Exception {
  final Meter mock = mock(Meter.class);
  setupMeteredMock(mock);
  return configureMatcher(mock, doAnswer(new MetricsProcessorAction() {
    @Override
    void delegateToProcessor(MetricProcessor<Object> processor, MetricName name, Object context) throws Exception {
      processor.processMeter(name, mock, context);
    }
  }));
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:11,代码来源:StatsDReporterTest.java

示例7: answer

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
  @SuppressWarnings("unchecked")
  final MetricProcessor<Object> processor = (MetricProcessor<Object>) invocation.getArguments()[0];
  final MetricName name = (MetricName) invocation.getArguments()[1];
  final Object context = invocation.getArguments()[2];
  delegateToProcessor(processor, name, context);
  return null;
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:10,代码来源:StatsDReporterTest.java

示例8: processWith

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
@Override
public <T2> void processWith(MetricProcessor<T2> processor, MetricName name, T2 context) throws Exception {
  for (T m : _meters) {
    m.processWith(processor, name, context);
  }
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:7,代码来源:AggregatedMeter.java

示例9: processWith

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
@Override
public <T> void processWith(MetricProcessor<T> processor, MetricName name, T context) throws Exception {
  for (Metric c : _counters)
    c.processWith(processor, name, context);
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:6,代码来源:AggregatedCounter.java

示例10: configureMatcher

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
static <T extends Metric> T configureMatcher(T mock, Stubber stub) throws Exception {
  stub.when(mock).processWith(any(MetricProcessor.class), any(MetricName.class), any());
  return mock;
}
 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:6,代码来源:StatsDReporterTest.java

示例11: delegateToProcessor

import com.yammer.metrics.core.MetricProcessor; //导入依赖的package包/类
abstract void delegateToProcessor(MetricProcessor<Object> processor, MetricName name, Object context) throws Exception; 
开发者ID:airbnb,项目名称:kafka-statsd-metrics2,代码行数:2,代码来源:StatsDReporterTest.java


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