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


Java ResultFormatType类代码示例

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


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

示例1: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException, CommandLineOptionException {
	Package currentPackage = Package.getPackage( "org.apache.bval.bench" );
	System.out.println( currentPackage.getImplementationTitle() + " - " + currentPackage.getImplementationVersion() );
	Options commandLineOptions = new CommandLineOptions( args );
	ChainedOptionsBuilder builder = new OptionsBuilder().parent( commandLineOptions );

	if ( !commandLineOptions.getResult().hasValue() ) {
		builder.result( "target/jmh-results.json" );
	}
	if ( !commandLineOptions.getResultFormat().hasValue() ) {
		builder.resultFormat( ResultFormatType.JSON );
	}
	if ( commandLineOptions.getIncludes().isEmpty() ) {
		DEFAULT_TEST_CLASSES.forEach( testClass -> builder.include( testClass.getName() ) );
	}

	Options opt = builder.build();
	new Runner( opt ).run();
}
 
开发者ID:hibernate,项目名称:beanvalidation-benchmark,代码行数:20,代码来源:BenchmarkRunner.java

示例2: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    for (int threads = 1; threads < 32; threads <<= 1) {
        Options opt = new OptionsBuilder()
                .forks(10)
                .threads(threads)
                .warmupIterations(10)
                .measurementIterations(20)
                .mode(Mode.AverageTime)
                .timeUnit(TimeUnit.NANOSECONDS)
                .include("ky.korins.atomic.benchmark")
                .resultFormat(ResultFormatType.CSV)
                .result("atomic_" + threads + ".csv")
                .build();

        new Runner(opt).run();
    }
}
 
开发者ID:catap,项目名称:atomic,代码行数:18,代码来源:Driver.java

示例3: launchBenchmark

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
@Test
public void launchBenchmark() throws RunnerException {

    String targetFolder = Paths.get(
            this.getClass().getResource("/").getFile()).getParent().toString();

    Options opt = new OptionsBuilder()
            .include(".*Benchmark")
            .warmupTime(TimeValue.seconds(1))
            .warmupIterations(5)
            .measurementTime(TimeValue.seconds(1))
            .measurementIterations(10)
            .threads(1)
            .forks(1)
            .shouldFailOnError(true)
            .shouldDoGC(true)
            .jvmArgs("-server")
            .resultFormat(ResultFormatType.JSON)
            .result(targetFolder+"/"+FrenchPhoneticBenchmark.class.getName() + ".jmh.json")
    .build();

    new Runner(opt).run();
}
 
开发者ID:hcapitaine,项目名称:french-phonetic-analyser,代码行数:24,代码来源:BenchmarkIT.java

示例4: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException, IOException {
	final String include;
	if (args.length == 0) {
		include = askRunAll();
	} else {
		include = args[0];
	}
	final Options opt = new OptionsBuilder()//
		.include(include)//
		.mode(Mode.Throughput)//
		.measurementIterations(3)//
		.measurementBatchSize(1)//
		.measurementTime(TimeValue.milliseconds(1000))//
		.forks(1)//
		.timeUnit(TimeUnit.MICROSECONDS)//
		.warmupIterations(3)//
		.warmupTime(TimeValue.milliseconds(1000))//
		.build();
	final Collection<RunResult> runResult = new Runner(opt).run();
	System.out.flush();
	final ResultFormat resultFormat = ResultFormatFactory.getInstance(ResultFormatType.CSV, System.out);
	resultFormat.writeOut(runResult);
	System.out.flush();
}
 
开发者ID:tools4j,项目名称:decimal4j,代码行数:25,代码来源:JmhRunner.java

示例5: runJMH

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
private static void runJMH(final String parserClasss, final int forks, final int threads, final int warmupit, final int measureit) throws Exception {

        
        
        final Options opt = new OptionsBuilder()

        .include(REGEX)
        .forks(forks)
        .warmupIterations(warmupit)
        .measurementIterations(measureit)
        .threads(threads)
        .mode(Mode.Throughput)
        .timeUnit(TimeUnit.SECONDS)
        .verbosity(VerboseMode.EXTRA)
        .jvmArgs("-Xmx" + MEMORY, "-Dfile.encoding=utf-8", "-Dbenchmark.impl="+parserClasss)
        .resultFormat(ResultFormatType.JSON)
        .result(String.format("jmh_benchmark_thrpt_result_%s_f%d_t%d_w%d_i%d_t%s.txt", parserClasss, forks, threads, warmupit, measureit,
                TSS))
                .output(String.format("jmh_benchmark_thrpt_log_%s_f%d_t%d_w%d_i%d_t%s.txt", parserClasss, forks, threads, warmupit, measureit, TSS))
                //.addProfiler(GCProfiler.class)    // report GC time
                //.addProfiler(StackProfiler.class) // report method stack execution profile
                .build();

        new Runner(opt).run();

    }
 
开发者ID:salyh,项目名称:jsr353-benchmark,代码行数:27,代码来源:BenchmarkMain.java

示例6: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的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

示例7: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
        .include(FineGrainedLockBenchmark.class.getSimpleName())
        .resultFormat(ResultFormatType.CSV)
        .build();
    new Runner(opt).run();
}
 
开发者ID:Devexperts,项目名称:dlcheck,代码行数:8,代码来源:FineGrainedLockBenchmark.java

示例8: run

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
@Test
public void run() throws Exception {
    final String className = getClass().getSimpleName();

    final ChainedOptionsBuilder runnerOptions = new OptionsBuilder()
            .include(".*" + className + ".*")
            .jvmArgs(JVM_ARGS);

    if (getWarmupIterations() > 0) {
        runnerOptions.warmupIterations(getWarmupIterations());
    }

    if (getMeasureIterations() > 0) {
        runnerOptions.measurementIterations(getMeasureIterations());
    }

    if (getForks() > 0) {
        runnerOptions.forks(getForks());
    }

    if (getReportDir() != null) {
        final String dtmStr = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
        final String filePath = getReportDir() + className + "-" + dtmStr + ".json";
        final File file = new File(filePath);
        if (file.exists()) {
            file.delete();
        } else {
            file.getParentFile().mkdirs();
            file.createNewFile();
        }

        runnerOptions.resultFormat(ResultFormatType.JSON);
        runnerOptions.result(filePath);
    }

    new Runner(runnerOptions.build()).run();
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:38,代码来源:AbstractBenchmarkBase.java

示例9: run

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
@Test
public void run() throws Exception {
    String className = getClass().getSimpleName();

    ChainedOptionsBuilder runnerOptions = new OptionsBuilder()
        .include(".*" + className + ".*")
        .jvmArgs(JVM_ARGS);

    if (getWarmupIterations() > 0) {
        runnerOptions.warmupIterations(getWarmupIterations());
    }

    if (getMeasureIterations() > 0) {
        runnerOptions.measurementIterations(getMeasureIterations());
    }

    if (getForks() > 0) {
        runnerOptions.forks(getForks());
    }

    if (getReportDir() != null) {
        String filePath = getReportDir() + className + ".json";
        File file = new File(filePath);
        if (file.exists()) {
            file.delete();
        } else {
            file.getParentFile().mkdirs();
            file.createNewFile();
        }

        runnerOptions.resultFormat(ResultFormatType.JSON);
        runnerOptions.result(filePath);
    }

    new Runner(runnerOptions.build()).run();
}
 
开发者ID:wuyinxian124,项目名称:netty4.0.27Learn,代码行数:37,代码来源:AbstractMicrobenchmark.java

示例10: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
		System.out.println(JmhMapBenchmarks.class.getSimpleName());
		Options opt = new OptionsBuilder()
				.include(
						".*" + JmhMapBenchmarks.class.getSimpleName()
								+ ".(timeInsert)")
				.timeUnit(TimeUnit.NANOSECONDS)
				.forks(0)
				//.warmupMode(WarmupMode.INDI)
				.warmupIterations(0)
				.warmupTime(TimeValue.seconds(1))
				.mode(Mode.AverageTime)
				.measurementIterations(5)
				.param("dataType", "MAP")
				.param("run", "0")
//				.param("run", "1")
//				.param("run", "2")
//				.param("run", "3")
				//.addProfiler(CountingIntegerProfiler.class)
				//.param("producer", "SLEEPING_INTEGER")
				.param("producer", "COUNTING_INTEGER")
				.param("sampleDataSelection", "MATCH").param("size", "1024") // 1048576
				//.param("valueFactoryFactory", "VF_PDB_PERSISTENT_SPECIALIZED")
				.param("valueFactoryFactory", "VF_PDB_PERSISTENT_CURRENT")
				//.param("valueFactoryFactory", "VF_SCALA")
				//.param("valueFactoryFactory", "VF_CLOJURE")
				.resultFormat(ResultFormatType.CSV)
				.result("latest-results-main.csv")
				.build();

		new Runner(opt).run();
	}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:33,代码来源:JmhMapBenchmarks.java

示例11: main

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public static void main(String... args) throws Exception {
    Options opts = new OptionsBuilder()
            .include(".*")
            .warmupIterations(10)
            .measurementIterations(10)
            .forks(3)
            .jvmArgs("-server")
            .resultFormat(ResultFormatType.TEXT)
            .build();

    new Runner(opts).run();
}
 
开发者ID:alexeyr,项目名称:pcg-java,代码行数:13,代码来源:Pcg32Benchmarks.java

示例12: run

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
@Test
public void run() throws Exception {
    final String className = getClass().getSimpleName();

    final ChainedOptionsBuilder runnerOptions = new OptionsBuilder()
            .include(".*" + className + ".*")
            .jvmArgs(getJvmArgs());

    if (getWarmupIterations() > 0) {
        runnerOptions.warmupIterations(getWarmupIterations());
    }

    if (getMeasureIterations() > 0) {
        runnerOptions.measurementIterations(getMeasureIterations());
    }

    if (getForks() > 0) {
        runnerOptions.forks(getForks());
    }

    if (getReportDir() != null) {
        final String dtmStr = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
        final String filePath = getReportDir() + className + "-" + dtmStr + ".json";
        final File file = new File(filePath);
        if (file.exists()) {
            file.delete();
        } else {
            file.getParentFile().mkdirs();
            file.createNewFile();
        }

        runnerOptions.resultFormat(ResultFormatType.JSON);
        runnerOptions.result(filePath);
    }

    new Runner(runnerOptions.build()).run();
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:38,代码来源:AbstractBenchmarkBase.java

示例13: tiffTest

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public void tiffTest() throws RunnerException {
	Options opt = new OptionsBuilder()
			.include(WriteMediumFileTest.class.getSimpleName()).forks(1)
			.result("resultsMedium.txt").resultFormat(ResultFormatType.TEXT)
			.build();
	new Runner(opt).run();
}
 
开发者ID:scifio,项目名称:scifio-benchmark,代码行数:8,代码来源:WriteMediumFileTest.java

示例14: tiffTest

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
public void tiffTest() throws RunnerException {
	Options opt = new OptionsBuilder()
			.include(WriteSmallFileTest.class.getSimpleName()).forks(1)
			.result("results-small.txt").resultFormat(ResultFormatType.TEXT)
			.build();
	new Runner(opt).run();
}
 
开发者ID:scifio,项目名称:scifio-benchmark,代码行数:8,代码来源:WriteSmallFileTest.java

示例15: tiffTest

import org.openjdk.jmh.results.format.ResultFormatType; //导入依赖的package包/类
@Test
public void tiffTest() throws RunnerException {
	Options opt = new OptionsBuilder()
			.include(WriteLargeFileTest.class.getSimpleName()).forks(1)
			.result("resultsLarge.txt").resultFormat(ResultFormatType.TEXT)
			.addProfiler(StackProfiler.class).build();
	new Runner(opt).run();
}
 
开发者ID:scifio,项目名称:scifio-benchmark,代码行数:9,代码来源:WriteLargeFileTest.java


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