-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sergey Mashkov
committed
Oct 23, 2017
1 parent
1fc4894
commit 395ee2f
Showing
12 changed files
with
90 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,57 @@ | ||
plugins { | ||
id "me.champeau.gradle.jmh" version "0.4.4" | ||
id "org.jetbrains.kotlin.plugin.allopen" version "1.1.51" | ||
} | ||
|
||
allOpen { | ||
annotation("org.openjdk.jmh.annotations.State") | ||
} | ||
|
||
sourceSets { | ||
jmh { | ||
kotlin { | ||
srcDir "src-jmh" | ||
} | ||
} | ||
} | ||
|
||
description = '' | ||
dependencies { | ||
compile project(':ktor-server:ktor-server-core') | ||
compile project(':ktor-server:ktor-server-test-host') | ||
compile project(':ktor-server:ktor-server-netty') | ||
compile project(':ktor-server:ktor-server-jetty') | ||
compile group: 'org.openjdk.jmh', name: 'jmh-core', version:'1.19' | ||
compile group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version:'1.19' | ||
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.2' | ||
compile group: 'com.squareup.okhttp3', name: 'okhttp', version:'3.6.0' | ||
compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.1' | ||
jmh project(':ktor-server:ktor-server-test-host') | ||
jmh project(':ktor-server:ktor-server-netty') | ||
jmh project(':ktor-server:ktor-server-jetty') | ||
|
||
jmh group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2' | ||
jmh group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0' | ||
jmh group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.1' | ||
} | ||
|
||
jmh { | ||
jmhVersion = '1.19' | ||
include = [/io.ktor.tests.ValuesMapBenchmark/] | ||
} | ||
|
||
jmhJar.archiveName = 'benchmarks.jar' | ||
|
||
task runBenchmark(type: JavaExec, dependsOn: 'jmhJar') { | ||
def mainClassFqName = null | ||
|
||
if (project.hasProperty('benchmarkClassFqName')) { | ||
mainClassFqName = project.benchmarkClassFqName | ||
} else if (project.hasProperty('benchmarkName')) { | ||
mainClassFqName = "io.ktor.benchmarks.${project.benchmarkName}Kt" | ||
} | ||
|
||
classpath = sourceSets.jmh.runtimeClasspath + jmhJar.outputs.files | ||
main = mainClassFqName | ||
systemProperties['benchmarkClassFqName'] = mainClassFqName | ||
|
||
doFirst { | ||
if (mainClassFqName == null) { | ||
throw new InvalidUserDataException("Neither benchmarkName nor benchmarkClassFqName property specified (use option -P to assign)") | ||
} | ||
|
||
new File(project.buildDir, 'reports/benchmarks').mkdirs() | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters