jenkins:应用篇(Gatling plugin的使用)

Jenkins的功能强大,在于它的插件式框架,能扩展功能,自动化当中,很容易想到的是对提交的新代码做测试,这里gatling主要是负责压力测试,也就是所谓的性能。关于gatling,可以参考我前面的博文。

在jenkins下,首先要安装gatling的插件,可以直接在Jenkins>Manage Jenkins>Manage Plugins>Available下点击安装,也可以在Advance里面通过上传安装。由于我这里两个浏览器设置的代理不同,在测试jenkins的浏览器中不能直接点击Available里面的gatling安装,网络无法联通。所以,我在另外一个带有FQ代理的浏览器中,先下载了gatling.hpi(我这里是1.1.1版本)插件文件到本地。再通过advance的tab下上传文件的方式进行安装。

按照上图,只需要关注红色框部分即可,其他就默认吧,点击submit,然后将jenkins重启,gatling plugin就安装好了。

现在可以看看jenkins下的gatling是如何集成在maven项目里,做一个自动化性能测试的。还是基于前面博文的项目mueas,由于之前,mueas项目下,没有gatling的支持。所以,要在mueas工程的pom文件添加依赖和plugin的配置。

下面先看看依赖的配置:

1     <!-- Add Gatling maven plugin to support gatling startup to test performance -->
2     <dependency>
3             <groupId>io.gatling.highcharts</groupId>
4             <artifactId>gatling-charts-highcharts</artifactId>
5             <version>2.1.6</version>
6     </dependency>        

再就是在pom文件的build部分添加plugin的配置:

 1 <build>
 2         <plugins>
 3             。。。。。  #此处是其他相关的plugin的内容,省略了
 4             <plugin>
 5                   <groupId>io.gatling</groupId>
 6                   <artifactId>gatling-maven-plugin</artifactId>
 7                   <version>2.1.6</version>
 8                   <configuration>  #此configuration部分的配置,要结合自己的项目的结构来填写信息
 9                       <configFolder>src/test/resources</configFolder>
10                       <dataFolder>src/test/resources/data</dataFolder>
11                       <resultsFolder>target/gatling/results</resultsFolder>
12                       <bodiesFolder>src/test/resources/bodies</bodiesFolder>
13                       <simulationsFolder>src/test/scala</simulationsFolder>
14                 </configuration>
15                   <executions>
16                     <execution>
17                       <id>execution-1</id>
18                       <goals>
19                         <goal>execute</goal>
20                       </goals>
21                       <configuration>
22                         <simulationClass>simple/MueasSimulation_Simple</simulationClass>
23                       </configuration>
24                     </execution>
25                     <!-- Here, can repeat the above execution segment to do another test -->
26                 </executions>
27             </plugin>
28         </plugins>
29     </build>

附带着将eclipse中maven工程的文件结构也展示一下:

由于gatling的压力测试脚本是基于scala语言写的,所以,目录中simulationFolder部分src/test/scala下面,是一个scala的程序。

那这里,看看这个scala脚本程序是什么样子吧,很简单:

 1 package simple
 2
 3 import io.gatling.core.Predef._
 4 import io.gatling.http.Predef._
 5 import scala.concurrent.duration._
 6
 7 class MueasSimulation extends Simulation{
 8   val httpConf = http.baseURL("http://localhost:8080")
 9
10   val scn = scenario("Redirect Login Page")
11      .exec(http("Redirect Login").get("/").check(status.is(200)))
12      .pause(10 seconds)
13      .exec(http("Try Login").post("/login").formParamSeq(Seq(("username","你自己的用户名"),("password", "你自己的密码"))).check(status.is(200)))
14      .pause(10 seconds)
15
16   //setUp(scn.inject(rampUsers(10) over (60 seconds)).protocols(httpConf))
17   setUp(scn.inject(atOnceUsers(5)).protocols(httpConf))
18 }

mueas工程修改好了,通过git将新修改提交到远程仓库,方便jenkins管理。

到此,可以配置jenkins了,创建一个新的Job,配置基本信息可以参考前面Jenkins的基础篇,这里,主要是强调一下,关于这个gatling集成应用的配置。主要在build部分。下面这个图,主要是Pre Steps里面的Execute shell的编写,用来清除环境,主要是杀掉可能存在的应用。脚本很简单,自己看看就明白。

再就是Post Steps的配置,完成两步工作,第一步是启动mueas应用,第二步,就是启用gatling来进行压力测试。

到这里,所有的配置,关于gatling在jenkins的集成,全部完成。现在可以启动jenkins的job了。直接Build。完成后,可以看到下面的日志信息。

  1 Started by user anonymous
  2 Building in workspace /root/.jenkins/jobs/mueas-gatling/workspace
  3  > git rev-parse --is-inside-work-tree # timeout=10
  4 Fetching changes from the remote Git repository
  5  > git config remote.origin.url [email protected]109.105.5.108:/data/git/mueas.git # timeout=10
  6 Fetching upstream changes from [email protected]109.105.5.108:/data/git/mueas.git
  7  > git --version # timeout=10
  8 using GIT_SSH to set credentials root private key
  9  > git -c core.askpass=true fetch --tags --progress [email protected]109.105.5.108:/data/git/mueas.git +refs/heads/*:refs/remotes/origin/*
 10  > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 11  > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
 12 Checking out Revision 7ae96f26da0f7b1ff289b6008d3531872938bd17 (refs/remotes/origin/master)
 13  > git config core.sparsecheckout # timeout=10
 14  > git checkout -f 7ae96f26da0f7b1ff289b6008d3531872938bd17
 15  > git rev-list 7ae96f26da0f7b1ff289b6008d3531872938bd17 # timeout=10
 16  > git tag -a -f -m Jenkins Build #14 jenkins-mueas-gatling-14 # timeout=10
 17 [workspace] $ /bin/bash /tmp/hudson3630375499244789010.sh
 18 ================= PRE STEPS TRACKING BEGIN =================
 19 WORKSPACE: /root/.jenkins/jobs/mueas-gatling/workspace
 20 target dir: /root/.jenkins/jobs/mueas-gatling/workspace/target
 21 war file: /root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war
 22 specified running instance: mueas-0.0.1-SNAPSHOT.war --server.port=8080
 23 runningpid:
 24 There is no running instance as specified
 25 ================= PRE STEPS TRACKING END ===================
 26 Parsing POMs
 27 [workspace] $ /usr/java/jdk1.8.0_65/bin/java -cp /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/usr/local/apache-maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/usr/local/apache-maven-3.3.3/conf/logging jenkins.maven3.agent.Maven31Main /usr/local/apache-maven-3.3.3 /root/.jenkins/war/WEB-INF/lib/remoting-2.53.2.jar /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 44372
 28 <===[JENKINS REMOTING CAPACITY]===>???channel started
 29 Executing Maven:  -B -f /root/.jenkins/jobs/mueas-gatling/workspace/pom.xml -s /root/.m2/settings.xml -gs /usr/local/apache-maven-3.3.3/conf/settings.xml package -Dmaven.test.skip=true
 30 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
 31 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 32 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
 33 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building mueas 0.0.1-SNAPSHOT
 34 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
 35 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 36 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:resources (default-resources) @ mueas ---
 37 [pool-1-thread-1 for channel] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Using ‘UTF-8‘ encoding to copy filtered resources.
 38 [pool-1-thread-1 for channel] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 0 resource
 39 [pool-1-thread-1 for channel] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 863 resources
 40 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 41 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:compile (default-compile) @ mueas ---
 42 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.compiler.CompilerMojo - Nothing to compile - all classes are up to date
 43 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 44 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:testResources (default-testResources) @ mueas ---
 45 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.resources.TestResourcesMojo - Not copying test resources
 46 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 47 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mueas ---
 48 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - Not compiling test sources
 49 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 50 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-surefire-plugin:2.17:test (default-test) @ mueas ---
 51 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.surefire.SurefirePlugin - Tests are skipped.
 52 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 53 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-war-plugin:2.5:war (default-war) @ mueas ---
 54 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Packaging webapp
 55 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Assembling webapp [mueas] in [/root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT]
 56 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Processing war project
 57 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Copying webapp resources [/root/.jenkins/jobs/mueas-gatling/workspace/src/main/webapp]
 58 [pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Webapp assembled in [740 msecs]
 59 [pool-1-thread-1 for channel] INFO org.codehaus.plexus.archiver.war.WarArchiver - Building war: /root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war
 60 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 61 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- spring-boot-maven-plugin:1.2.7.RELEASE:repackage (default) @ mueas ---
 62 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
 63 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD SUCCESS
 64 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
 65 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 11.367 s
 66 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2016-01-21T16:37:44+08:00
 67 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 23M/315M
 68 [pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
 69 [JENKINS] Archiving /root/.jenkins/jobs/mueas-gatling/workspace/pom.xml to com.tinguish/mueas/0.0.1-SNAPSHOT/mueas-0.0.1-SNAPSHOT.pom
 70 [JENKINS] Archiving /root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war to com.tinguish/mueas/0.0.1-SNAPSHOT/mueas-0.0.1-SNAPSHOT.war
 71 [workspace] $ /bin/bash /tmp/hudson1486991218168918628.sh
 72 channel stopped
 73 ================= POST STEPS TRACKING BEGIN =================
 74 WORKSPACE: /root/.jenkins/jobs/mueas-gatling/workspace
 75 target dir: /root/.jenkins/jobs/mueas-gatling/workspace/target
 76 war file: /root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war
 77 BEGIN TO DO GATLING SIMULATION....
 78 SLF4J: Class path contains multiple SLF4J bindings.
 79 SLF4J: Found binding in [jar:file:/root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war!/WEB-INF/lib/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 80 SLF4J: Found binding in [jar:file:/root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war!/WEB-INF/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 81 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
 82 SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
 83
 84   .   ____          _            __ _ _
 85  /\\ / ___‘_ __ _ _(_)_ __  __ _ \ \ \  86 ( ( )\___ | ‘_ | ‘_| | ‘_ \/ _` | \ \ \  87  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
 88   ‘  |____| .__|_| |_|_| |_\__, | / / / /
 89  =========|_|==============|___/=/_/_/_/
 90  :: Spring Boot ::        (v1.2.7.RELEASE)
 91
 92 2016-01-21 16:37:46.843  INFO 23716 --- [           main] com.tinguish.mueas.Application           : Starting Application on CloudGame with PID 23716 (started by root in /root/.jenkins/jobs/mueas-gatling/workspace)
 93 2016-01-21 16:37:46.980  INFO 23716 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]1e76c2be: startup date [Thu Jan 21 16:37:46 CST 2016]; root of context hierarchy
 94 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
 95 2016-01-21 16:37:48.032  WARN 23716 --- [           main] .i.s.PathMatchingResourcePatternResolver : Skipping [/root/.jenkins/jobs/mueas-gatling/workspace/target/mueas-0.0.1-SNAPSHOT.war] because it does not denote a directory
 96 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
 97 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
 98 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building mueas 0.0.1-SNAPSHOT
 99 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
100 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
101 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- gatling-maven-plugin:2.1.6:execute (default-cli) @ mueas ---
102
103 此部分省略。。。。。。。。。。。。。。
104
105 2016-01-21 16:38:07.615  INFO 23716 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
106 2016-01-21 16:38:07.625  INFO 23716 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
107 2016-01-21 16:38:07.752  INFO 23716 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
108 2016-01-21 16:38:07.755  INFO 23716 --- [           main] com.tinguish.mueas.Application           : Started Application in 21.824 seconds (JVM running for 23.128)
109 [2016-01-21 16:38:09.971] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpProtocol:169: Warm up done
110 [2016-01-21 16:38:09.988] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- Controller:91: Total number of users : 5
111 [2016-01-21 16:38:09.997] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- FileDataWriter:90: Initializing
112 [2016-01-21 16:38:10.003] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-5] --- ConsoleDataWriter:90: Initializing
113 [2016-01-21 16:38:10.006] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-5] --- ConsoleDataWriter:92: Initialized
114 [2016-01-21 16:38:10.013] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- FileDataWriter:92: Initialized
115 [2016-01-21 16:38:10.038] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Controller:216: Start user #8390468609261222568-0
116 [2016-01-21 16:38:10.039] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Controller:216: Start user #8390468609261222568-1
117 [2016-01-21 16:38:10.040] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Controller:216: Start user #8390468609261222568-2
118 [2016-01-21 16:38:10.041] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Controller:216: Start user #8390468609261222568-3
119 [2016-01-21 16:38:10.041] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Controller:216: Start user #8390468609261222568-4
120 [2016-01-21 16:38:10.059] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/: scenario=Redirect Login Page, userId=8390468609261222568-0
121 [2016-01-21 16:38:10.087] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/: scenario=Redirect Login Page, userId=8390468609261222568-1
122 [2016-01-21 16:38:10.091] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/: scenario=Redirect Login Page, userId=8390468609261222568-2
123 [2016-01-21 16:38:10.093] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/: scenario=Redirect Login Page, userId=8390468609261222568-3
124 [2016-01-21 16:38:10.099] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/: scenario=Redirect Login Page, userId=8390468609261222568-4
125
126 ================================================================================
127 2016-01-21 16:38:10                                           0s elapsed
128 ---- Redirect Login Page -------------------------------------------------------
129 [                                                                          ]  0%
130           waiting: 5      / active: 0      / done:0
131 ---- Requests ------------------------------------------------------------------
132 > Global                                                   (OK=0      KO=0     )
133
134 ================================================================================
135
136 2016-01-21 16:38:10.218  INFO 23716 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet ‘dispatcherServlet‘
137 2016-01-21 16:38:10.218  INFO 23716 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet ‘dispatcherServlet‘: initialization started
138 2016-01-21 16:38:10.262  INFO 23716 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet ‘dispatcherServlet‘: initialization completed in 44 ms
139 [2016-01-21 16:38:10.396] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-4] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-4
140 [2016-01-21 16:38:10.398] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-2] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-0
141 [2016-01-21 16:38:10.396] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-5] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-3
142 [2016-01-21 16:38:10.403] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-2
143 [2016-01-21 16:38:10.412] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- HttpEngine:270: Sending request=Redirect Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-1
144 [2016-01-21 16:38:11.142] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- Pause:46: Pausing for 10000ms (real=9936ms)
145 [2016-01-21 16:38:11.144] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- Pause:46: Pausing for 10000ms (real=9974ms)
146 [2016-01-21 16:38:11.144] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- Pause:46: Pausing for 10000ms (real=9949ms)
147 [2016-01-21 16:38:11.145] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- Pause:46: Pausing for 10000ms (real=9949ms)
148 [2016-01-21 16:38:11.146] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- Pause:46: Pausing for 10000ms (real=9945ms)
149
150 ================================================================================
151 2016-01-21 16:38:15                                           5s elapsed
152 ---- Redirect Login Page -------------------------------------------------------
153 [--------------------------------------------------------------------------]  0%
154           waiting: 0      / active: 5      / done:0
155 ---- Requests ------------------------------------------------------------------
156 > Global                                                   (OK=10     KO=0     )
157 > Redirect Login                                           (OK=5      KO=0     )
158 > Redirect Login Redirect 1                                (OK=5      KO=0     )
159 ================================================================================
160
161
162 ================================================================================
163 2016-01-21 16:38:20                                          10s elapsed
164 ---- Redirect Login Page -------------------------------------------------------
165 [--------------------------------------------------------------------------]  0%
166           waiting: 0      / active: 5      / done:0
167 ---- Requests ------------------------------------------------------------------
168 > Global                                                   (OK=10     KO=0     )
169 > Redirect Login                                           (OK=5      KO=0     )
170 > Redirect Login Redirect 1                                (OK=5      KO=0     )
171 ================================================================================
172
173 [2016-01-21 16:38:21.099] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-1
174 [2016-01-21 16:38:21.108] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-2
175 [2016-01-21 16:38:21.121] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-0
176 [2016-01-21 16:38:21.123] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-3
177 [2016-01-21 16:38:21.135] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-4
178 [2016-01-21 16:38:21.233] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-9] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-1
179 [2016-01-21 16:38:21.233] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-2
180 [2016-01-21 16:38:21.239] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-8] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-4
181 [2016-01-21 16:38:21.248] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-2] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-3
182 [2016-01-21 16:38:21.266] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- HttpEngine:270: Sending request=Try Login uri=http://localhost:8080/login: scenario=Redirect Login Page, userId=8390468609261222568-0
183 [2016-01-21 16:38:21.274] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-10] --- Pause:46: Pausing for 10000ms (real=9985ms)
184 [2016-01-21 16:38:21.281] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- Pause:46: Pausing for 10000ms (real=9984ms)
185 [2016-01-21 16:38:21.289] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Pause:46: Pausing for 10000ms (real=9974ms)
186 [2016-01-21 16:38:21.290] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Pause:46: Pausing for 10000ms (real=9983ms)
187 [2016-01-21 16:38:21.295] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-6] --- Pause:46: Pausing for 10000ms (real=9971ms)
188
189 ================================================================================
190 2016-01-21 16:38:25                                          15s elapsed
191 ---- Redirect Login Page -------------------------------------------------------
192 [--------------------------------------------------------------------------]  0%
193           waiting: 0      / active: 5      / done:0
194 ---- Requests ------------------------------------------------------------------
195 > Global                                                   (OK=20     KO=0     )
196 > Redirect Login                                           (OK=5      KO=0     )
197 > Redirect Login Redirect 1                                (OK=5      KO=0     )
198 > Try Login                                                (OK=5      KO=0     )
199 > Try Login Redirect 1                                     (OK=5      KO=0     )
200 ================================================================================
201
202
203 ================================================================================
204 2016-01-21 16:38:30                                          20s elapsed
205 ---- Redirect Login Page -------------------------------------------------------
206 [--------------------------------------------------------------------------]  0%
207           waiting: 0      / active: 5      / done:0
208 ---- Requests ------------------------------------------------------------------
209 > Global                                                   (OK=20     KO=0     )
210 > Redirect Login                                           (OK=5      KO=0     )
211 > Redirect Login Redirect 1                                (OK=5      KO=0     )
212 > Try Login                                                (OK=5      KO=0     )
213 > Try Login Redirect 1                                     (OK=5      KO=0     )
214 ================================================================================
215
216 [2016-01-21 16:38:31.288] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- Controller:203: End user #8390468609261222568-2
217 [2016-01-21 16:38:31.288] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- Controller:203: End user #8390468609261222568-1
218 [2016-01-21 16:38:31.289] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-3] --- Controller:203: End user #8390468609261222568-3
219 [2016-01-21 16:38:31.295] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-8] --- Controller:203: End user #8390468609261222568-4
220 [2016-01-21 16:38:31.297] log4j - ????  INFO [GatlingSystem-akka.actor.default-dispatcher-8] --- Controller:203: End user #8390468609261222568-0
221
222 ================================================================================
223 2016-01-21 16:38:31                                          21s elapsed
224 ---- Redirect Login Page -------------------------------------------------------
225 [##########################################################################]100%
226           waiting: 0      / active: 0      / done:5
227 ---- Requests ------------------------------------------------------------------
228 > Global                                                   (OK=20     KO=0     )
229 > Redirect Login                                           (OK=5      KO=0     )
230 > Redirect Login Redirect 1                                (OK=5      KO=0     )
231 > Try Login                                                (OK=5      KO=0     )
232 > Try Login Redirect 1                                     (OK=5      KO=0     )
233 ================================================================================
234
235 Simulation finished
236 Parsing log file(s)...
237 [2016-01-21 16:38:31.375] log4j - ????  INFO [main] --- FileDataReader:56: Collected List(/root/.jenkins/jobs/mueas-gatling/workspace/target/gatling/results/mueassimulation-1453365489988/simulation.log) from mueassimulation-1453365489988
238 [2016-01-21 16:38:31.385] log4j - ????  INFO [main] --- FileDataReader:73: First pass
239 [2016-01-21 16:38:31.392] log4j - ????  INFO [main] --- FileDataReader:118: First pass done: read 31 lines
240 [2016-01-21 16:38:31.397] log4j - ????  INFO [main] --- FileDataReader:132: Second pass
241 [2016-01-21 16:38:31.429] log4j - ????  INFO [main] --- FileDataReader:157: Second pass: read 31 lines
242 Parsing log file(s) done
243 Generating reports...
244
245 ================================================================================
246 ---- Global Information --------------------------------------------------------
247 > request count                                         20 (OK=20     KO=0     )
248 > min response time                                     29 (OK=29     KO=-     )
249 > max response time                                    718 (OK=718    KO=-     )
250 > mean response time                                   283 (OK=283    KO=-     )
251 > std deviation                                        250 (OK=250    KO=-     )
252 > response time 50th percentile                        206 (OK=206    KO=-     )
253 > response time 75th percentile                        398 (OK=398    KO=-     )
254 > mean requests/sec                                   0.94 (OK=0.94   KO=-     )
255 ---- Response Time Distribution ------------------------------------------------
256 > t < 800 ms                                            20 (100%)
257 > 800 ms < t < 1200 ms                                   0 (  0%)
258 > t > 1200 ms                                            0 (  0%)
259 > failed                                                 0 (  0%)
260 ================================================================================
261
262 Reports generated in 0s.
263 Please open the following file: /root/.jenkins/jobs/mueas-gatling/workspace/target/gatling/results/mueassimulation-1453365489988/index.html
264 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
265 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD SUCCESS
266 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
267 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 44.253 s
268 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2016-01-21T16:38:31+08:00
269 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 13M/228M
270 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
271 ================= POST STEPS TRACKING END ===================
272 Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
273 Archiving Gatling reports...
274 Adding report ‘mueassimulation-1453365489988‘
275 2016-01-21 16:38:41.999  INFO 23716 --- [       Thread-2] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot[email protected]1e76c2be: startup date [Thu Jan 21 16:37:46 CST 2016]; root of context hierarchy
276 Finished: SUCCESS

我执行了两次,没有做任何修改,因为一次测试,gatling的结果图上只有一个点,看不出差别。两次之间,有时间上的差别。。。

关于gatling和jenkins的集成的官方信息,可以参考一下下面的链接:

http://gatling.io/docs/2.1.7/extensions/jenkins_plugin.html

http://gatling.io/docs/2.1.7/extensions/maven_plugin.html?highlight=maven%20plugin

到此完

时间: 2024-10-12 21:16:26

jenkins:应用篇(Gatling plugin的使用)的相关文章

5.jenkins使用Email Extension Plugin插件配置邮件通知

jenkins自带有邮件通知的功能 在"系统管理"–>"系统设置"中的"邮件通知"模块可以配置邮件通知,在配置之前应先配置"jenkins Location"中的系统管理员邮箱, 然后配置管理员邮箱的账户密码信息,如下图 根据自己所使用的邮箱配置,配置完成后可以点击"Test configuration" 发送一封测试邮件到"Test e-mail recipient"所配置的邮箱

在Jenkins中使用Git Plugin访问Https代码库失败的问题

最近需要在Jenkins上配置一个Job,SCM源是http://git.opendaylight.org/gerrit/p/integration.git 于是使用Jenkins的Git Plugin做这件事情. 结果报错如下: hudson.plugins.git.GitException: Failed to fetch from https://git.opendaylight.org/gerrit/p/integration.git at hudson.plugins.git.GitS

Jenkins &lt;3&gt;: Role Strategy Plugin

Most of the time, there are many projects in your CI server, and you don't wanna a project member execute the other projects jobs. So to avoid that things happen, use this plugin is a good choice. Please refer the link below to configure this plugin.

Jenkins (四) jenkins添加HTML Publisher Plugin测试报告

在Jenkins插件管理下载HTML Publisher Plugin 和 Groovy 插件 1.安装好后会在增加构建后操作出现Publish HTML reports选项,添加Publish HTML reports 和 归档成品 2.配置Publish HTML reports 和  归档成品 3.执行命令栏的测试报告名称要一致 4.添加 execute system Groovy,自动执行脚本如下脚本 System.setProperty("hudson.model.DirectoryB

kubernetes之CI/CD工具jenkins第二篇,helm的使用

1. kubernetes之CI/CD第二篇-jenkins结合helm部署应用: 1. 概述: ?? 在前期的博文中我已经初步介绍过kubernetes环境下的CI/CD的使用.主要是jenkins slave pod自动创建和销毁,当有jenkins job任务执行的时候,就会自动创建一个jenkins slave pod.在本篇博文中,我们将介绍jenkins生成slave pod的另外一种方法,就是在pipeline脚本里面定义slave pod的镜像等,同时将Dockerfile.Je

Jenkins——应用篇——插件使用——Publish over SSH

本文是jenkins应用系统文章的一部分,大部分来自工作和学习中的实践,部分内容来自官方文档和网友的文章,引用的文章会在"参考资料"部分附上原始链接,如无意中侵犯您的权利,请联系QQ:46106962,如需要进一步的交流请加入QQ群:(Jenkins学习交流)469536515.转载和使用请注明出处. 依赖环境 SSH,远程机开启SSH服务,允许Jenkins所在机器通过SSH服务登录到远程机执行脚本:可以设置SSH使用用户名/密码或通过key登录,SSH配置请查专门的资料这里不做说明

Jenkins插件HTML Publisher Plugin的使用

前提: 下载插件HTML Publisher plugin 一.安装 安装好HTML Publisher plugin之后,会在新建或者编辑项目时,在[增加构建后操作步骤]出现[Publish HTML reports]的选项.如下: 二.配置 点击上面构建步骤后,在这里会出现配置项目: 点击[增加]进行配置,在配置之后,先看下每一项的说明,以下来自google翻译: 按照上面的说明,我的配置如下: 我只配置了HTML directory to archive的项,上面说了,这个路径是相对于工作

Jenkins用HTTP Request Plugin插件进行网站的监控/加探针(运维监控)

使用的插件: [HTTP Request Plugin] 思路: 说明:只能是网站是否正常打开,而不能是这个网站业务是否正常,如果是后者,则需要写特定的接口进行请求处理. 1.通过插件,发送GET请求指定的URL. 2.设置请求超时时间,如果过了,则这个网站不正常. 3.设置定时请求. 4.不正常访问时,直接发送邮件通知指定人员. 配置步骤: 1.配置间隔时间 注意这里应该选择[Build periodically](周期性构建) Poll SCM:定时检查源码变更(根据SCM软件的版本号),如

Jenkins 安装的HTML Publisher Plugin 插件无法展示ant生成的JunitReport报告

最近在做基于jenkins ant  junit 的测试持续集成,单独ant junit生成的junitreport报告打开正常,使用Jenkins的HTML Publisher Plugin 插件无法正常展示报告内容,仅有三个frame占位框,如下图所示 这是由于jenkins一些安全设置导致的展示不全问题,点击F12,可以看到如下报错 解决办法 方法一:登陆jenkins系统,点击"系统管理"----"脚本命令行",执行如下命令,重新刷新JunitReport日