文档库

最新最全的文档下载
当前位置:文档库 > loadrunner测试tuxedo服务

loadrunner测试tuxedo服务

Loadrunner11监控Tuxed o 性能

一、tuxedo客户端安装及配置:

1、客户端环境:win7、windows xp(这里是win7)

2、客户端:tuxedo111120_32_win_2k8_x86_VS2008.exe(这个包含了客户端与服务端,安装时,选择装客户端就可以了;可以在oracle官方网站下载);

3、安装方法:(1)单击右键,以管理员身份安装;

(2)选择路径c:\bea\tuxedo11gR1(可以选择其他路径);

(3)设置环境变量名称TUXDIR,值为c:\bea\tuxedo11gR1;(若要安装服务端,请参考:tuxedo11g安装for Windows.doc,安装的时候记得选择安装simpapp)(4)windows XP 环境变量PATH: c:\bea\tuxedo11gR1\bin

二、服务端安装及配置:

OS: Win7家庭普通版

编译器: Microsoft Visual Studio 2010

tuxedo:tuxedo11gR1_32_win_2k8_x86_VS2008.exe

tuxedo安装路径:D:\bea11g\tuxedo11gR1

App程序路径:D:\src\simpapp

1)安装tuxedo:tuxedo11gR1_32_win_2k8_x86_VS2008.exe,以管理员方式运行

2)将simpapp示例程序copy到:D:\src

3)将vcvars32.bat 拷贝到D:\src\simpapp文件下

本机安装的是Microsoft Visual Studio 2010

本机的vcvars32.bat位于D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat

4)修改setenv.cmd

rem(c) 2003 BEA Systems, Inc. All Rights Reserved.

rem Copyright (c) 2000 BEA Systems, Inc.

rem All Rights Reserved

rem THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF

rem BEA Systems, Inc.

rem The copyright notice above does not evidence any

rem actual or intended publication of such source code.

rem Copyright (c) 2000 BEA Systems, Inc.

rem All rights reserved

rem ident";@(#) apps/simpapp/setenv.cmd$Revision: 1.5 $";

set TUXDIR=D:\bea11g\tuxedo11gR1

set WSNADDR=192.168.1.174::8880

set APPDIR=D:\src\simpapp

set PATH=%TUXDIR%\bin;%APPDIR%;%PATH%

set TUXCONFIG=%APPDIR%\tuxconfig

Call D:\src\simpapp\vcvars32.bat

5)修改ubbsimple

#(c) 2003 BEA Systems, Inc. All Rights Reserved.

#ident";@(#) samples/atmi/simpapp/ubbsimple$Revision: 1.7 $";

#Skeleton UBBCONFIG file for the TUXEDO Simple Application.

#Replace the <;bracketed>; items with the appropriate values.

*RESOURCES

#IPCKEY<;Replace with a valid IPC Key>;

#Example:

IPCKEY 123456

DOMAINID simpapp

MASTER simple

MAXACCESSERS 10

MAXSERVERS 5

MAXSERVICES 10

MODELSHM

LDBALN

*MACHINES

DEFAULT:

APPDIR=";D:\src\simpapp";

TUXCONFIG=";D:\src\simpapp\tuxconfig";

TUXDIR=";D:\bea11g\tuxedo11gR1";

#Example:

#APPDIR=";/home/me/simpapp";

#TUXCONFIG=";/home/me/simpapp/tuxconfig";

#TUXDIR=";/usr/tuxedo";

";THINKPAD-WM";LMID=simple #THINKPAD-WM为本机计算机名

#Example:

#beatuxLMID=simple

*GROUPS

GROUP1

LMID=simpleGRPNO=1OPENINFO=NONE

*SERVERS

DEFAULT:

CLOPT=";-A";

simpservSRVGRP=GROUP1 SRVID=1

*SERVICES

TOUPPER

6)以管理员方式运行cmd(最好从我下载的里面直接运行:见simpapp.rar),执行下面命令

D:\src\simpapp>;dir

驱动器 D 中的卷没有标签。

卷的序列号是 DE8E-46C4

D:\src\simpapp 的目录

2011/05/25 14:19 <;DIR>; .

2011/05/25 14:19 <;DIR>; ..

2011/05/25 14:10 2,943 README

2011/05/25 14:10 2,911 README.nt

2011/05/25 14:14 665 setenv.cmd

2011/05/25 14:10 1,953 simpapp.nt

2011/05/25 14:10 1,826 simpcl.c

2011/05/25 14:10 1,632 simpserv.c

2011/05/25 14:18 824 ubbsimple

2009/12/16 05:45 4,062 vcvars32.bat

8 个文件 16,816 字节

2 个目录 92,729,303,040 可用字节

D:\src\simpapp>;setenv.cmd //执行环境变量

D:\src\simpapp>;rem (c) 2003 BEA Systems, Inc. All Rights Reserved.

D:\src\simpapp>;rem Copyright (c) 2000 BEA Systems, Inc.

D:\src\simpapp>;rem All Rights Reserved

D:\src\simpapp>;rem THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF

D:\src\simpapp>;rem BEA Systems, Inc.

D:\src\simpapp>;rem The copyright notice above does not evidence any

D:\src\simpapp>;rem actual or intended publication of such source code.

D:\src\simpapp>;rem Copyright (c) 2000 BEA Systems, Inc.

D:\src\simpapp>;rem All rights reserved

D:\src\simpapp>;rem ident ";@(#) apps/simpapp/setenv.cmd $Revision: 1.5 $

";

D:\src\simpapp>;set TUXDIR=D:\bea11g\tuxedo11gR1

D:\src\simpapp>;set WSNADDR=192.168.166.111:3050

D:\src\simpapp>;set APPDIR=D:\src\simpapp

D:\src\simpapp>;set

PATH=D:\bea11g\tuxedo11gR1\bin;D:\src\simpapp;d:\oracle\produ

ct\10.2.0\client_1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Li ve;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\ W

indowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Lenovo; C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Lenovo\Access Connections\;C:\Program Files\Windows Live\Shared;C:\Program Files\Lenovo\Client Security Solution;D:\Program Files\TortoiseSVN\bin;C:\Program Files\Common File s\Thunder Network\KanKan\Codecs;C:\Program Files\Microsoft SQL Server\100\Tools\ Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;d:\Program Files\Windo ws7Master;D:\bea11g\tuxedo11gR1\bin;D:\bea11g\tuxedo11gR1\jre\bin\server;D:\bea 1

1g\tuxedo11gR1\jre\bin;D:\Program Files\IDM Computer Solutions\UltraEdit\

D:\src\simpapp>;set TUXCONFIG=D:\src\simpapp\tuxconfig

D:\src\simpapp>;Call D:\src\simpapp\vcvars32.bat

Setting environment for using Microsoft Visual Studio 2010 x86 tools.

D:\src\simpapp>;buildserver -o simpserv -f simpserv.c -s TOUPPER -v //编译服务器端程序

cl /MD -I";%TUXDIR%";\include -Fesimpserv BS-1a34.c simpserv.c ";%TUXDIR%";\lib\li btux.lib ";%TUXDIR%";\lib\libbuft.lib ";%TUXDIR%";\lib\libfml.lib ";%TUXDIR%";\lib\

libfml32.lib ";%TUXDIR%";\lib\libengine.lib wsock32.lib kernel32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib -link -implib:BS-1a34.lib

用于 80x86 的 Microsoft (R) 32 位 C/C++ 优化编译器 16.00.30319.01 版

版权所有(C) Microsoft Corporation。保留所有权利。

BS-1a34.c

simpserv.c

正在生成代码...

Microsoft (R) Incremental Linker Version 10.00.30319.01

Copyright (C) Microsoft Corporation. All rights reserved.

/out:simpserv.exe

-implib:BS-1a34.lib

BS-1a34.obj

simpserv.obj

D:\bea11g\tuxedo11gR1\lib\libtux.lib

D:\bea11g\tuxedo11gR1\lib\libbuft.lib

D:\bea11g\tuxedo11gR1\lib\libfml.lib

D:\bea11g\tuxedo11gR1\lib\libfml32.lib

D:\bea11g\tuxedo11gR1\lib\libengine.lib

wsock32.lib

kernel32.lib

advapi32.lib

user32.lib

gdi32.lib

comdlg32.lib

winspool.lib

D:\src\simpapp>;buildclient -o simpcl -f simpcl.c -v //编译客户端程序

cl /MD -I";%TUXDIR%";\include -Fesimpcl simpcl.c ";%TUXDIR%";\lib\libtux.lib ";% TUXDIR%";\lib\libbuft.lib ";%TUXDIR%";\lib\libfml.lib ";%TUXDIR%";\lib\libfml32.lib

";%TUXDIR%";\lib\libengine.lib wsock32.lib kernel32.lib advapi32.lib user32.lib g di32.lib comdlg32.lib winspool.lib -link -implib:BC-1b6c.lib

用于 80x86 的 Microsoft (R) 32 位 C/C++ 优化编译器 16.00.30319.01 版

版权所有(C) Microsoft Corporation。保留所有权利。

simpcl.c

Microsoft (R) Incremental Linker Version 10.00.30319.01

Copyright (C) Microsoft Corporation. All rights reserved.

/out:simpcl.exe

-implib:BC-1b6c.lib

simpcl.obj

D:\bea11g\tuxedo11gR1\lib\libtux.lib

D:\bea11g\tuxedo11gR1\lib\libbuft.lib

D:\bea11g\tuxedo11gR1\lib\libfml.lib

D:\bea11g\tuxedo11gR1\lib\libfml32.lib

D:\bea11g\tuxedo11gR1\lib\libengine.lib

wsock32.lib

kernel32.lib

advapi32.lib

user32.lib

gdi32.lib

comdlg32.lib

winspool.lib

D:\src\simpapp>;tmloadcf -y ubbsimple //用ubbsimple 生成tuxconfig

D:\src\simpapp>;tmboot -y //启动tuxedo

Booting all admin and server processes in D:\src\simpapp\tuxconfig INFO: Oracle Tuxedo, Version 11.1.1.1.0, 32-bit, Patch Level (none) Booting admin processes ...

exec BBL -A :

process id=9912 ... Started.

Booting server processes ...

exec simpserv -A :

process id=4252 ... Started.

2 processes started.

D:\src\simpapp>;dir

驱动器 D 中的卷没有标签。

卷的序列号是 DE8E-46C4

D:\src\simpapp 的目录

2011/05/26 21:00 <;DIR>; .

2011/05/26 21:00 <;DIR>; ..

2011/05/25 14:21 <;DIR>; .adm

2011/05/25 14:27 362 access.052511

2011/05/26 21:00 181 access.052611

2011/05/25 14:10 2,943 README

2011/05/25 14:10 2,911 README.nt

2011/05/25 14:14 665 setenv.cmd

2011/05/25 14:10 1,953 simpapp.nt

2011/05/25 14:10 1,826 simpcl.c

2011/05/25 14:20 6,144 simpcl.exe

2011/05/25 14:20 2,141 simpcl.obj

2011/05/25 14:10 1,632 simpserv.c

2011/05/25 14:20 6,144 simpserv.exe

2011/05/25 14:20 876 simpserv.obj

2011/05/25 14:21 0 stderr

2011/05/25 14:21 0 stdout

2011/05/25 14:21 407,040 tuxconfig

2011/05/25 14:18 824 ubbsimple

2011/05/25 14:34 1,061 ULOG.052511

2011/05/26 21:00 520 ULOG.052611

2009/12/16 05:45 4,062 vcvars32.bat

19 个文件 441,285 字节

3 个目录 92,716,027,90

4 可用字节

D:\src\simpapp>;simpcl.exe weiming

Returned string is: WEIMING

三、loadrunner脚本编写:

1、第一种方案:选择协议为tuxedo,不需要任何设置;然后直接进入脚本编写;编写代码

如下:

#include "lrt.h"//这个是需要调用loadrunner自带的函数

Action()

{

char *data_0; //发送到服务的请求数据

char *data_1; //接收服务端处理完毕返回的结果

char sbuf_1[1024]="abcdefg";//发送到服务端的报文

lrt_tuxputenv("WSNADDR=//192.168.1.74:8888");//设置本机的环境变量,为服务端的IP 和服务端的监听端口

lr_think_time(3);

tpresult_int = lrt_tpinitialize(LRT_END_OF_PARMS);//初始化客户端,如果本地没有装tuxedo的客户端或者环境变量设置的不对,就会初始化失败

lrt_abort_on_error();

data_0 = lrt_tpalloc("STRING", "", 1024);

/* Request STRING buffer 1 */

lrt_strcpy(data_0, sbuf_1);

data_1 = lrt_tpalloc("STRING", "", 1024);

tpresult_int = lrt_tpcall("TOUPPER",data_0, 0,&data_1,&olen,0);//向服务端发送请求,第一个参数为服务名,这里的服务端是tuxedo的例子(simpsevr);第二个参数为请求数据;第三个参数为请求参数的长度;第四个参数为接收到的返回报文;第五个参数为返回报文的长度;第六个为模式;具体参考lr的Function Reference;

/* Reply STRING buffer 1 */

//strcpy(str, data_1);

lr_output_message(data_1);

lrt_abort_on_error();

lrt_tpfree(data_0);

lrt_tpfree(data_1);

lrt_tpterm();

return 0;

}

以上为action里面的内容,如有需要,部分内容可以放在vuser_init和vuser_end里面;

四、controller监控:

1、插入资源(见下图):只需要输入第三个server name就可以了:

loadrunner测试tuxedo服务

2、监控指标:

服务器Requests per second

计算机Workload complete per second

队列Active servers

Busy servers

Idel servers

Number queued

工作站处理程序(WSH)Messages received per second

Messages sent per second

Number of queue blocks per second

五、脚本参考(下面的案例非常好,故放在下面做参考):

loadrunner测试tuxedo服务

loadrunner测试tuxedo服务

loadrunner测试tuxedo服务

loadrunner测试tuxedo服务