标签:des style blog http io ar color os 使用
1 Action() 2 { 3 4 int status; 5 int HttpRetCode; 6 char *ip; 7 ip = lr_get_vuser_ip(); 8 //检查Loadrunner Controller有没有Enable IP Spoofing 9 if(ip) 10 lr_output_message("The IP address is %s", ip); 11 else 12 lr_output_message("IP spoofing disabled"); 13 //设置集合点,让50个vuser一起发起第一个请求 14 lr_rendezvous("letusgo"); 15 //开始第一个事务(请求) 16 lr_start_transaction("1stReq"); 17 18 web_url("RCS_Initial_HTTP_Req", 19 //这里有一个参数化,我要每一次传递给该参数一个唯一的msisdn号码,并且只执行一次。 20 //我在参数属性对话框里设置:Select next row -> Unique 21 // Update value on -> Once
22 "URL= http://xxx.yyy.com/self?x-forwarding-msisdn={NewParam}", 23 "TargetFrame=Main", 24 "Resource=0", 25 "RecContentType=text/html", 26 "Mode=http", 27 LAST ); 28 //打印第一个请求的返回码 29 HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE); 30 lr_output_message("Response code:%d",HttpRetCode); 31 //检查返回码是否是200 32 if(HttpRetCode == 200){ 33 lr_end_transaction("1stReq", LR_PASS); 34 sleep(2000); 35 //开始第二个事务(请求) 36 lr_start_transaction("2ndReq"); 37 web_url("RCS_Initial_HTTP_Req", 38 "URL= https://xxx.yyy.com/self?vers=1&IMSI=1&rcs_version=1&rcs_profile=1&client_vendor=1&client_version=1&terminal_vendor=1&terminal_model=1&terminal_sw_version=1&IMEI=1&mock_scheme=HTTPS", 39 "TargetFrame=Main", 40 "Resource=0", 41 "RecContentType=text/html", 42 "Mode=http", 43 LAST ); 44 //打印第二个请求的返回码 45 HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE); 46 lr_output_message("Response code:%d",HttpRetCode); 47 //检查返回码是否是200 48 //结束第二个事务(请求) 49 if(HttpRetCode == 200){ 50 lr_end_transaction("2ndReq", LR_PASS); 51 }else{ 52 lr_end_transaction("2ndReq", LR_FAIL); 53 } 54 55 return 0; }else{ 56 //结束第一个事务(请求) 57 lr_end_transaction("1stReq", LR_FAIL); 58 return 0; 59 } 60 } 61
场景设置:
一定要注意每一个Vuser的IP是否是唯一的。双击下图Scenario Groups里面的Group Name行可以打开每一个Vuser对应的Generator,查看其IP。
UNIX counter | Windows Counter | Description |
Average Load* | N/A | The sum of the number of processes waiting in the run queue plus the number currently executing. |
Collision rate | N/A | The total number of network collisions/sec |
Context switch rate | System – Context Switches/sec | The rate at which processors switch from executing one thread to another. High switch rates can indicate performance problems as servers juggle multiple running applications. |
CPU utilisation | %Processor Time | The percentage of elapsed time that the process spends executing non-idle threads. |
Disk traffic | %Disk time | The percentage of elapsed time that the disk(s) are busy servicing read or write requests. |
Incoming packets error rate | Packets received errors | The number of packets received containing errors that precvent them from being delivered to a higher OSI layer protocol. |
Incoming packets rate | Packets received/sec | The number of packets received on the network interface |
Interrupt rate | Interrupts/sec | Average rate at which the processor receives and services hardware interrupts. Processes generate an interrupt when they finish a task and need to report that fact to the CPU. |
Outgoing packets error rate | Packets outbound errors | The number of packets that can’t be transmitted due to errors |
Outgoing packets rate | Packets sent / sec | The rate at which packets are sent on the network interface |
Page-in rate | Pages Input/sec | The rate at which pages are read from disk to resolve hard page faults. Hard page faults occur when a process refers to a page in virtual memory which is not in it’s working set or available elsewhere in physical memory and has to be read from disk. |
Page-out rate | Pages Output/sec | The rate at which memory pages are written to disk to free up space in physical memory. |
Paging rate | Paging rate | The rate at which pages are read from disk or written to disk. This is the sum of Pages Input/sec and Pages Output/sec. |
Swap-in rate | N/A | The number of pages read into memory per second |
Swap-out rate | N/A | The number of pages written out of memory per second |
System mode CPU utilization | Processor – %Priviledged time | The percentage of elapsed time that the processor spends executing user threads (i.e. running applications) |
User mode CPU utilization | Processor – %User time | The percentage or elapsed time that the processor spends executing priviledged or system mode threads. |
标签:des style blog http io ar color os 使用
原文地址:http://www.cnblogs.com/juan-wang/p/4123037.html