性能测试工作室:http://www.cnblogs.com/preftest 个人博客: http://hi.baidu.com/higkoo

| 初次体验openSTA

上一篇 / 下一篇  2007-06-02 23:53:03 / 个人分类:测试技术

0Jz@/e6FS(Z0最近研究一个开源性能测试功能openSTA,网上资源确实太少,刚巧最近工作留给我的时间很少。

C\r B-@?0

9X{b:i&x]9]K$R`0今天无奈的我,还是逼自己静下心看Help文档了。有点小成果,赶紧记下来。

c+J.@g#i/v Q ^0

#N*??dzMn9Vl`0将下面代码复制到 scrīpt Modeler 中,在Commander里运行,查看其Test Report Log。51Testing软件测试网2VD:mn%E/quA&VIP

w6i^ s k7P0!***************************代码头***************************!

!B|FA1~s+M(`\0
Environment					!1
 	 Descrīption ""				!2
Definitions					!3
	iNTEGER i (1-100), scrīpt			!4
	integer m,local				!5
code						!6
	report "m=",m				!7
	ACQUIRE MUTEX "first"			!8
	next i					!9
	set m = i					!10
	report "m=",m				!11
	RELEASE MUTEX "first"			!12
	report "m=",m				!13

d#k"W;q_ H0!***************************代码尾***************************!

CO S0u4c G9n9i%I0

'p vS.H&e#}]0t ?-r0测试报表51Testing软件测试网"x N-NN3I

51Testing软件测试网kv&bG2]q

此脚本虽小,且简单,但你确可从中明白openSTA的一些实现过程。

|j3_.U$?051Testing软件测试网&LS y!l8u6yj(y2s

一、从UserID你可以知道,并发的三个用户,开始运行是没有先后顺序的。

8|E;e8^8@;|0W2]8c%a7rc051Testing软件测试网]a(g4B)T%D-Q

二、从Line#你可以知道,代码7行处的m一直等于0,代码11行、13行都是从1递增。51Testing软件测试网o$gS$^2P^!Y!B

51Testing软件测试网$J%f ]*K6P3s3L`Gw

三、给我留下了一个疑点,ACQUIRE MUTEX 、RELEASE MUTEX 的作用和区别。51Testing软件测试网*d_9xl+B-on%y

Help文档描述如下:发呆51Testing软件测试网 ]*s y.B'C
ACQUIRE MUTEX Command太阳51Testing软件测试网L*ZpCyj;ws+sxG@
This command acquires exclusive access to a shared resource, known as a mutex. The mutex is identified by its name and scope (which must be either LOCAL or TEST-WIDE). A test-wide mutex is one that is shared by all scrīpts running as part of a distributed test; a local mutex is only shared between scrīpts running on the local node.
}6P;wbh)ytA0RELEASE MUTEX Command灯泡
P)u*r d!\fL0This command releases a named mutex. The mutex to be released is identified by its name and scope, which must correspond to the values specified on the corresponding ACQUIRE MUTEX command.
sY [ ~'BL:I0看着这翻译和我的理解,结合这结果,让我很不理解重伤
'A(r3|2dy6J+y0

TAG: 开源 自动化 性能 负载 工具 测试技术

 

评分:0

我来说两句

higkoo

higkoo

Just do it.

日历

« 2024-04-25  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 247824
  • 日志数: 56
  • 图片数: 1
  • 文件数: 18
  • 建立时间: 2007-01-10
  • 更新时间: 2008-09-30

RSS订阅

Open Toolbar