当前位置: 首页>>代码示例>>Java>>正文


Java GCProfiler类代码示例

本文整理汇总了Java中org.openjdk.jmh.profile.GCProfiler的典型用法代码示例。如果您正苦于以下问题:Java GCProfiler类的具体用法?Java GCProfiler怎么用?Java GCProfiler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GCProfiler类属于org.openjdk.jmh.profile包,在下文中一共展示了GCProfiler类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runMicroBenchMark

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
@Test
public void runMicroBenchMark() throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(getClass().getName())
            .warmupIterations(2)
            .measurementIterations(10)
            .mode(Mode.AverageTime)
            .timeUnit(TimeUnit.MILLISECONDS)
            .addProfiler(GCProfiler.class)
            .jvmArgs("-server", "-XX:+UseG1GC", "-Xmx256m")
            .shouldDoGC(true)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
开发者ID:marcelmay,项目名称:hadoop-hdfs-fsimage-exporter,代码行数:17,代码来源:BenchmarkIT.java

示例2: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    //System.setProperty("com.zaxxer.nuprocess.threads", "cores"); // set when running with forks(0) below

    Options options = new OptionsBuilder()
            .addProfiler(GCProfiler.class)
            .addProfiler(HotspotThreadProfiler.class)
            //.forks(0) // set when running with JProfiler to simplify profiling
            .forks(2)
            //.jvmArgsAppend("-Dcom.zaxxer.nuprocess.threads=cores") // to adjust the pump thread count
            .include(NuProcessBenchmark.class.getSimpleName())
            .measurementIterations(50)
            .threads(10)
            .timeUnit(TimeUnit.SECONDS)
            .warmupIterations(1)
            .build();

    new Runner(options).run();
}
 
开发者ID:brettwooldridge,项目名称:NuProcess,代码行数:19,代码来源:NuProcessBenchmark.java

示例3: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
@SuppressWarnings("ObjectAllocationInLoop") public static void main(final String[] args)
    throws RunnerException {
  final ChainedOptionsBuilder options =
      new OptionsBuilder().addProfiler(HotspotThreadProfiler.class)
          .addProfiler(HotspotRuntimeProfiler.class).addProfiler(HotspotMemoryProfiler.class)
          .addProfiler(GCProfiler.class).addProfiler(StackProfiler.class).shouldFailOnError(true)
          .forks(1).resultFormat(ResultFormatType.CSV).detectJvmArgs();
  for (int nThreads = 1; nThreads <= 2; nThreads++) {
    new Runner(
        options.threads(nThreads).output(String.format("%d-thread_bench_results.csv", nThreads))
            .build()).run();
  }
}
 
开发者ID:Pr0methean,项目名称:BetterRandom,代码行数:14,代码来源:AbstractRandomBenchmark.java

示例4: runBenchmark

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void runBenchmark(Class<?> benchmarkClass) throws RunnerException
{
    final Options opt = new OptionsBuilder()
        .include(benchmarkClass.getSimpleName())
        .addProfiler(GCProfiler.class)
        .shouldDoGC(true)
        .warmupIterations(5)
        .measurementIterations(5)
        .forks(1)
        .build();
    new Runner(opt).run();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:13,代码来源:MessageBenchmark.java

示例5: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options options = new OptionsBuilder()
        .threads(2)
        .addProfiler(GCProfiler.class)
        .build();
    new Runner(options).run();
}
 
开发者ID:resilience4j,项目名称:resilience4j,代码行数:8,代码来源:BulkheadBenchmark.java

示例6: run

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
/**
 * Run benchmark.
 *
 * @param benchmark Benchmark to run.
 * @param threads Amount of threads.
 * @param client Client mode flag.
 * @param atomicityMode Atomicity mode.
 * @param writeSyncMode Write synchronization mode.
 * @throws Exception If failed.
 */
private static void run(String benchmark, int threads, boolean client, CacheAtomicityMode atomicityMode,
    CacheWriteSynchronizationMode writeSyncMode) throws Exception {
    String simpleClsName = JmhCacheBenchmark.class.getSimpleName();

    String output = simpleClsName + "-" + benchmark +
        "-" + threads + "-threads" +
        "-" + (client ? "client" : "data") +
        "-" + atomicityMode +
        "-" + writeSyncMode;

    JmhIdeBenchmarkRunner.create()
        .forks(1)
        .threads(threads)
        .warmupIterations(10)
        .measurementIterations(60)
        .benchmarks(simpleClsName + "." + benchmark)
        .output(output + ".jmh.log")
        .profilers(GCProfiler.class)
        .jvmArguments(
            "-Xms4g",
            "-Xmx4g",
            "-XX:+UnlockCommercialFeatures",
            "-XX:+FlightRecorder",
            "-XX:StartFlightRecording=delay=30s,dumponexit=true,settings=alloc,filename=" + output + ".jfr",
            JmhIdeBenchmarkRunner.createProperty(PROP_ATOMICITY_MODE, atomicityMode),
            JmhIdeBenchmarkRunner.createProperty(PROP_WRITE_SYNC_MODE, writeSyncMode),
            JmhIdeBenchmarkRunner.createProperty(PROP_DATA_NODES, 2),
            JmhIdeBenchmarkRunner.createProperty(PROP_CLIENT_MODE, client))
        .run();
}
 
开发者ID:apache,项目名称:ignite,代码行数:41,代码来源:JmhCacheBenchmark.java

示例7: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException
{
    Options opt = new OptionsBuilder()
            .include(BeansBenchmark.class.getSimpleName())
            .addProfiler(GCProfiler.class)
            .detectJvmArgs()
            .build();

    new Runner(opt).run();
}
 
开发者ID:cglib,项目名称:cglib,代码行数:11,代码来源:BeansBenchmark.java

示例8: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
  Options opt = new OptionsBuilder()
      .include(PreconditionTest.class.getSimpleName())
      .addProfiler(GCProfiler.class)
      .detectJvmArgs()
      .build();

  new Runner(opt).run();
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:PreconditionTest.java

示例9: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
  Options opt = new OptionsBuilder()
      .include(ParserBenchmark.class.getSimpleName())
      .addProfiler(GCProfiler.class)
      .addProfiler(FlightRecorderProfiler.class)
      .detectJvmArgs()
      .build();

  new Runner(opt).run();
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:ParserBenchmark.java

示例10: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + TDigestBench.class.getSimpleName() + ".*")
            .resultFormat(ResultFormatType.CSV)
            .result("overall-results.csv")
            .addProfiler(GCProfiler.class)
            .build();

    new Runner(opt).run();
}
 
开发者ID:tdunning,项目名称:t-digest-benchmark,代码行数:11,代码来源:TDigestBench.java

示例11: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + Benchmark.class.getSimpleName() + ".*")
            .resultFormat(ResultFormatType.CSV)
            .result("results.csv")
            .addProfiler(GCProfiler.class)
            .addProfiler(StackProfiler.class)
            .build();

    new Runner(opt).run();
}
 
开发者ID:tdunning,项目名称:t-digest-benchmark,代码行数:12,代码来源:Benchmark.java

示例12: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + FloatHistogramBench.class.getSimpleName() + ".*")
            .resultFormat(ResultFormatType.CSV)
            .result("overall-results.csv")
            .addProfiler(StackProfiler.class)
            .addProfiler(GCProfiler.class)
            .build();

    new Runner(opt).run();
}
 
开发者ID:tdunning,项目名称:t-digest-benchmark,代码行数:12,代码来源:FloatHistogramBench.java

示例13: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  ChainedOptionsBuilder opt = new OptionsBuilder()
      .include(BenchmarkStringDictionary.class.getSimpleName())
      .addProfiler(GCProfiler.class)
      .addProfiler(HotspotMemoryProfiler.class)
      .warmupTime(TimeValue.seconds(60))
      .warmupIterations(8)
      .measurementTime(TimeValue.seconds(60))
      .measurementIterations(8)
      .forks(5)
      ;

  new Runner(opt.build()).run();
}
 
开发者ID:linkedin,项目名称:pinot,代码行数:15,代码来源:BenchmarkStringDictionary.java

示例14: main

import org.openjdk.jmh.profile.GCProfiler; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options options = new OptionsBuilder()
        .addProfiler(GCProfiler.class)
        .build();
    new Runner(options).run();
}
 
开发者ID:resilience4j,项目名称:resilience4j,代码行数:7,代码来源:RateLimiterBenchmark.java


注:本文中的org.openjdk.jmh.profile.GCProfiler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。