當前位置: 首頁>>代碼示例>>Java>>正文


Java Runner類代碼示例

本文整理匯總了Java中org.openjdk.jmh.runner.Runner的典型用法代碼示例。如果您正苦於以下問題:Java Runner類的具體用法?Java Runner怎麽用?Java Runner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Runner類屬於org.openjdk.jmh.runner包,在下文中一共展示了Runner類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadPaths

import org.openjdk.jmh.runner.Runner; //導入依賴的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.Runner; //導入依賴的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.Runner; //導入依賴的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.Runner; //導入依賴的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.Runner; //導入依賴的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: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例7: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例8: getDefaultRunner

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例9: getRunner

import org.openjdk.jmh.runner.Runner; //導入依賴的package包/類
public Runner getRunner() {
	if (this.runner == null) {
		return this.getDefaultRunner();
	} else {
		return this.runner;
	}
}
 
開發者ID:SoerenHenning,項目名稱:RadarGun,代碼行數:8,代碼來源:Options.java

示例10: main

import org.openjdk.jmh.runner.Runner; //導入依賴的package包/類
public static void main(String[] args) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(Benchmarks.class.getSimpleName())
//                .addProfiler(HotspotMemoryProfiler.class)
                .forks(1)
                .build();

        new Runner(opt).run();
    }
 
開發者ID:yohlulz,項目名稱:MLE5109-Course-samples,代碼行數:10,代碼來源:Benchmarks.java

示例11: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例12: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例13: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例14: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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

示例15: main

import org.openjdk.jmh.runner.Runner; //導入依賴的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


注:本文中的org.openjdk.jmh.runner.Runner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。