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"); }
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"); }