当前位置: 首页>>代码示例>>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;未经允许,请勿转载。