如何通过源码生成Gatling可执行工具
其实,这个对于不是很熟系sbt的人来说,或者对scala语言没有什么了解的人,接触Gatling这个开源的性能测试框架,还是有些茫然的。
因为GitHub上提供的Gatling (最新版本:2.2.0 snapshot)是源码,而且,完整的Gatling被拆分为Gatling(Core,相当于测试引擎吧)和Gatling-highchats(主要是用来生成测试报告)两部分。不知到为何要拆分为两部分,也许是因为Gatling-highchats部分引用了特殊license的软件插件(HighCharts & HighStock, 来自于HighSoft公司。。。)
1. 首先,从github上clone下gatling的源码。
git clone http://github.com/gatling/gatling
git clone http://github.com/gatling/gatling-highcharts
待这些文件都下载到本地后,先进入gatling的目录,在命令行下执行 sbt compile (,若你的系统下没有安装SBT,请先自己安装,我是直接在SBT官网下载的0.13.9的版本,解压到local目录下,再在/etc/profile下配置一下环境变量,方便使用)。gatling文件列表如下:
-rw-r--r-- root root Jan : CONTRIBUTING.md
drwxr-xr-x root root Jan : gatling-app
drwxr-xr-x root root Jan : gatling-bundle
drwxr-xr-x root root Jan : gatling-charts
drwxr-xr-x root root Jan : gatling-commons
drwxr-xr-x root root Jan : gatling-compiler
drwxr-xr-x root root Jan : gatling-core
drwxr-xr-x root root Jan : gatling-http
drwxr-xr-x root root Jan : gatling-jdbc
drwxr-xr-x root root Jan : gatling-jms
drwxr-xr-x root root Jan : gatling-metrics
drwxr-xr-x root root Jan : gatling-recorder
drwxr-xr-x root root Jan : gatling-redis
drwxr-xr-x root root Jan : gatling-test-framework
-rwxr-xr-x root root Jan : make_credentials.sh
-rw-r--r-- root root Jan : pgp.sbt
drwxr-xr-x root root Jan : project
-rw-r--r-- root root Jan : README.md
drwxr-xr-x root root Jan : src
drwxr-xr-x root root Jan : target
-rwxr-xr-x root root Jan : trigger_build.py
-rw-r--r-- root root Jan : version.sbt
sbt compile执行完毕后(可能需要一段时间,因为有些依赖的库要下载),需要将其发布到ivy仓库中(你也可以发布到mave仓库):
sbt publishLocal
[root@CloudGame gatling]# sbt publishLocal
[info] Loading global plugins from /root/.sbt/0.13/plugins
[info] Loading project definition from /mnt/workwps/gatling2.1.7/gatling/project
[info] Set current project to gatling-parent (in build file:/mnt/workwps/gatling2.1.7/gatling/)
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-compiler/target/gatling-compiler-2.2.-SNAPSHOT-sources.jar ...
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-core/target/gatling-core-2.2.-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Done packaging.
SLF4J: The following set of substitute loggers may have been accessed
SLF4J: during the initialization phase. Logging calls during this
SLF4J: phase were not honored. However, subsequent logging calls to these
SLF4J: loggers will work as normally expected.
SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
SLF4J: org.eclipse.aether.internal.impl.DefaultRepositorySystem
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-commons/target/gatling-commons-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-compiler/target/gatling-compiler-2.2.-SNAPSHOT.pom
[info] :: delivering :: io.gatling#gatling-commons;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-commons/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-compiler;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-compiler/target/ivy-2.2.-SNAPSHOT.xml
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-core/target/gatling-core-2.2.-SNAPSHOT.pom
[info] :: delivering :: io.gatling#gatling-core;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-core/target/ivy-2.2.-SNAPSHOT.xml
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-metrics/target/gatling-metrics-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-redis/target/gatling-redis-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-charts/target/gatling-charts-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-jms/target/gatling-jms-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-http/target/gatling-http-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-jdbc/target/gatling-jdbc-2.2.-SNAPSHOT.pom
[info] :: delivering :: io.gatling#gatling-metrics;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-metrics/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-jms;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-jms/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-charts;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-charts/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-redis;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-redis/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-jdbc;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-jdbc/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-http;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-http/target/ivy-2.2.-SNAPSHOT.xml
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-bundle/target/gatling-bundle-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/target/gatling-parent-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-app/target/gatling-app-2.2.-SNAPSHOT.pom
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-recorder/target/gatling-recorder-2.2.-SNAPSHOT.pom
[info] :: delivering :: io.gatling#gatling-bundle;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-bundle/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-app;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-app/target/ivy-2.2.-SNAPSHOT.xml
[info] :: delivering :: io.gatling#gatling-parent;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/target/ivy-2.2.-SNAPSHOT.xml
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-compiler/target/gatling-compiler-2.2.-SNAPSHOT.jar ...
[info] published gatling-bundle to /root/.ivy2/local/io.gatling/gatling-bundle/2.2.-SNAPSHOT/poms/gatling-bundle.pom
[info] Done packaging.
[info] published gatling-bundle to /root/.ivy2/local/io.gatling/gatling-bundle/2.2.-SNAPSHOT/zips/gatling-bundle-bundle.zip
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-bundle/2.2.-SNAPSHOT/ivys/ivy.xml
[info] :: delivering :: io.gatling#gatling-recorder;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-recorder/target/ivy-2.2.-SNAPSHOT.xml
[info] Wrote /mnt/workwps/gatling2.1.7/gatling/gatling-test-framework/target/gatling-test-framework-2.2.-SNAPSHOT.pom
[info] published gatling-parent to /root/.ivy2/local/io.gatling/gatling-parent/2.2.-SNAPSHOT/poms/gatling-parent.pom
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-parent/2.2.-SNAPSHOT/ivys/ivy.xml
[info] published gatling-commons to /root/.ivy2/local/io.gatling/gatling-commons/2.2.-SNAPSHOT/poms/gatling-commons.pom
[info] published gatling-commons to /root/.ivy2/local/io.gatling/gatling-commons/2.2.-SNAPSHOT/jars/gatling-commons.jar
[info] published gatling-commons to /root/.ivy2/local/io.gatling/gatling-commons/2.2.-SNAPSHOT/srcs/gatling-commons-sources.jar
[info] published gatling-commons to /root/.ivy2/local/io.gatling/gatling-commons/2.2.-SNAPSHOT/docs/gatling-commons-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-commons/2.2.-SNAPSHOT/ivys/ivy.xml
[info] published gatling-compiler to /root/.ivy2/local/io.gatling/gatling-compiler/2.2.-SNAPSHOT/poms/gatling-compiler.pom
[info] published gatling-compiler to /root/.ivy2/local/io.gatling/gatling-compiler/2.2.-SNAPSHOT/jars/gatling-compiler.jar
[info] published gatling-compiler to /root/.ivy2/local/io.gatling/gatling-compiler/2.2.-SNAPSHOT/srcs/gatling-compiler-sources.jar
[info] published gatling-compiler to /root/.ivy2/local/io.gatling/gatling-compiler/2.2.-SNAPSHOT/docs/gatling-compiler-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-compiler/2.2.-SNAPSHOT/ivys/ivy.xml
[info] :: delivering :: io.gatling#gatling-test-framework;2.2.-SNAPSHOT :: 2.2.-SNAPSHOT :: integration :: Fri Jan :: CST
[info] delivering ivy file to /mnt/workwps/gatling2.1.7/gatling/gatling-test-framework/target/ivy-2.2.-SNAPSHOT.xml
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-jms/target/api...
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-jdbc/target/api...
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-charts/target/api...
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-metrics/target/api...
model contains documentable templates
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-redis/target/api...
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-http/target/api...
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-jdbc/target/gatling-jdbc-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-core/target/gatling-core-2.2.-SNAPSHOT.jar ...
[info] Done packaging.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-metrics/target/gatling-metrics-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-redis/target/gatling-redis-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] published gatling-core to /root/.ivy2/local/io.gatling/gatling-core/2.2.-SNAPSHOT/poms/gatling-core.pom
[info] published gatling-core to /root/.ivy2/local/io.gatling/gatling-core/2.2.-SNAPSHOT/jars/gatling-core.jar
[info] published gatling-core to /root/.ivy2/local/io.gatling/gatling-core/2.2.-SNAPSHOT/srcs/gatling-core-sources.jar
[info] published gatling-core to /root/.ivy2/local/io.gatling/gatling-core/2.2.-SNAPSHOT/docs/gatling-core-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-core/2.2.-SNAPSHOT/ivys/ivy.xml
[info] published gatling-jdbc to /root/.ivy2/local/io.gatling/gatling-jdbc/2.2.-SNAPSHOT/poms/gatling-jdbc.pom
[info] published gatling-jdbc to /root/.ivy2/local/io.gatling/gatling-jdbc/2.2.-SNAPSHOT/jars/gatling-jdbc.jar
[info] published gatling-jdbc to /root/.ivy2/local/io.gatling/gatling-jdbc/2.2.-SNAPSHOT/srcs/gatling-jdbc-sources.jar
[info] published gatling-jdbc to /root/.ivy2/local/io.gatling/gatling-jdbc/2.2.-SNAPSHOT/docs/gatling-jdbc-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-jdbc/2.2.-SNAPSHOT/ivys/ivy.xml
[info] published gatling-redis to /root/.ivy2/local/io.gatling/gatling-redis/2.2.-SNAPSHOT/poms/gatling-redis.pom
[info] published gatling-redis to /root/.ivy2/local/io.gatling/gatling-redis/2.2.-SNAPSHOT/jars/gatling-redis.jar
[info] published gatling-redis to /root/.ivy2/local/io.gatling/gatling-redis/2.2.-SNAPSHOT/srcs/gatling-redis-sources.jar
[info] published gatling-redis to /root/.ivy2/local/io.gatling/gatling-redis/2.2.-SNAPSHOT/docs/gatling-redis-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-redis/2.2.-SNAPSHOT/ivys/ivy.xml
[info] published gatling-metrics to /root/.ivy2/local/io.gatling/gatling-metrics/2.2.-SNAPSHOT/poms/gatling-metrics.pom
[info] published gatling-metrics to /root/.ivy2/local/io.gatling/gatling-metrics/2.2.-SNAPSHOT/jars/gatling-metrics.jar
[info] published gatling-metrics to /root/.ivy2/local/io.gatling/gatling-metrics/2.2.-SNAPSHOT/srcs/gatling-metrics-sources.jar
[info] published gatling-metrics to /root/.ivy2/local/io.gatling/gatling-metrics/2.2.-SNAPSHOT/docs/gatling-metrics-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-metrics/2.2.-SNAPSHOT/ivys/ivy.xml
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-app/target/api...
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-recorder/target/api...
[info] Main Scala API documentation successful.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-jms/target/gatling-jms-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-app/target/gatling-app-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] published gatling-jms to /root/.ivy2/local/io.gatling/gatling-jms/2.2.-SNAPSHOT/poms/gatling-jms.pom
[info] published gatling-jms to /root/.ivy2/local/io.gatling/gatling-jms/2.2.-SNAPSHOT/jars/gatling-jms.jar
[info] published gatling-jms to /root/.ivy2/local/io.gatling/gatling-jms/2.2.-SNAPSHOT/srcs/gatling-jms-sources.jar
[info] published gatling-jms to /root/.ivy2/local/io.gatling/gatling-jms/2.2.-SNAPSHOT/docs/gatling-jms-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-jms/2.2.-SNAPSHOT/ivys/ivy.xml
[info] published gatling-app to /root/.ivy2/local/io.gatling/gatling-app/2.2.-SNAPSHOT/poms/gatling-app.pom
[info] published gatling-app to /root/.ivy2/local/io.gatling/gatling-app/2.2.-SNAPSHOT/jars/gatling-app.jar
[info] published gatling-app to /root/.ivy2/local/io.gatling/gatling-app/2.2.-SNAPSHOT/srcs/gatling-app-sources.jar
[info] published gatling-app to /root/.ivy2/local/io.gatling/gatling-app/2.2.-SNAPSHOT/docs/gatling-app-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-app/2.2.-SNAPSHOT/ivys/ivy.xml
[info] Main Scala API documentation to /mnt/workwps/gatling2.1.7/gatling/gatling-test-framework/target/api...
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-test-framework/target/gatling-test-framework-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] published gatling-test-framework to /root/.ivy2/local/io.gatling/gatling-test-framework/2.2.-SNAPSHOT/poms/gatling-test-framework.pom
[info] published gatling-test-framework to /root/.ivy2/local/io.gatling/gatling-test-framework/2.2.-SNAPSHOT/jars/gatling-test-framework.jar
[info] published gatling-test-framework to /root/.ivy2/local/io.gatling/gatling-test-framework/2.2.-SNAPSHOT/srcs/gatling-test-framework-sources.jar
[info] published gatling-test-framework to /root/.ivy2/local/io.gatling/gatling-test-framework/2.2.-SNAPSHOT/docs/gatling-test-framework-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-test-framework/2.2.-SNAPSHOT/ivys/ivy.xml
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-charts/target/gatling-charts-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] published gatling-charts to /root/.ivy2/local/io.gatling/gatling-charts/2.2.-SNAPSHOT/poms/gatling-charts.pom
[info] published gatling-charts to /root/.ivy2/local/io.gatling/gatling-charts/2.2.-SNAPSHOT/jars/gatling-charts.jar
[info] published gatling-charts to /root/.ivy2/local/io.gatling/gatling-charts/2.2.-SNAPSHOT/srcs/gatling-charts-sources.jar
[info] published gatling-charts to /root/.ivy2/local/io.gatling/gatling-charts/2.2.-SNAPSHOT/docs/gatling-charts-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-charts/2.2.-SNAPSHOT/ivys/ivy.xml
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-recorder/target/gatling-recorder-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] published gatling-recorder to /root/.ivy2/local/io.gatling/gatling-recorder/2.2.-SNAPSHOT/poms/gatling-recorder.pom
[info] published gatling-recorder to /root/.ivy2/local/io.gatling/gatling-recorder/2.2.-SNAPSHOT/jars/gatling-recorder.jar
[info] published gatling-recorder to /root/.ivy2/local/io.gatling/gatling-recorder/2.2.-SNAPSHOT/srcs/gatling-recorder-sources.jar
[info] published gatling-recorder to /root/.ivy2/local/io.gatling/gatling-recorder/2.2.-SNAPSHOT/docs/gatling-recorder-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-recorder/2.2.-SNAPSHOT/ivys/ivy.xml
model contains documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /mnt/workwps/gatling2.1.7/gatling/gatling-http/target/gatling-http-2.2.-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] published gatling-http to /root/.ivy2/local/io.gatling/gatling-http/2.2.-SNAPSHOT/poms/gatling-http.pom
[info] published gatling-http to /root/.ivy2/local/io.gatling/gatling-http/2.2.-SNAPSHOT/jars/gatling-http.jar
[info] published gatling-http to /root/.ivy2/local/io.gatling/gatling-http/2.2.-SNAPSHOT/srcs/gatling-http-sources.jar
[info] published gatling-http to /root/.ivy2/local/io.gatling/gatling-http/2.2.-SNAPSHOT/docs/gatling-http-javadoc.jar
[info] published ivy to /root/.ivy2/local/io.gatling/gatling-http/2.2.-SNAPSHOT/ivys/ivy.xml
[success] Total time: s, completed Jan , :: PM
这个过程,比较像mvn install将生成的模块安装到本地.m2仓库中的过程。到此,gatling引擎部分编译和发布完成。
然后,进入gatling-highchats,和上述编译gatling的过程类似,执行sbt compile,然后在发布到本地ivy仓库。注意,一定要先对gatling进行发布后再编译gatling-highchats,否则在编译gatling-highchats的时候会报错的,找不到依赖的库。
至此,编译部分都完成了,那么,问题来了,生成的工具(可执行文件)在什么地方呢?在什么地方可以执行刚才生成的工具呢?官网上说的比较清楚,我也倾向于用bundle的文件来执行。默认情况下,这个文件会在ivy的仓库里面。就拿我的环境来说,其目录如下:
[root@CloudGame zips]# pwd
/root/.ivy2/local/io.gatling.highcharts/gatling-charts-highcharts-bundle/2.2.-SNAPSHOT/zips
文件内容如下:
[root@CloudGame gatling-charts-highcharts-bundle-2.2.-SNAPSHOT]# ll
total
drwxr-xr-x root root Jan : bin
drwxr-xr-x root root Jan : lib
-rw-r--r-- root root Jan : LICENSE
drwxr-xr-x root root Jan : results
drwxr-xr-x root root Jan : user-files
[root@CloudGame gatling-charts-highcharts-bundle-2.2.-SNAPSHOT]# cd bin/
[root@CloudGame bin]# ll
total
-rwxr--r-- root root Jan : gatling.bat
-rwxr--r-- root root Jan : gatling.sh
-rwxr--r-- root root Jan : recorder.bat
-rwxr--r-- root root Jan : recorder.sh
上面加黑的目录,就是我们想要的被解压后的目录,里面有我们期待的内容:
[root@CloudGame gatling-bundle-2.2.-SNAPSHOT]# ll
total
drwxr-xr-x root root Jan : bin
-rw-r--r-- root root Jan : LICENSE
drwxr-xr-x root root Jan : results
drwxr-xr-x root root Jan : user-files
[root@CloudGame gatling-bundle-2.2.-SNAPSHOT]# cd bin/
[root@CloudGame bin]# ll
total
-rwxr-xr-x root root Jan : gatling.bat
-rwxr-xr-x root root Jan : gatling.sh
-rwxr-xr-x root root Jan : recorder.bat
-rwxr-xr-x root root Jan : recorder.sh
到这里,可以说从源码生成gatling的过程结束了!
在此,我要说明一点就是,2.2.0-SNAPSHOT的版本,比较新,里面有些api是JDK8的,所以,在编译运行的时候,保证你的环境是jdk8哟,否则会出现下面的错误:
[root@CloudGame bin]# ./recorder.sh
GATLING_HOME is set to /root/.ivy2/local/io.gatling.highcharts/gatling-charts-highcharts-bundle/2.2.-SNAPSHOT/zips/gatling-charts-highcharts-bundle-2.2.-SNAPSHOT
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigRenderOptions : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:)
at java.net.URLClassLoader.access$(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at io.gatling.recorder.config.RecorderConfiguration$.<init>(RecorderConfiguration.scala:)
at io.gatling.recorder.config.RecorderConfiguration$.<clinit>(RecorderConfiguration.scala)
at io.gatling.recorder.GatlingRecorder$.io$gatling$recorder$GatlingRecorder$$initRecorder(GatlingRecorder.scala:)
at io.gatling.recorder.GatlingRecorder$$anonfun$fromArgs$.apply(GatlingRecorder.scala:)
at io.gatling.recorder.GatlingRecorder$$anonfun$fromArgs$.apply(GatlingRecorder.scala:)
at scala.Option.map(Option.scala:)
at io.gatling.recorder.GatlingRecorder$.fromArgs(GatlingRecorder.scala:)
at io.gatling.recorder.GatlingRecorder$.main(GatlingRecorder.scala:)
at io.gatling.recorder.GatlingRecorder.main(GatlingRecorder.scala)
最后,测试一下源码来的工具是否可用,哈哈,看到recorder的启动界面了,如下图,说明一切正常!
附加一下设置项目的javaHome的命令,即相关的操作!
gatling-parent > set every javaHome := sys.env.get("JAVA_HOME") map file
[info] Defining */*:javaHome
[info] The new value will be used by gatling-app/*:compilers, gatling-app/*:console::compilers and 125 others.
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to gatling-parent (in build file:/mnt/workwps/gatling2.1.7/gatling/)
gatling-parent > show javaHome
[info] gatling-core/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-compiler/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-redis/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-metrics/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-commons/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-recorder/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-jms/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-app/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-test-framework/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-http/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-charts/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-bundle/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-jdbc/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
[info] gatling-parent/*:javaHome
[info] Some(/usr/java/jdk1.8.0_65)
gatling-parent >
OK,完工!
如何通过源码生成Gatling可执行工具的更多相关文章
- 通过源码了解ASP.NET MVC 几种Filter的执行过程
一.前言 之前也阅读过MVC的源码,并了解过各个模块的运行原理和执行过程,但都没有形成文章(所以也忘得特别快),总感觉分析源码是大神的工作,而且很多人觉得平时根本不需要知道这些,会用就行了.其实阅读源 ...
- 通过源码了解ASP.NET MVC 几种Filter的执行过程 在Winform中菜单动态添加“最近使用文件”
通过源码了解ASP.NET MVC 几种Filter的执行过程 一.前言 之前也阅读过MVC的源码,并了解过各个模块的运行原理和执行过程,但都没有形成文章(所以也忘得特别快),总感觉分析源码是大神 ...
- Linux下通过源码编译安装程序
本文简单的记录了下,在linux下如何通过源码安装程序,以及相关的知识.(大神勿喷^_^) 一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 库文件: ...
- 通过源码安装PostgresSQL
通过源码安装PostgresSQL 1.1 下载源码包环境: Centos6.8 64位 yum -y install bison flex readline-devel zlib-devel yum ...
- 在centos6.7通过源码安装python3.6.7报错“zipimport.ZipImportError: can't decompress data; zlib not available”
在centos6.7通过源码安装python3.6.7报错: zipimport.ZipImportError: can't decompress data; zlib not available 从 ...
- Kafka详解六:Kafka如何通过源码实现监控
问题导读: 1.kafka的消费者组的消费偏移存储,kafka支持两个版本? 2.ConsumerOffsetChecker类的作用是什么? 3.Kafka如何通过源码实现 ...
- 通过源码编译安装VIM
开发中使用的是Ubuntu 12.04 LTS,通过sudo apt-get install vim安装的版本较低,不支持YCM,所以,用源码编译并安装最新的Vim. 卸载旧版本的Vim: sudo ...
- 通过源码分析Java开源任务调度框架Quartz的主要流程
通过源码分析Java开源任务调度框架Quartz的主要流程 从使用效果.调用链路跟踪.E-R图.循环调度逻辑几个方面分析Quartz. github项目地址: https://github.com/t ...
- echarts 通过源码方法 传入对应data数据获取分割步长值
通过源码方法获取这里的分割数字长度 /** * Quantity of a number. e.g. 0.1, 1, 10, 100 * * @param {number} val * @return ...
随机推荐
- Windows Server 2008 R2: 创建任务计划
task Scheduler 在业务复杂的应用程序中,有时候会要求一个或者多个任务在一定的时间或者一定的时间间隔内计划进行,比如定时备份或同步数据库,定时发送电子邮件等. 创建一个任务计划: 开始St ...
- cocosbuilder3.0使用小记
新项目用到了堪称完美的cocos2d-x2.1.5版本,用cocsbuilder2.1版本出现了返回的最终node为null的问题,看xcode的提示说: cocos2d: WARNING! Inco ...
- view的加载
这是一个listpopwindow的布局,如果listview在relativeLayout之后写的那么listview就会把relativeLayout给覆盖掉,这证明布局的加载是按照布局文件写的先 ...
- springmvc学习笔记---idea创建springmvc项目
前言: 真的是很久没搞java的web服务开发了, 最近一次搞还是读研的时候, 想来感慨万千. 英雄没落, Eclipse的盟主地位隐隐然有被IntelliJ IDEA超越的趋势. Spring从2. ...
- 用Python对excel文件的简单操作
#-*-coding:utf8-*- import xlrd #代开excel文件读取数据 data = xlrd.open_workbook("C:\\Users\\hyl\\Deskto ...
- 16年大连网络赛 1006 Football Games
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?cid=725&pid=1006 Football Games Time ...
- activiti 任务节点 处理人设置【转】
转自http://blog.csdn.net/qq_30739519/article/details/51225067 1.1.1. 前言 分享牛原创(尊重原创 转载对的时候第一行请注明,转载出处来自 ...
- hdu5442(2015长春赛区网络赛1006)后缀数组+KMP /最小表示法?
题意:给定一个由小写字母组成的长度为 n 的字符串,首尾相连,可以从任意一个字符开始,顺时针或逆时针取这个串(长度为 n),求一个字典序最大的字符串的开始字符位置和顺时针或逆时针.如果有多个字典序最大 ...
- Android Studio 使用教程
http://www.tuicool.com/articles/amMvM3B 用 Android Studio 开发安卓 APP-使用篇 http://ask.android-studio.org/ ...
- docker学习3-虚拟网络模式
一.虚拟机网络模式 在理解docker网络隔离前,先看下之前虚拟机里对网络的处理,VirtualBox中有4中网络连接方式: NAT Bridged Adapter Internal Host-onl ...