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. Git简介及安装

    1 Git简介 Git是一个开源的分布式版本控制系统,可以有效.高速的处理从很小到非常大的项目版本管理. Git是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码 ...

  2. Mac下安装MySQL(Mac 10.12)

    系统:Mac OS 10.12 MySQL:5.7.15 前言: 安装mysql有两种方式:1为官方下载dmg安装包.2为使用brew进行安装. 安装步骤: 一.官方下载dmg安装包进行安装 1.登陆 ...

  3. POJ 2449 Remmarguts' Date (算竞进阶习题)

    A* + dijkstra/spfa 第K短路的模板题,就是直接把最短路当成估价函数,保证估价函数的性质(从当前状态转移的估计值一定不大于实际值) 我们建反图从终点跑最短路,就能求出从各个点到终点的最 ...

  4. 不同版本的Chrom浏览器对应的ChromDriver的版本

    附chromedriver与chrome的对应关系表: chromedriver版本 支持的Chrome版本 v2.40 v66-68 v2.39 v66-68 v2.38 v65-67 v2.37 ...

  5. 【BZOJ3992】【SDOI2015】序列统计 原根 NTT

    题目大意 有一个集合\(s\),里面的每个数都\(\geq0\)且\(<m\). 问有多少个长度为\(n\)的数列满足这个数列所有数的乘积模\(m\)为\(x\).答案模\(1004535809 ...

  6. bzoj 1103 : [POI2007]大都市meg (树链剖分+线段树)

    Description 在经济全球化浪潮的影响下,习惯于漫步在清晨的乡间小路的邮递员Blue Mary也开始骑着摩托车传递邮件了.不过,她经常回忆起以前在乡间漫步的情景.昔日,乡下有依次编号为1..n ...

  7. 使用tree命令导出文件夹/文件的目录树

    前提:己安装扩展: 介绍: TREE [drive:][path] [/F] [/A] /F   显示每个文件夹中文件的名称.(带扩展名)   /A   使用 ASCII 字符,而不使用扩展字符. t ...

  8. mysql 2006错误 导入时

    导入数据库报此错误 1.找到my.ini (免安装版的是由于你自己创建的) (安装版的在 C:\ProgramData\MySQL\MySQL Server 8.0   你安装的盘位置) 2.修改参数 ...

  9. mysql 远程连接 10038

    1,先确认本地是否能连上本地能连上就对用户进行授权 mysql>grant all privileges on *.* to 'root'@'%' identified by 'youpassw ...

  10. WebService学习总结(一)——WebService的相关概念

    一.序言 大家或多或少都听过 WebService(Web服务),有一段时间很多计算机期刊.书籍和网站都大肆的提及和宣传WebService技术,其中不乏很多吹嘘和做广告的成 分.但是不得不承认的是W ...