本文整理汇总了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");
}
示例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");
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}