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


Java OptionsBuilder类代码示例

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


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

示例1: loadPaths

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
@BeforeAll
static void loadPaths() throws IOException, RunnerException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
	String[] paths;
	fileSystem = FileTestHelper.createMockFileSystem(Configuration.unix());
	fileSystemField = ConversionEntry.class.getDeclaredField("fileSystem");
	fileSystemField.setAccessible(true);
	defaultFileSystem = (FileSystem) fileSystemField.get(null);
	fileSystemField.set(null, fileSystem);
	paths = FileTestHelper.getAllQrdaFiles(fileSystem, "-latest.xml").map(Path::toString).toArray(String[]::new);

	Options opt = new OptionsBuilder()
			.mode(Mode.Throughput)
			.mode(Mode.AverageTime)
			.include(".*" + ParameterizedBenchmark.class.getSimpleName() + ".*")
			.param("fileName", paths)
			.forks(1)
			.build();

	List<RunResult> results = new ArrayList<>(new Runner(opt).run());
	benchResults = results.stream()
			.map(RunResult::getAggregatedResult)
			.collect(Collectors.toList());
}
 
开发者ID:CMSgov,项目名称:qpp-conversion-tool,代码行数:24,代码来源:ParameterizedBenchmarkTest.java

示例2: run

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
@Test
public void run() throws Exception {
    //Add more iterations, forks, etc, results should be similar or better.  At least they
    //were on my machine.
    Options opt = new OptionsBuilder()
            .include(this.getClass().getName() + ".*")
            //.mode(Mode.Throughput)
            .mode(Mode.AverageTime)
            .timeUnit(TimeUnit.MICROSECONDS)
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .threads(10)
            .shouldDoGC(true)
            .jvmArgs("")
            .build();
    new Runner(opt).run();
}
 
开发者ID:a-hansen,项目名称:alog,代码行数:19,代码来源:AlogBenchmark.java

示例3: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的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

示例4: launchBenchmark

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
@Test
public void launchBenchmark() throws Exception {
    Options opt = new OptionsBuilder()
            .include(this.getClass().getName() + ".*")
            .warmupTime(TimeValue.seconds(5))
            .warmupIterations(2)
            .measurementTime(TimeValue.seconds(1))
            .measurementIterations(10)
            .threads(4)
            .forks(2)
            .shouldFailOnError(true)
            .shouldDoGC(true)
            .build();

    Runner runner = new Runner(opt);
    runner.run();
}
 
开发者ID:mikroskeem,项目名称:Shuriken,代码行数:18,代码来源:InvocationBenchmark.java

示例5: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的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

示例6: runMicroBenchMark

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的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

示例7: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(RocketMQSyncMessage.class.getSimpleName())
            .warmupIterations(60)
            .measurementIterations(60)
            .forks(1)
            .threads(20)
            .build();
    new Runner(opt).run();
}
 
开发者ID:mumudemo,项目名称:mumu-rocketmq,代码行数:11,代码来源:RocketMQSyncMessage.java

示例8: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(RocketMQAsyncMessage.class.getSimpleName())
            .warmupIterations(60)
            .measurementIterations(60)
            .forks(1)
            .threads(20)
            .build();
    new Runner(opt).run();
}
 
开发者ID:mumudemo,项目名称:mumu-rocketmq,代码行数:11,代码来源:RocketMQAsyncMessage.java

示例9: getDefaultRunner

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
private Runner getDefaultRunner() {
	final OptionsBuilder jmhOptionsBuilder = new OptionsBuilder();
	if (!this.isJmhOutput()) {
		jmhOptionsBuilder.verbosity(VerboseMode.SILENT);
	}
	return new Runner(jmhOptionsBuilder.build());
}
 
开发者ID:SoerenHenning,项目名称:RadarGun,代码行数:8,代码来源:Options.java

示例10: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(JMHSample_13_RunToRun.class.getSimpleName())
            .warmupIterations(0)
            .measurementIterations(5)
            .build();

    new Runner(opt).run();
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:10,代码来源:JMHSample_13_RunToRun.java

示例11: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(JMHSample_01_HelloWorld.class.getSimpleName())
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:9,代码来源:JMHSample_01_HelloWorld.java

示例12: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(JMHSample_11_Loops.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .build();

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

示例13: main

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

    new Runner(opt).run();
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:8,代码来源:JMHSample_28_BlackholeHelpers.java

示例14: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(JMHSample_27_Params.class.getSimpleName())
//                .param("arg", "41", "42") // Use this to selectively constrain/override parameters
                .build();

        new Runner(opt).run();
    }
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:9,代码来源:JMHSample_27_Params.java

示例15: main

import org.openjdk.jmh.runner.options.OptionsBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(JMHSample_33_SecurityManager.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .build();

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


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