如何通过源码生成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 ...
随机推荐
- Linux系统入门学习:在CentOS上安装phpMyAdmin
问题:我正在CentOS上运行一个MySQL/MariaDB服务,并且我想要通过网络接口来用phpMyAdmin来管理数据库.在CentOS上安装phpMyAdmin的最佳方法是什么? phpMyAd ...
- twisted 初体验
前言: 最近帮朋友review其模块服务代码, 使用的是python的twisted网络框架. 鉴于之前并没有使用过, 于是决定好好研究一番. 个人接触最早的高性能网络编程框架是Mina, 所谓先入为 ...
- 110. Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary ...
- 94. Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tre ...
- 第三课,T语言数据类型(版本TC5.0)
数据类型 TC综合开发工具里使用的是可变类型,就是在程序执行过程中,TC综合开发工具会自动把数据转换为需要的类型,转换失败会出现相应的提示但是在一些特殊的场景下,是需要做类型强制处理,那么这时就需要使 ...
- Samba服务器安装及配置
Samba最早诞生在unix操作系统上面,samba是基于SMB(Server Message Block)协议,是一种客户端服务器协议 一.安装samba # yum -y install samb ...
- kuangbin_UnionFind A (POJ 2236)
挺接近模板的一题 接受O操作的时候扫一遍 符合条件的merge进去 done #include <cstdio> #include <cstring> #include < ...
- 嵌入式系统Linux内核开发工程师必须掌握的三十道题(转)
嵌入式系统Linux内核开发工程师必须掌握的三十道题 如果你能正确回答以下问题并理解相关知识点原理,那么你就可以算得上是基本合格的Linux内核开发工程师,试试看! 1) Linux中主要有哪几种内核 ...
- Java——jdk1.5新特性
/* * 可变参数:--一个方法的参数个数不固定. * 特点: * 只能出现在参数列表的最后. * 调用可变参数的方法时,编译器为该可变参数隐含创建一个数组,在方法体中以数组的形式访问可变参 ...
- Java 学习
effective+java第三版 2016-09-23 15:25 effective+java第三版 相关问答 EffectiveJava第28条中关于泛型的一个疑问? @又名耶稣谢邀 一.先说说 ...