[ 本帖最后由 zhsh1203 于 2009-3-8 20:01 编辑 ]作者: 看雪时节 时间: 2009-3-12 13:40 作者: qiubingshun 时间: 2009-3-13 14:13
好帖子呀,谢谢!作者: jiangduxi 时间: 2009-3-26 21:46
好东西! 真希望拜你为师作者: aks5201314 时间: 2009-3-27 10:15
好帖子,学习了!作者: archonwang 时间: 2009-3-27 15:27
好贴,严重支持。作者: jacquiyan 时间: 2009-4-8 09:42
你的脚本有个缺陷,就是输出的数字和从tomcat页面读取的不一样。
vuser_init.c(43): Notify: Parameter Substitution: parameter "JVMFreeMemory" = "75.89"
vuser_init.c(43): Notify: Data Point "Tomcat JVM Free memory" value = 1309672.0000.
vuser_init.c(44): Notify: Parameter Substitution: parameter "JVMTotalMemory" = "87.12"
vuser_init.c(44): Notify: Data Point "Tomcat JVM Total memory" value = 1309672.0000.
vuser_init.c(45): Notify: Parameter Substitution: parameter "JVMMaxMemory" = "1888.00"
vuser_init.c(45): Notify: Data Point "Tomcat JVM Max memory" value = 1309672.0000.
那是因为atof函数转换成double时数值都变了样,需要显示定义下,在"vuser_init(){"这句话的
代码前面加上
double atof (const char *string);就ok了。
下面是正确的日志
vuser_init.c(43): Notify: Parameter Substitution: parameter "JVMFreeMemory" = "76.08"
vuser_init.c(43): Notify: Data Point "Tomcat JVM Free memory" value = 76.0800.
vuser_init.c(44): Notify: Parameter Substitution: parameter "JVMTotalMemory" = "87.31"
vuser_init.c(44): Notify: Data Point "Tomcat JVM Total memory" value = 87.3100.
vuser_init.c(45): Notify: Parameter Substitution: parameter "JVMMaxMemory" = "1888.00"
vuser_init.c(45): Notify: Data Point "Tomcat JVM Max memory" value = 1888.0000.作者: qinxiaocang1202 时间: 2009-4-8 15:11
正要实用,谢谢了!!学习学习作者: gup21cn 时间: 2009-4-9 18:08
ding 作者: jacquiyan 时间: 2009-4-11 22:49
我发现这个脚本不知道怎么搞的,长时间运行后,察看结果图,只有三个点,没有形成曲线.运行几分钟反而有曲线.
请问怎么解决阿?作者: 断寒 时间: 2009-4-14 14:48 标题: 回复 11# 的帖子 你把代码放到ACTION()里面去试下看看作者: aaa01 时间: 2009-4-21 15:30
我就是按楼主说的第二种方法做的, 但是在脚本回放的时候出错了:
vuser_init.c(31): Error -26630: HTTP Status-Code=401 (Unauthorized) for "http://192.168.(*).(*):8000/manager/status" [MsgId: MERR-26630]
vuser_init.c(31): Error -26377: No match found for the requested parameter "JVMFreeMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(31): Error -26377: No match found for the requested parameter "JVMTotalMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(31): Error -26377: No match found for the requested parameter "JVMMaxMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(31): web_url("status") highest severity level was "ERROR", 954 body bytes, 296 header bytes [MsgId: MMSG-26388]
vuser_init.c(31): Notify: Transaction "monitor tomcat" ended with "Fail" status (Duration: 4.9891 Wasted Time: 0.0000).
Virtual User Script started
Starting action vuser_init.
Web Turbo Replay of LoadRunner 9.10.0 for Windows Vista; WebReplay85 build 5896 [MsgId: MMSG-27143]
Run Mode: Click-and-Script [MsgId: MMSG-26000]
Run-Time Settings file: "C:\Users\ibm\workspace\lr\login\\default.cfg" [MsgId: MMSG-27141]
Current locale is "Chinese Simplified (GB2312)", code page 936, preferred charset name "gb2312", Unicode converter name="gb2312", CRT locale string="Chinese (Simplified)_People's Republic of China.936" [MsgId: MMSG-27045]
vuser_init.c(5): Notify: Transaction "monitor tomcat" started.
vuser_init.c(8): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
vuser_init.c(13): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
vuser_init.c(19): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
vuser_init.c(25): web_set_user was successful [MsgId: MMSG-26392]
vuser_init.c(26): Warning -26630: HTTP Status-Code=401 (Unauthorized) for "http://122.122.1.15:888/manager/status" [MsgId: MWAR-26630]
vuser_init.c(26): Error -26377: No match found for the requested parameter "JVMFreeMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(26): Error -26377: No match found for the requested parameter "JVMTotalMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(26): Error -26377: No match found for the requested parameter "JVMMaxMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(26): web_url("status") highest severity level was "ERROR", 3666 body bytes, 466 header bytes [MsgId: MMSG-26388]
vuser_init.c(26): Notify: Transaction "monitor tomcat" ended with "Fail" status (Duration: 0.2528 Wasted Time: 0.0001).
Abort was called from an action.
除了IP和端口不一样外,脚本都是一样滴!为什么回放脚本时,报下面这些错?
vuser_init.c(26): Error -27796: Failed to connect to server "192.168.1.192:8005": [10061] Connection refused [MsgId: MERR-27796]
vuser_init.c(26): Warning -26000: Empty or no response for URL="http://192.168.1.192:8005/manager/status" [MsgId: MWAR-26000]
vuser_init.c(26): Error -26377: No match found for the requested parameter "JVMFreeMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(26): Error -26377: No match found for the requested parameter "JVMFreeMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(26): Error -26377: No match found for the requested parameter "JVMFreeMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
vuser_init.c(26): Error -26374: The above "not found" error(s) may be explained by header and body byte counts being 0 and 0, respectively. [MsgId: MERR-26374]
vuser_init.c(26): web_url("status") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
vuser_init.c(26): Notify: Transaction "monitor tomcat" ended with "Fail" status (Duration: 1.9176 Wasted Time: 0.5290).