當前位置: 首頁>>代碼示例>>Java>>正文


Java GcLogger類代碼示例

本文整理匯總了Java中com.netflix.spectator.gc.GcLogger的典型用法代碼示例。如果您正苦於以下問題:Java GcLogger類的具體用法?Java GcLogger怎麽用?Java GcLogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GcLogger類屬於com.netflix.spectator.gc包,在下文中一共展示了GcLogger類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RegistryInitializer

import com.netflix.spectator.gc.GcLogger; //導入依賴的package包/類
public RegistryInitializer(Registry registry, boolean enableJmxLogging) {
  this.registry = registry;
  Spectator.globalRegistry().add(registry);
  if (enableJmxLogging) {
    Jmx.registerStandardMXBeans(registry);
  }
  gcLogger = new GcLogger();
  gcLogger.start(null);
}
 
開發者ID:spinnaker,項目名稱:kork,代碼行數:10,代碼來源:SpectatorConfiguration.java

示例2: startJvmCollection

import com.netflix.spectator.gc.GcLogger; //導入依賴的package包/類
private void startJvmCollection() {
  try {
    Jmx.registerStandardMXBeans(sidecarRegistry);
    gcLogger = new GcLogger();
    gcLogger.start(null);
  } catch (Exception e) {
    LOGGER.error("failed to start collection of jvm stats", e);
    throw e;
  }
}
 
開發者ID:Netflix,項目名稱:spectator,代碼行數:11,代碼來源:SparkSink.java

示例3: premain

import com.netflix.spectator.gc.GcLogger; //導入依賴的package包/類
/** Entry point for the agent. */
public static void premain(String arg, Instrumentation instrumentation) throws Exception {
  // Setup logging
  Config config = loadConfig(arg);
  createDependencyProperties(config);

  // Setup Registry
  AtlasRegistry registry = new AtlasRegistry(Clock.SYSTEM, new AgentAtlasConfig(config));

  // Add to global registry for http stats and GC logger
  Spectator.globalRegistry().add(registry);

  // Enable GC logger
  GcLogger gcLogger = new GcLogger();
  if (config.getBoolean("collection.gc")) {
    gcLogger.start(null);
  }

  // Enable JVM data collection
  if (config.getBoolean("collection.jvm")) {
    Jmx.registerStandardMXBeans(registry);
  }

  // Enable JMX query collection
  if (config.getBoolean("collection.jmx")) {
    for (Config cfg : config.getConfigList("jmx.mappings")) {
      registry.register(new JmxMeter(registry, JmxConfig.from(cfg)));
    }
  }

  // Start collection for the registry
  registry.start();

  // Shutdown registry
  Runtime.getRuntime().addShutdownHook(new Thread(registry::stop, "spectator-agent-shutdown"));
}
 
開發者ID:Netflix,項目名稱:spectator,代碼行數:37,代碼來源:Agent.java


注:本文中的com.netflix.spectator.gc.GcLogger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。