synchronized JvmMetrics init(String processName, String sessionId) { if (impl == null) { impl = create(processName, sessionId, DefaultMetricsSystem.instance()); } return impl; } }
public static void init() { enabled = KylinConfig.getInstanceFromEnv().getQueryMetricsEnabled(); if (!enabled) return; DefaultMetricsSystem.initialize("Kylin"); }
public void shutdown() { DefaultMetricsSystem.shutdown(); }
public static void main(String[] args) throws Exception { final MetricRegistry metrics = new MetricRegistry(); final HadoopMetrics2Reporter metrics2Reporter = HadoopMetrics2Reporter.forRegistry(metrics).build( DefaultMetricsSystem.initialize("StandaloneTest"), // The application-level name "Test", // Component name "Test", // Component description "Test"); // Name for each metric record final ConsoleReporter consoleReporter = ConsoleReporter.forRegistry(metrics).build(); MetricsSystem metrics2 = DefaultMetricsSystem.instance(); // Writes to stdout without a filename configuration // Will be invoked every 10seconds by default FileSink sink = new FileSink(); metrics2.register("filesink", "filesink", sink); sink.init(new SubsetConfiguration(null, null) { public String getString(String key) { if (key.equals("filename")) { return null; } return super.getString(key); } }); // How often should the dropwizard reporter be invoked metrics2Reporter.start(500, TimeUnit.MILLISECONDS); // How often will the dropwziard metrics be logged to the console consoleReporter.start(2, TimeUnit.SECONDS); generateMetrics(metrics, 5000, 25, TimeUnit.MILLISECONDS, metrics2Reporter, 10); }
@Override public void init() { // Make sure that the metrics system doesn't throw an exception when // registering a source with the same name DefaultMetricsSystem.setMiniClusterMode(true); }
/** * @return the metrics system object */ public static MetricsSystem instance() { return INSTANCE.getImpl(); }
validateAndCreateJournalDir(journalDir); DefaultMetricsSystem.initialize("JournalNode"); JvmMetrics.create("JournalNode", conf.get(DFSConfigKeys.DFS_METRICS_SESSION_ID_KEY), DefaultMetricsSystem.instance());
DefaultMetricsSystem.setMiniClusterMode(true); final MiniZooKeeperCluster zooKeeperCluster = new MiniZooKeeperCluster(conf); File zkDataPath = new File(conf.get(HConstants.ZOOKEEPER_DATA_DIR));
/** * @return the metrics system object */ public static MetricsSystem instance() { return INSTANCE.getImpl(); }
synchronized JvmMetrics init(String processName, String sessionId) { if (impl == null) { impl = create(processName, sessionId, DefaultMetricsSystem.instance()); } return impl; }
@Override protected void serviceStart() throws Exception { DefaultMetricsSystem.initialize("JobHistoryServer"); JvmMetrics.initSingleton("JobHistoryServer", null); super.serviceStart(); deleteLogManager = new Thread(new deleteLogMonitor()); deleteLogManager.setName("Log-delete-monitor"); deleteLogManager.setDaemon(true); deleteLogManager.start(); }
@Override protected void serviceStop() throws Exception { DefaultMetricsSystem.shutdown(); super.serviceStop(); }
DefaultMetricsSystem.initialize("SecondaryNameNode"); JvmMetrics.create("SecondaryNameNode", conf.get(DFSConfigKeys.DFS_METRICS_SESSION_ID_KEY), DefaultMetricsSystem.instance());
@BeforeClass public static void setUpBeforeClass() throws Exception { Configuration c = TESTUTIL.getConfiguration(); // We use local filesystem. Set it so it writes into the testdir. FSUtils.setRootDir(c, TESTUTIL.getDataTestDir()); DefaultMetricsSystem.setMiniClusterMode(true); // Startup a mini zk cluster. TESTUTIL.startMiniZKCluster(); }
/** * @return the metrics system object */ public static MetricsSystem instance() { return INSTANCE.getImpl(); }
public QueryMetrics registerWith(String name) { return DefaultMetricsSystem.instance().register(name, "Query", this); } }
synchronized void init(String name) { if (inited) { return; } inited = true; DefaultMetricsSystem.initialize(HBASE_METRICS_SYSTEM_NAME); JvmMetrics.initSingleton(name, ""); // initialize hbase-metrics module based metric system as well. GlobalMetricRegistriesSource // initialization depends on the metric system being already initialized, that is why we are // doing it here. Once BaseSourceSourceImpl is removed, we should do the initialization of // these elsewhere. GlobalMetricRegistriesAdapter.init(); } }