1buildscript { 2 repositories { 3 maven { // The google mirror is less flaky than mavenCentral() 4 url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } 5 } 6 dependencies { classpath libraries.protobuf_plugin } 7} 8 9apply plugin: 'application' 10 11description = "grpc Benchmarks" 12 13startScripts.enabled = false 14run.enabled = false 15 16jmh { 17 jvmArgs = "-server -Xms2g -Xmx2g" 18 // Workaround 19 // https://github.com/melix/jmh-gradle-plugin/issues/97#issuecomment-316664026 20 includeTests = true 21} 22 23dependencies { 24 compile project(':grpc-core'), 25 project(':grpc-netty'), 26 project(':grpc-okhttp'), 27 project(':grpc-stub'), 28 project(':grpc-protobuf'), 29 project(':grpc-testing'), 30 libraries.junit, 31 libraries.mockito, 32 libraries.hdrhistogram, 33 libraries.netty_tcnative, 34 libraries.netty_epoll, 35 libraries.math 36 compileOnly libraries.javax_annotation 37} 38 39compileJava { 40 // The Control.Void protobuf clashes 41 options.compilerArgs += ["-Xep:JavaLangClash:OFF"] 42} 43 44configureProtoCompilation() 45 46def vmArgs = [ 47 "-server", 48 "-Xms2g", 49 "-Xmx2g", 50 "-XX:+PrintGCDetails" 51] 52 53task qps_client(type: CreateStartScripts) { 54 mainClassName = "io.grpc.benchmarks.qps.AsyncClient" 55 applicationName = "qps_client" 56 defaultJvmOpts = [ 57 "-javaagent:" + configurations.alpnagent.asPath 58 ].plus(vmArgs) 59 outputDir = new File(project.buildDir, 'tmp') 60 classpath = jar.outputs.files + project.configurations.runtime 61} 62 63task openloop_client(type: CreateStartScripts) { 64 mainClassName = "io.grpc.benchmarks.qps.OpenLoopClient" 65 applicationName = "openloop_client" 66 defaultJvmOpts = [ 67 "-javaagent:" + configurations.alpnagent.asPath 68 ].plus(vmArgs) 69 outputDir = new File(project.buildDir, 'tmp') 70 classpath = jar.outputs.files + project.configurations.runtime 71} 72 73task qps_server(type: CreateStartScripts) { 74 mainClassName = "io.grpc.benchmarks.qps.AsyncServer" 75 applicationName = "qps_server" 76 outputDir = new File(project.buildDir, 'tmp') 77 classpath = jar.outputs.files + project.configurations.runtime 78} 79 80task benchmark_worker(type: CreateStartScripts) { 81 mainClassName = "io.grpc.benchmarks.driver.LoadWorker" 82 applicationName = "benchmark_worker" 83 defaultJvmOpts = [ 84 "-javaagent:" + configurations.alpnagent.asPath 85 ].plus(vmArgs) 86 outputDir = new File(project.buildDir, 'tmp') 87 classpath = jar.outputs.files + project.configurations.runtime 88} 89 90applicationDistribution.into("bin") { 91 from(qps_client) 92 from(openloop_client) 93 from(qps_server) 94 from(benchmark_worker) 95 fileMode = 0755 96} 97