| apply plugin: 'application' |
| |
| description = "grpc Benchmarks" |
| |
| startScripts.enabled = false |
| run.enabled = false |
| |
| buildscript { |
| repositories { |
| mavenCentral() |
| maven { |
| url "https://plugins.gradle.org/m2/" |
| } |
| } |
| dependencies { |
| classpath libraries.protobuf_plugin |
| classpath "me.champeau.gradle:jmh-gradle-plugin:0.2.0" |
| } |
| } |
| apply plugin: 'me.champeau.gradle.jmh' |
| |
| jmh { |
| jmhVersion = '1.7.1' |
| warmupIterations = 10 |
| iterations = 10 |
| fork = 1 |
| jvmArgs = "-server -Xms2g -Xmx2g -dsa -da -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:+UseFastAccessorMethods -XX:+OptimizeStringConcat" |
| } |
| |
| dependencies { |
| compile project(':grpc-core'), |
| project(':grpc-netty'), |
| project(':grpc-okhttp'), |
| project(':grpc-stub'), |
| project(':grpc-protobuf'), |
| project(':grpc-testing'), |
| libraries.junit, |
| libraries.mockito, |
| libraries.hdrhistogram, |
| libraries.netty_tcnative, |
| libraries.netty_transport_native_epoll |
| } |
| |
| configureProtoCompilation() |
| |
| task qps_client(type: CreateStartScripts) { |
| mainClassName = "io.grpc.benchmarks.qps.AsyncClient" |
| applicationName = "qps_client" |
| defaultJvmOpts = ["-Xbootclasspath/p:" + configurations.alpnboot.asPath] |
| outputDir = new File(project.buildDir, 'tmp') |
| classpath = jar.outputs.files + project.configurations.runtime |
| } |
| |
| task openloop_client(type: CreateStartScripts) { |
| mainClassName = "io.grpc.benchmarks.qps.OpenLoopClient" |
| applicationName = "openloop_client" |
| defaultJvmOpts = ["-Xbootclasspath/p:" + configurations.alpnboot.asPath] |
| outputDir = new File(project.buildDir, 'tmp') |
| classpath = jar.outputs.files + project.configurations.runtime |
| } |
| |
| task qps_server(type: CreateStartScripts) { |
| mainClassName = "io.grpc.benchmarks.qps.AsyncServer" |
| applicationName = "qps_server" |
| defaultJvmOpts = ["-Xbootclasspath/p:" + configurations.alpnboot.asPath] |
| outputDir = new File(project.buildDir, 'tmp') |
| classpath = jar.outputs.files + project.configurations.runtime |
| } |
| |
| applicationDistribution.into("bin") { |
| from(qps_client) |
| from(openloop_client) |
| from(qps_server) |
| fileMode = 0755 |
| } |
| |
| // Allow intellij projects to refer to generated-sources |
| idea { |
| module { |
| // The whole build dir is excluded by default, but we need build/generated-sources, |
| // which contains the generated proto classes. |
| excludeDirs = [file('.gradle')] |
| if (buildDir.exists()) { |
| excludeDirs += files(buildDir.listFiles()) |
| excludeDirs -= file("$buildDir/generated-sources") |
| } |
| } |
| } |
| |