io.netty.util.ResourceLeakDetector.Level#org.openjdk.jmh.runner.Runner源码实例Demo

下面列出了io.netty.util.ResourceLeakDetector.Level#org.openjdk.jmh.runner.Runner 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: conf4j   文件: PerformanceBenchmarkTest.java
@Test
public void launchBenchmark() throws Exception {
    Options opt = new OptionsBuilder()
            .include(this.getClass().getName() + ".*")
            .mode(Mode.SampleTime)
            .timeUnit(TimeUnit.MICROSECONDS)
            .warmupIterations(1)
            .warmupTime(TimeValue.seconds(1))
            .measurementIterations(1)
            .measurementTime(TimeValue.seconds(5))
            .threads(2)
            .forks(0)
            .syncIterations(true)
            .shouldFailOnError(true)
            .shouldDoGC(false)
            .jvmArgs("-Xms1G", "-Xmx1G", "-XX:MaxGCPauseMillis=10", "-XX:GCPauseIntervalMillis=100")
            .build();
    new Runner(opt).run();
}
 
源代码2 项目: turbo-rpc   文件: RestClientBenchmark.java
public static void main(String[] args) throws Exception {
	ResourceLeakDetector.setLevel(Level.DISABLED);
	// CtClass.debugDump = "d:/debugDump";

	// RestClientBenchmark clientBenchmark = new RestClientBenchmark();
	// System.out.println(clientBenchmark.createUser());
	// clientBenchmark.close();

	Options opt = new OptionsBuilder()//
			.include(RestClientBenchmark.class.getSimpleName())//
			.warmupIterations(5)//
			.measurementIterations(5)//
			.threads(CONCURRENCY)//
			.forks(1)//
			.build();

	new Runner(opt).run();
}
 
public static void main(String[] args) throws Exception {
    ConvertInputStreamToStringBenchmark test = new ConvertInputStreamToStringBenchmark();
    System.out.println();
    System.out.println("1. apacheToInputStream : " + test.test1_apacheToInputStream().length());
    System.out.println("2. guavaCharStreams : " + test.test2_guavaCharStreams().length());
    System.out.println("3. jdkScanner : " + test.test3_jdkScanner().length());
    System.out.println("4. jdkJava8 : " + test.test4_jdkJava8().length());
    System.out.println("5. jdkJava8parallel : " + test.test5_jdkJava8parallel().length());
    System.out.println("6. inputStreamReaderAndStringBuilder : " + test.test6_inputStreamReaderAndStringBuilder().length());
    System.out.println("7. apacheStringWriterAndIOUtilsCopy : " + test.test7_apacheStringWriterAndIOUtilsCopy().length());
    System.out.println("8. readByteArrayOutputStream : " + test.test8_readByteArrayOutputStream().length());
    System.out.println("9. bufferedReaderReadLine : " + test.test9_bufferedReaderReadLine().length());
    System.out.println("10. bufferedInputStreamAndByteArrayOutputStream : " + test.test10_bufferedInputStreamAndByteArrayOutputStream().length());
    System.out.println("11. inputStreamReadAndStringBuilder : " + test.test11_inputStreamReadAndStringBuilder().length());


    System.out.println();

    Options opt = new OptionsBuilder()
            .include(ConvertInputStreamToStringBenchmark.class.getSimpleName())
            .build();

    new Runner(opt).run();
}
 
源代码4 项目: requery   文件: BenchmarkTest.java
@Test
public void testCompareQuery() throws SQLException, RunnerException {
    Options options = new OptionsBuilder()
        .include(getClass().getName() + ".*")
        .mode(Mode.SingleShotTime)
        .timeUnit(TimeUnit.MILLISECONDS)
        .warmupTime(TimeValue.seconds(5))
        .warmupIterations(2)
        .measurementTime(TimeValue.seconds(10))
        .measurementIterations(5)
        .threads(1)
        .forks(2)
        .build();
    try {
        new Runner(options).run();
    } catch (NoBenchmarksException ignored) {
        // expected? only happens from gradle
    }
}
 
源代码5 项目: git-client-plugin   文件: BenchmarkRunner.java
@Test
    public void runJmhBenchmarks() throws Exception {
        ChainedOptionsBuilder options = new OptionsBuilder()
                .mode(Mode.AverageTime) // Performance metric is Average time (ms per operation)
                .warmupIterations(5) // Used to warm JVM before executing benchmark tests
                .measurementIterations(5)
                .timeUnit(TimeUnit.MILLISECONDS)
                .threads(2) // TODO: Increase the number of threads and measure performance
                .forks(2)   // Need to increase more forks to get more observations, increases precision.
                .shouldFailOnError(true) // Will stop forking of JVM as soon as there is a compilation error
                .shouldDoGC(true) // do GC between measurement iterations
                .output("jmh-report.json");
//                .resultFormat(ResultFormatType.JSON) // store the results in a file called jmh-report.json
//                .result("jmh-report.json");

        BenchmarkFinder bf = new BenchmarkFinder(getClass());
        bf.findBenchmarks(options);
        new Runner(options.build()).run();
    }
 
源代码6 项目: rpc-benchmark   文件: Client.java
public static void main(String[] args) throws Exception {
		Options opt = new OptionsBuilder()//
				.include(Client.class.getSimpleName())//
				.warmupIterations(3)//
				.warmupTime(TimeValue.seconds(10))//
				.measurementIterations(3)//
				.measurementTime(TimeValue.seconds(10))//
				.threads(CONCURRENCY)//
				.forks(1)//
				.build();

		new Runner(opt).run();
//		HproseTcpClient client = new HproseTcpClient("tcp://127.0.0.1:8080");
//		UserService userService = client.useService(UserService.class);
//		System.out.println(userService.existUser("1"));
	}
 
源代码7 项目: Jupiter   文件: SerializationBenchmark.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(SerializationBenchmark.class.getSimpleName())
            .build();

    new Runner(opt).run();
}
 
源代码8 项目: sofa-jraft   文件: RheaKVGetBenchmark.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(RheaKVGetBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(BenchmarkUtil.CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
public static void main(String[] args) throws RunnerException {
  Options opt = new OptionsBuilder()
      .include(".*" + OkHttpSenderBenchmarks.class.getSimpleName() + ".*")
      .build();

  new Runner(opt).run();
}
 
源代码10 项目: sdn-rx   文件: Benchmarks.java
public static void main(String... args) throws RunnerException, CommandLineOptionException {

		CommandLineOptions commandLineOptions = new CommandLineOptions(args);
		ChainedOptionsBuilder builder = new OptionsBuilder().parent(commandLineOptions)
			.include(Benchmarks.class.getSimpleName())
			.jvmArgsAppend("-ea");

		new Runner(builder.build()).run();
	}
 
源代码11 项目: sdn-rx   文件: Benchmarks.java
public static void main(String... args) throws RunnerException, CommandLineOptionException {

		CommandLineOptions commandLineOptions = new CommandLineOptions(args);
		ChainedOptionsBuilder builder = new OptionsBuilder().parent(commandLineOptions)
			.include(Benchmarks.class.getSimpleName())
			.jvmArgsAppend("-ea");

		new Runner(builder.build()).run();
	}
 
源代码12 项目: jmh-playground   文件: JMHSample_15_Asymmetric.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(JMHSample_15_Asymmetric.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
/**
 *
 * @param args Args.
 * @throws Exception Exception.
 */
public static void main(String[] args) throws Exception {
    final Options options = new OptionsBuilder()
        .include(JmhPartitionUpdateCounterBenchmark.class.getSimpleName())
        .build();

    new Runner(options).run();
}
 
源代码14 项目: SpringBootBucket   文件: SecondBenchmark.java
public static void main(String[] args) throws Exception {
    Options opt = new OptionsBuilder()
            .include(SecondBenchmark.class.getSimpleName())
            .forks(1)
            .warmupIterations(5)
            .measurementIterations(2)
            .build();
    Collection<RunResult> results =  new Runner(opt).run();
    ResultExporter.exportResult("单线程与多线程求和性能", results, "length", "微秒");
}
 
源代码15 项目: qpid-proton-j   文件: MessageBenchmark.java
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();
}
 
源代码16 项目: preDict   文件: PreDictEEBenchmark.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(PreDictEEBenchmark.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .build();

    new Runner(opt).run();

}
 
源代码17 项目: h3-java   文件: H3SetToMultiPolygonBenchmark.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(H3SetToMultiPolygonBenchmark.class.getSimpleName())
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
public static void main(String... args) throws RunnerException, CommandLineOptionException {
    Options opt = new OptionsBuilder()
        .parent(new CommandLineOptions())
        .include(V2DefaultClientCreationBenchmark.class.getSimpleName())
        .addProfiler(StackProfiler.class)
        .build();
    Collection<RunResult> run = new Runner(opt).run();
}
 
源代码19 项目: lite-pool   文件: Benchmark.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(LitePoolBenchmark.class.getSimpleName())
            .include(CommonsPool2Benchmark.class.getSimpleName())
            .warmupIterations(10)
            .measurementIterations(10)
            .forks(1)
            .resultFormat(JSON)
            .result("benchmark-" + System.currentTimeMillis() + ".json")
            .build();
    new Runner(opt).run();
}
 
源代码20 项目: friendly-id   文件: FriendlyIdBenchmark.java
public static void main(String[] args) throws RunnerException {
	Options opt = new OptionsBuilder()
			.include(FriendlyIdBenchmark.class.getSimpleName())
			.build();

	new Runner(opt).run();
}
 
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkHashAndStreamingAggregationOperators.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
public static void main(String[] args) throws RunnerException {
  Options opt = new OptionsBuilder()
      .addProfiler("gc")
      .include(".*" + MutableSpanBenchmarks.class.getSimpleName() + ".*")
      .build();

  new Runner(opt).run();
}
 
源代码23 项目: brave   文件: NoopAwareSpanHandlerBenchmarks.java
public static void main(String[] args) throws RunnerException {
  Options opt = new OptionsBuilder()
    .addProfiler("gc")
    .include(".*" + NoopAwareSpanHandlerBenchmarks.class.getSimpleName() + ".*")
    .build();

  new Runner(opt).run();
}
 
源代码24 项目: brave   文件: B3PropagationBenchmarks.java
public static void main(String[] args) throws RunnerException {
  Options opt = new OptionsBuilder()
    .addProfiler("gc")
    .include(".*" + B3PropagationBenchmarks.class.getSimpleName())
    .build();

  new Runner(opt).run();
}
 
public static void main(String[] args) throws RunnerException {
    Options options = new OptionsBuilder()
            .include(FalseSharingBenchmark.class.getSimpleName())
            .forks(1)
            .warmupIterations(10)
            .measurementIterations(10)
            .threads(2)
            .timeUnit(TimeUnit.MICROSECONDS)
            .build();
    new Runner(options).run();
}
 
源代码26 项目: rdf4j   文件: Main.java
public static void main(String[] args) throws RunnerException {
	Options opt = new OptionsBuilder().include("")

			// .addProfiler("stack", "lines=20;period=1;top=20")
			.build();

	new Runner(opt).run();
}
 
源代码27 项目: hollow   文件: HashCodesBenchmark.java
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(HashCodesBenchmark.class.getSimpleName())
            .warmupIterations(5)
            .warmupTime(TimeValue.seconds(1))
            .measurementIterations(1)
            .measurementTime(TimeValue.seconds(3))
            .forks(1)
            .build();
    new Runner(opt).run();
}
 
源代码28 项目: rpc-benchmark   文件: Client.java
public static void main(String[] args) throws Exception {
	Options opt = new OptionsBuilder()//
			.include(Client.class.getSimpleName())//
			.warmupIterations(3)//
			.warmupTime(TimeValue.seconds(10))//
			.measurementIterations(3)//
			.measurementTime(TimeValue.seconds(10))//
			.threads(CONCURRENCY)//
			.forks(1)//
			.build();

	new Runner(opt).run();
}
 
public static void main(String[] args) throws Exception {
	new Runner(
		new OptionsBuilder()
			.include(LegacyTransmuterBenchmark.class.getName() + ".*")
			.param("entityCount", "1024", "4096")
			.build())
	.run();
}
 
源代码30 项目: rdf4j   文件: Main.java
public static void main(String[] args) throws RunnerException {
		Options opt = new OptionsBuilder()
				.include("")

//			.addProfiler("stack", "lines=20;period=1;top=20")
				.build();

		new Runner(opt).run();
	}