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


Java JvmMetrics类代码示例

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


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

示例1: MasterMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public MasterMetrics(final String name) {
  MetricsContext context = MetricsUtil.getContext("hbase");
  metricsRecord = MetricsUtil.createRecord(context, "master");
  metricsRecord.setTag("Master", name);
  context.registerUpdater(this);
  JvmMetrics.init("Master", name);
  HBaseInfo.init();

  // expose the MBean for metrics
  masterStatistics = new MasterStatistics(this.registry);

  // get custom attributes
  try {
    Object m = 
      ContextFactory.getFactory().getAttribute("hbase.extendedperiod");
    if (m instanceof String) {
      this.extendedPeriod = Long.parseLong((String) m)*1000;
    }
  } catch (IOException ioe) {
    LOG.info("Couldn't load ContextFactory for Metrics config info");
  }

  LOG.info("Initialized");
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:25,代码来源:MasterMetrics.java

示例2: RegionServerMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public RegionServerMetrics() {
  MetricsContext context = MetricsUtil.getContext("hbase");
  metricsRecord = MetricsUtil.createRecord(context, "regionserver");
  String name = Thread.currentThread().getName();
  metricsRecord.setTag("RegionServer", name);
  context.registerUpdater(this);
  // Add jvmmetrics.
  JvmMetrics.init("RegionServer", name);
  // Add Hbase Info metrics
  HBaseInfo.init();

  // export for JMX
  statistics = new RegionServerStatistics(this.registry, name);

  // get custom attributes
  try {
    Object m = ContextFactory.getFactory().getAttribute("hbase.extendedperiod");
    if (m instanceof String) {
      this.extendedPeriod = Long.parseLong((String) m)*1000;
    }
  } catch (IOException ioe) {
    LOG.info("Couldn't load ContextFactory for Metrics config info");
  }

  LOG.info("Initialized");
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:27,代码来源:RegionServerMetrics.java

示例3: NamespaceNotifierMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public NamespaceNotifierMetrics(Configuration conf, String serverId) {
  String sessionId = conf.get("session.id"); 
  JvmMetrics.init("NamespaceNotifier", sessionId);
  
  notifierActivityMBean = new NamespaceNotifierActivityMBean(registry,
      "" + serverId);
  
  MetricsContext context = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(context, "namespacenotifier");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);

  LOG.info("Initializing NamespaceNotifierMetrics using context object:" +
      context.getClass().getName() + " and record: " +
      metricsRecord.getClass().getCanonicalName());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:17,代码来源:NamespaceNotifierMetrics.java

示例4: NameNodeMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public NameNodeMetrics(Configuration conf, NameNode nameNode) {
  String sessionId = conf.get("session.id");
  // Initiate Java VM metrics
  JvmMetrics.init("NameNode", sessionId);

  
  // Now the Mbean for the name node - this alos registers the MBean
  namenodeActivityMBean = new NameNodeActivtyMBean(registry);
  
  // Create a record for NameNode metrics
  MetricsContext metricsContext = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(metricsContext, "namenode");
  metricsRecord.setTag("sessionId", sessionId);
  metricsContext.registerUpdater(this);
  log.info("Initializing NameNodeMeterics using context object:" +
            metricsContext.getClass().getName());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:18,代码来源:NameNodeMetrics.java

示例5: HighTideNodeMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public HighTideNodeMetrics(Configuration conf, HighTideNode hightideNode) {
  String sessionId = conf.get("session.id");
  // Initiate Java VM metrics
  JvmMetrics.init("HighTideNode", sessionId);


  // Now the Mbean for the name node - this also registers the MBean
  hightidenodeActivityMBean = new HighTideNodeActivityMBean(registry);

  // Create a record for HighTideNode metrics
  MetricsContext metricsContext = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(metricsContext, "hightidenode");
  metricsRecord.setTag("sessionId", sessionId);
  metricsContext.registerUpdater(this);
  LOG.info("Initializing HighTideNodeMetrics using context object:" +
            metricsContext.getClass().getName());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:18,代码来源:HighTideNodeMetrics.java

示例6: JournalNodeMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public JournalNodeMetrics(Configuration conf, String serverId) {
  String sessionId = conf.get("session.id"); 
  JvmMetrics.init("JournalNode", sessionId);
  
  journalNodeActivityMBean = new JournalNodeActivityMBean(registry,
      "" + serverId);
  
  MetricsContext context = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(context, "journalnode");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);

  LOG.info("Initializing JournalNodeMetrics using context object:" +
      context.getClass().getName() + " and record: " +
      metricsRecord.getClass().getCanonicalName());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:17,代码来源:JournalNodeMetrics.java

示例7: NameNodeMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public NameNodeMetrics(Configuration conf, NamenodeRole nameNodeRole) {
  String sessionId = conf.get(DFSConfigKeys.DFS_METRICS_SESSION_ID_KEY);
  // Initiate Java VM metrics
  String processName = nameNodeRole.toString();
  JvmMetrics.init(processName, sessionId);

  // Now the Mbean for the name node - this also registers the MBean
  namenodeActivityMBean = new NameNodeActivityMBean(registry);
  
  // Create a record for NameNode metrics
  MetricsContext metricsContext = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(metricsContext, processName.toLowerCase());
  metricsRecord.setTag("sessionId", sessionId);
  metricsContext.registerUpdater(this);
  log.info("Initializing NameNodeMeterics using context object:" +
            metricsContext.getClass().getName());
}
 
开发者ID:cumulusyebl,项目名称:cumulus,代码行数:18,代码来源:NameNodeMetrics.java

示例8: LocalJobRunnerMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public LocalJobRunnerMetrics(JobConf conf) {
  String sessionId = conf.getSessionId();
  // Initiate JVM Metrics
  JvmMetrics.init("JobTracker", sessionId);
  // Create a record for map-reduce metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  // record name is jobtracker for compatibility 
  metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:LocalJobRunnerMetrics.java

示例9: RESTMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public RESTMetrics() {
  MetricsContext context = MetricsUtil.getContext("rest");
  metricsRecord = MetricsUtil.createRecord(context, "rest");
  String name = Thread.currentThread().getName();
  metricsRecord.setTag("REST", name);
  context.registerUpdater(this);
  JvmMetrics.init("rest", name);
  // expose the MBean for metrics
  restStatistics = new RESTStatistics(registry);

}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:12,代码来源:RESTMetrics.java

示例10: JobTrackerMetricsInst

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public JobTrackerMetricsInst(JobTracker tracker, JobConf conf) {
  super(tracker, conf);
  String sessionId = conf.getSessionId();
  // Initiate JVM Metrics
  JvmMetrics.init("JobTracker", sessionId);
  // Create a record for map-reduce metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:12,代码来源:JobTrackerMetricsInst.java

示例11: TaskTrackerMetricsInst

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public TaskTrackerMetricsInst(TaskTracker t) {
  super(t);
  JobConf conf = tt.getJobConf();
  String sessionId = conf.getSessionId();
  // Initiate Java VM Metrics
  JvmMetrics.init("TaskTracker", sessionId);
  // Create a record for Task Tracker metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "tasktracker"); //guaranteed never null
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:13,代码来源:TaskTrackerMetricsInst.java

示例12: TaskTrackerMetricsInst

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public TaskTrackerMetricsInst(TaskTracker t) {
  super(t);
  JobConf conf = tt.getJobConf();
  extraJvms = conf.getInt(EXTRA_JVMS, 16);
  String sessionId = conf.getSessionId();
  // Initiate Java VM Metrics
  JvmMetrics.init("TaskTracker", sessionId);
  // Create a record for Task Tracker metrics
  MetricsContext context = MetricsUtil.getContext("mapred");
  metricsRecord = MetricsUtil.createRecord(context, "tasktracker"); //guaranteed never null
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:TaskTrackerMetricsInst.java

示例13: BalancerMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public BalancerMetrics(Configuration conf, InetSocketAddress namenodeAddress) {
  String sessionId = conf.get("session.id");
  JvmMetrics.init("Balancer", sessionId);
  balancerActivityMBean = new BalancerActivityMBean(registry, conf, namenodeAddress);

  MetricsContext context = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(context, "balancer");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:11,代码来源:BalancerMetrics.java

示例14: DataNodeMetrics

import org.apache.hadoop.metrics.jvm.JvmMetrics; //导入依赖的package包/类
public DataNodeMetrics(Configuration conf, String storageId) {
  String sessionId = conf.get("session.id"); 
  // Initiate reporting of Java VM metrics
  JvmMetrics.init("DataNode", sessionId);
  

  // Now the MBean for the data node
  datanodeActivityMBean = new DataNodeActivityMBean(registry, storageId);
  
  // Create record for DataNode metrics
  MetricsContext context = MetricsUtil.getContext("dfs");
  metricsRecord = MetricsUtil.createRecord(context, "datanode");
  metricsRecord.setTag("sessionId", sessionId);
  context.registerUpdater(this);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:16,代码来源:DataNodeMetrics.java


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