corda/tools/jmeter/build.gradle

103 lines
4.6 KiB
Groovy
Raw Normal View History

2017-10-31 17:22:58 +00:00
apply plugin: 'kotlin'
apply plugin: 'us.kirchmeier.capsule'
2017-10-31 17:22:58 +00:00
apply plugin: 'application'
mainClassName = 'net.corda.jmeter.Launcher'
dependencies {
compile project(':client:rpc')
compile project(':finance')
compile project(':tools:loadtest')
2017-10-31 17:22:58 +00:00
// JMeter
ext.jmVersion = "3.3"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_components', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_ftp', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_functions', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: "$jmVersion"
compile group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version: "$jmVersion" // 'compile' because we extend Java sampler.
2017-10-31 17:22:58 +00:00
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_jdbc', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_jms', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_junit', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_ldap', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_mail', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_mongodb', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_native', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_tcp', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter_config', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'ApacheJMeter', version: "$jmVersion"
runtime group: 'org.apache.jmeter', name: 'jorphan', version: "$jmVersion"
}
2017-11-02 11:44:27 +00:00
task(runServer, dependsOn: 'classes', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.jmeter.Launcher'
systemProperty "search_paths", project(':tools:jmeter').configurations.runtime.files.join(";")
systemProperty "java.rmi.server.hostname", "0.0.0.0"
systemProperty "jmeter.home", sourceSets.main.resources.getSrcDirs().first().getPath()
// If you want to debug: jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
2017-11-02 11:44:27 +00:00
args+= [ "-p", sourceSets.main.resources.getSrcDirs().first().getPath()+"/jmeter.properties",
"-d", sourceSets.main.resources.getSrcDirs().first().getPath(),
"-s" ]
}
2017-10-31 17:22:58 +00:00
task(runSsh, dependsOn: 'classes', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.jmeter.Ssh'
if ( project.hasProperty("jmeterHosts") ) {
args Eval.me(jmeterHosts)
}
standardInput = System.in
}
2017-10-31 17:22:58 +00:00
run {
systemProperty "search_paths", project(':tools:jmeter').configurations.runtime.files.join(";")
systemProperty "java.rmi.server.hostname", "localhost"
systemProperty "jmeter.home", sourceSets.main.resources.getSrcDirs().first().getPath()
// If you want to debug: jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
2017-10-31 17:22:58 +00:00
args+= [ "-p", sourceSets.main.resources.getSrcDirs().first().getPath()+"/jmeter.properties",
"-d", sourceSets.main.resources.getSrcDirs().first().getPath() ]
if ( project.hasProperty("jmeterHosts") ) {
args+= "-Xssh"
args+= Eval.me(jmeterHosts)
}
2017-10-31 17:22:58 +00:00
}
jar {
manifest {
attributes(
2017-11-02 11:44:27 +00:00
'Automatic-Module-Name': 'net.corda.tools.jmeter',
'Main-Class': mainClassName
2017-10-31 17:22:58 +00:00
)
}
2017-11-02 11:44:27 +00:00
zip64 = true
}
// For building a runnable jar with no other dependencies for remote JMeter slave server, that has Corda code on classpath.
// Run with: java -jar corda-jmeter-<version>.jar
// No additional args required but will be passed if specified.
task buildJMeterJAR(type: FatCapsule, dependsOn: 'jar') {
applicationClass 'net.corda.jmeter.Launcher'
archiveName "jmeter-corda-${corda_release_version}.jar"
applicationSource = files(
project(':tools:jmeter').jar
)
from 'NOTICE' // Copy CDDL notice
from("$rootDir/tools/jmeter/build/resources/main") {
include "log4j2.xml"
include "*.properties"
}
capsuleManifest {
applicationVersion = corda_release_version
systemProperties['java.rmi.server.hostname'] = 'localhost'
minJavaVersion = '1.8.0'
minUpdateVersion['1.8'] = java8_minUpdateVersion
// JVM configuration. Can be overridden on java command line.
jvmArgs = ['-Xms512m', '-Xmx512m', '-XX:+UseG1GC']
}
}