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


Java MutableGaugeLong类代码示例

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


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

示例1: testSetGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
@Test
public void testSetGauge() throws Exception {
  bmsi.setGauge("testset", 100);
  assertEquals(100, ((MutableGaugeLong) bmsi.metricsRegistry.get("testset")).value());
  bmsi.setGauge("testset", 300);
  assertEquals(300, ((MutableGaugeLong) bmsi.metricsRegistry.get("testset")).value());

}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TestBaseSourceImpl.java

示例2: testIncGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
@Test
public void testIncGauge() throws Exception {
  bmsi.incGauge("testincgauge", 100);
  assertEquals(100, ((MutableGaugeLong) bmsi.metricsRegistry.get("testincgauge")).value());
  bmsi.incGauge("testincgauge", 100);
  assertEquals(200, ((MutableGaugeLong) bmsi.metricsRegistry.get("testincgauge")).value());

}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TestBaseSourceImpl.java

示例3: testDecGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
@Test
public void testDecGauge() throws Exception {
  bmsi.decGauge("testdec", 100);
  assertEquals(-100, ((MutableGaugeLong) bmsi.metricsRegistry.get("testdec")).value());
  bmsi.decGauge("testdec", 100);
  assertEquals(-200, ((MutableGaugeLong) bmsi.metricsRegistry.get("testdec")).value());

}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TestBaseSourceImpl.java

示例4: clearMetricIfNotNull

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
private static void clearMetricIfNotNull(MutableGaugeLong metric) {
  if (metric != null) {
    metric.set(0L);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:6,代码来源:MetricsZooKeeperSourceImpl.java

示例5: setGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
/**
 * Set a single gauge to a value.
 *
 * @param gaugeName gauge name
 * @param value     the new value of the gauge.
 */
public void setGauge(String gaugeName, long value) {
  MutableGaugeLong gaugeInt = metricsRegistry.getLongGauge(gaugeName, value);
  gaugeInt.set(value);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:BaseSourceImpl.java

示例6: incGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
/**
 * Add some amount to a gauge.
 *
 * @param gaugeName The name of the gauge to increment.
 * @param delta     The amount to increment the gauge by.
 */
public void incGauge(String gaugeName, long delta) {
  MutableGaugeLong gaugeInt = metricsRegistry.getLongGauge(gaugeName, 0l);
  gaugeInt.incr(delta);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:BaseSourceImpl.java

示例7: decGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
/**
 * Decrease the value of a named gauge.
 *
 * @param gaugeName The name of the gauge.
 * @param delta     the ammount to subtract from a gauge value.
 */
public void decGauge(String gaugeName, long delta) {
  MutableGaugeLong gaugeInt = metricsRegistry.getLongGauge(gaugeName, 0l);
  gaugeInt.decr(delta);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:BaseSourceImpl.java

示例8: setGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
/**
 * Set a single gauge to a value.
 *
 * @param gaugeName gauge name
 * @param value     the new value of the gauge.
 */
public void setGauge(String gaugeName, long value) {
  MutableGaugeLong gaugeInt = metricsRegistry.getGauge(gaugeName, value);
  gaugeInt.set(value);
}
 
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:BaseSourceImpl.java

示例9: incGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
/**
 * Add some amount to a gauge.
 *
 * @param gaugeName The name of the gauge to increment.
 * @param delta     The amount to increment the gauge by.
 */
public void incGauge(String gaugeName, long delta) {
  MutableGaugeLong gaugeInt = metricsRegistry.getGauge(gaugeName, 0l);
  gaugeInt.incr(delta);
}
 
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:BaseSourceImpl.java

示例10: decGauge

import org.apache.hadoop.metrics2.lib.MutableGaugeLong; //导入依赖的package包/类
/**
 * Decrease the value of a named gauge.
 *
 * @param gaugeName The name of the gauge.
 * @param delta     the ammount to subtract from a gauge value.
 */
public void decGauge(String gaugeName, long delta) {
  MutableGaugeLong gaugeInt = metricsRegistry.getGauge(gaugeName, 0l);
  gaugeInt.decr(delta);
}
 
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:BaseSourceImpl.java


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