s

import net.grinder.script.Barrier
import net.grinder.script.GTest
import net.grinder.scriptengine.groovy.junit.GrinderRunner
import net.grinder.scriptengine.groovy.junit.annotation.BeforeProcess
import net.grinder.scriptengine.groovy.junit.annotation.BeforeThread
import net.grinder.scriptengine.groovy.junit.annotation.Repeat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith import java.util.concurrent.CyclicBarrier import static org.junit.Assert.* import static net.grinder.script.Grinder.grinder // import static net.grinder.util.GrinderUtils.* // You can use this if you're using nGrinder after 3.2.3
/**
* A simple example using the HTTP plugin that shows the retrieval of a
* single page via HTTP.
*
* This script is automatically generated by ngrinder.
*
* @author Lindows
*/
@RunWith(GrinderRunner)
class TestBarrier {
GTest test = new GTest(1, "upload1") Barrier grinderBarrier @BeforeProcess
public static void beforeProcess() {
grinder.logger.info("before process.");
} @BeforeThread
public void beforeThread() {
test.record(this, "upload1")
grinder.logger.info("before thread."); grinderBarrier = grinder.barrier("集合点1") //等注册完成
sleep(1000)
} @Before
public void before() {
grinder.logger.info("before.");
} @Test
public void test2() { //等待集合完毕后开始执行
grinderBarrier.await()
action() } public void action(){
sleep(1000)
} }

end

nGrinder TestRunnerBarrier.groovy / jihedian的更多相关文章

  1. nGrinder TestRunnerInsertMysqlSingle.groovy

    s C:\Users\Lindows\workspace\GroovyTest\src\com\iteye\lindows\mysql\TestRunnerInsertMysqlSingle.groo ...

  2. nGrinder TestRunnerInsertMysqlMore.groovy

    s C:\Users\Lindows\workspace\GroovyTest\src\com\iteye\lindows\mysql\TestRunnerInsertMysqlMore.groovy ...

  3. nGrinder TestGroovy.groovy

    s /** * */ package com.iteye.lindows.mysql /** * @author Lindows * */ class TestGroovy { static main ...

  4. 基于Groovy搭建Ngrinder脚本调试环境

    介绍 最近公司搭建了一套压力测试平台,引用的是开源的项目 Ngrinder,做了二次开发,在脚本管理方面,去掉官方的SVN,引用的是Git,其他就是做了熔断处理等. 对技术一向充满热情的我,必须先来拥 ...

  5. 基于Groovy编写Ngrinder脚本常用方法

    1.生成随机字符串(import org.apache.commons.lang.RandomStringUtils) 数字:RandomStringUtils.randomNumeric(lengt ...

  6. Ngrinder脚本开发各细节锦集(groovy)

    Ngrinder脚本开发各细节锦集(groovy) 1.生成随机字符串(import org.apache.commons.lang.RandomStringUtils) 数字:RandomStrin ...

  7. nGrinder 简易使用教程

    背景 性能压测工具之前使用的是jmeter,这次说的是nGrinder,先直接搬运两者之间的比较 比较点 JMeter nGrinder 结果 实现语言 Java Java = License Apa ...

  8. nGrinder Loadrunner vs nGrinder

    s d 功能 参数类型 取值方式 迭代方式 Loadrunner实现方式 nGrinder实现方式 参数化 文件  sequential (顺序取值) Each Iteration (每次迭代) 在参 ...

  9. nGrinder TestRunner http post json

    s nGrinder学习笔记 — post请求 https://blog.csdn.net/meyoung01/article/details/50435881 import HTTPClient.H ...

随机推荐

  1. VSCode里面HTML添加CSS时没有提示

    看到知乎上的回答,vscode修改设置的: "editor.parameterHints": true, "editor.quickSuggestions": ...

  2. windows常用服务命令

    windows运行打开服务命令的方法 :在开始->运行,输入以下命令 gpedit.msc-----组策略 sndrec32-------录音机 Nslookup-------IP地址侦测器 e ...

  3. Modelsim脚本仿真文件分析

    Do文件的实质是tcl脚本,本质上是ascii文件.所以扩展名可以任意的,不一定叫xx.do,也可以叫xx.tcl,甚至叫成你的名字也没有关系.看自己喜好,一般取do,不过我喜欢取成tcl,用代码编辑 ...

  4. 利用SSH上传、下载(使用sz与rz命令)

    安装yum -y install lrzsz 用法sz用法:从服务器发送出去相当于下载一个文件sz filename 下载多个文件sz filename1 filename2rz用法:从外面接收回来, ...

  5. selenium的等待~

    既然使用了selenium,那么必然牺牲了一些速度上的优势,但由于公司网速不稳定,导致频频出现加载报错,这才意识到selenium等待的重要性. 说到等待又可以分为3类, 1.强制等待 time.sl ...

  6. HDU--5519 Sequence II (主席树)

    题目链接 2016年长春ccpc I 题 题目大意 : 给你n(n≤2∗105n≤2∗105)个数,每个数的大小 0<Ai≤2∗10^5   0<Ai≤2∗10^5. 再给你m(m≤2∗1 ...

  7. 浅析 @PathVariable 和 @RequestParam(转发,非原创)

    首先 上两个地址:地址①http://localhost:8989/SSSP/emps?pageNo=2地址②http://localhost:8989/SSSP/emp/7如果想获取地址①中的 pa ...

  8. python与java的猜拳游戏

    python版: import randomprint("-----猜拳游戏-----")print("---0.剪刀--1.石头--2.布---")while ...

  9. 团体程序设计天梯赛(CCCC) L3009 长城 方法证明

    团体程序设计天梯赛代码.体现代码技巧,比赛技巧.  https://github.com/congmingyige/cccc_code

  10. bcftools将vcf生成bgzip和index格式

    利用bcftools软件将vcf格式生成gz格式和index格式,需要用到“-Oz”和“index”命令,具体如下: /bcftools-1.8/bin/bcftools view ExAC.vcf ...