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


Java MutableStat类代码示例

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


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

示例1: getCacheRefresh

import org.apache.hadoop.metrics2.lib.MutableStat; //导入依赖的package包/类
MutableStat getCacheRefresh() {
  return cacheRefresh;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:4,代码来源:EntityGroupFSTimelineStoreMetrics.java

示例2: testPluginRead

import org.apache.hadoop.metrics2.lib.MutableStat; //导入依赖的package包/类
@Test
public void testPluginRead() throws Exception {
  // Verify precondition
  assertEquals(EntityGroupPlugInForTest.class.getName(),
      store.getConfig().get(
          YarnConfiguration.TIMELINE_SERVICE_ENTITY_GROUP_PLUGIN_CLASSES));
  // Load data and cache item, prepare timeline store by making a cache item
  EntityGroupFSTimelineStore.AppLogs appLogs =
      store.new AppLogs(mainTestAppId, mainTestAppDirPath,
      AppState.COMPLETED);
  EntityCacheItem cacheItem = new EntityCacheItem(
      EntityGroupPlugInForTest.getStandardTimelineGroupId(mainTestAppId),
      config);
  cacheItem.setAppLogs(appLogs);
  store.setCachedLogs(
      EntityGroupPlugInForTest.getStandardTimelineGroupId(mainTestAppId),
      cacheItem);
  MutableCounterLong detailLogEntityRead =
      store.metrics.getGetEntityToDetailOps();
  MutableStat cacheRefresh = store.metrics.getCacheRefresh();
  long numEntityReadBefore = detailLogEntityRead.value();
  long cacheRefreshBefore = cacheRefresh.lastStat().numSamples();

  // Generate TDM
  TimelineDataManager tdm
      = PluginStoreTestUtils.getTdmWithStore(config, store);

  // Verify single entity read
  TimelineEntity entity3 = tdm.getEntity("type_3", mainTestAppId.toString(),
      EnumSet.allOf(TimelineReader.Field.class),
      UserGroupInformation.getLoginUser());
  assertNotNull(entity3);
  assertEquals(entityNew.getStartTime(), entity3.getStartTime());
  // Verify multiple entities read
  NameValuePair primaryFilter = new NameValuePair(
      EntityGroupPlugInForTest.APP_ID_FILTER_NAME, mainTestAppId.toString());
  TimelineEntities entities = tdm.getEntities("type_3", primaryFilter, null,
      null, null, null, null, null, EnumSet.allOf(TimelineReader.Field.class),
      UserGroupInformation.getLoginUser());
  assertEquals(1, entities.getEntities().size());
  for (TimelineEntity entity : entities.getEntities()) {
    assertEquals(entityNew.getStartTime(), entity.getStartTime());
  }
  // Verify metrics
  assertEquals(numEntityReadBefore + 2L, detailLogEntityRead.value());
  assertEquals(cacheRefreshBefore + 1L, cacheRefresh.lastStat().numSamples());
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:48,代码来源:TestEntityGroupFSTimelineStore.java

示例3: incMethodTime

import org.apache.hadoop.metrics2.lib.MutableStat; //导入依赖的package包/类
@Override
public void incMethodTime(String name, long time) {
  MutableStat s = getMetricsRegistry().newRate(name);
  s.add(time);
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:6,代码来源:MetricsThriftServerSourceImpl.java


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