Windows Resources Monitoring
Setting up the Monitoring Environment
1. Ensure that the TCP/IP protocol is installed on the Controller machine. The Windows Resource Monitor (and other parts of LoadRunner) require the TCP/IP protocol to work.
2. Make sure that you are authorized to monitor the remote machine.
To monitor Windows Resources, it is necessary to establish authentication to the Server machine from the Controller machine in order to access the statistics that Perfmon makes available over the network. Since there is no UI for entering in the authentication information in LoadRunner there are two solutions available.
a. Create a user account on the Server machine that matches the username/password that is used to log into the Controller machine. This will allow authentication to occur automatically behind the scenes during the monitoring connection.
b. Map to a shared resource on the Server (i.e., Map a Drive) with a valid account, which will manually force authentication. After this is completed the monitoring can continue as well.
Note: The user account that is used to access the Controller must have rights to view NT Perfmon statistics over the network. Try to connect to the remote machine with NT Perfmon from the Controller to verify that the connection will be successful.
Go to Start -> Settings -> Control Panel -> Administrative Tool's -> Performance Monitor (PerfMon)and try to add the machine to be monitored. Contact your System Administrator if any help is needed with this process.
3. By default, Windows machines enable monitoring only for users with administrator privileges. In order to allow monitoring for non-administrator users, you must grant read permission to certain files and registry entries. The following information was published under Microsoft knowledge base article Q158438 ; If you still not able to remotely monitor disk counters, refer to Microsoft Knowledge Base Article 812714 - Users cannot remotely monitor disk counters if they are not logged on as administrators
4. The measurement reported for system resources monitors:
4.1 Windows’s Performance Monitor (PerfMon) ----In Windows Performance Monitor(Run perfmon)
The default sampling rate of Windows’s Performance Monitor (PerfMon) is 1 second. To change this,
a. Right mouse click on the graph, and select Properties -> General
b. Modify the value for ‘Update Automatically every x seconds’
4.2 Windows Resource Monitor -------In LR Controler
The default sampling rate of Windows Resource Monitor is 3 seconds. To change this,
a. From Controller, go to Tools -> Options -> Monitors
b. Modify the value for ‘Data Sampling Rate’
4.3 SNMP Monitor -------In LR Controler
The default sampling rate of SNMP Monitor is 3 seconds. To change this,
a. From Controller, go to Tools -> Options -> Monitors
b. Modify the value for ‘Data Sampling Rate’
4.4 SiteScope monitor -------in SiteScope
The default sampling rate of SiteScope monitor is 10 Minutes. To change this,
a. Go to the monitor group in SiteScope
b. Click on the ‘Edit’ link next to the monitor
c. Modify the value for ‘Update Every’ entries.
Note: If you install the SiteScope for LR7.8 FP1 (from LoadRunner 7.8, go to update service and download the ‘SiteScope’ install), you will be able to set the sampling rate to as low as 15 seconds for certain measurements.
Adding a Monitored Machine to the Controller( In LR Controller, Run tab)
1. Click the Windows Resources graph in the graph tree, and drag it into the right pane of the Run view.
2. Right-click the graph and select Add Measurements , or choose Monitors > Add Measurements . The Windows Resources dialog box opens.
3. In the Monitored Server Machines section, click Add . The Add Machines dialog opens.
4. In the Monitored Machine Information section, enter the server name or IP address of the machine you want to monitor. Select the platform on which the machine runs. Click OK to close the Add Machine dialog box.
5. Click Add in the Resource Measurements on: section of the Windows Resources dialog box.
UNIX Resources Monitoring
Setting up the Monitoring Environment
首先 , 监视 Linux 一定要有 rstatd daemon 这个进程 , 有的 Linux 版本里也有可能是 rpc.rstatd 这里只是名字不同而已 , 功能是一样的。一般来说 LINUX 需要下载一个包才有这个服务 , 包名字是 rpc.rstatd-4.0.1.tar.gz. 这是一个源码 , 需要编译 . 下载并安装 rstatd
tar -ivh rpc.rstatd-4.0.1.tar.gz
./configure --- 配置
make --- 编译
make install --- 安装
rpc.rstatd --- 启动 rstatd 进程
To verify whether the rstatd daemon is already configured:
The rup command reports various machine statistics, including rstatd configuration. Run the following command to view the machine statistics:
>rup host
You can also use lr_host_monitor and see if it returns any relevant statistics.
If the command returns meaningful statistics, the rstatd daemon is already configured and activated. If not, or if you receive an error message, the rstatd daemon is not configured.
To configure the rstatd daemon:
1 . Run the command: su root
2 . Go to /etc/inetd.conf and look for the rstatd row (it begins with the word rstatd). If it is commented out (with a #), remove the comment directive,and save the file.
3 . From the command line, run:
kill -1 inet_pid
where inet_pid is the pid of the inetd process. This instructs the inetd to rescan the /etc/inetd.conf file and register all daemons which are uncommented, including the rstatd daemon.
4 . Run rup again.
If the command still does not indicate that the rstatd daemon is configured,contact your system administrator.
Note: To monitor a UNIX machine through a firewall, you must run a UNIX utility called rpcinfo and identify the rstatd ’ s port number. By running rpcinfo -p , you will receive a list of all RPC servers registered in the host ’ s portmapper, along with the port number. This list will not change until rstatd is stopped and rerun.
Some firewalls allow you to open an RPC program number instead of a port.In such cases, open program 100001.
Adding a Machine to Monitor
1 .Click the UNIX Resources graph in the graph tree, and drag it into the right pane of the Run view.
2 .Right-click the graph and select Add Measurements , or click anywhere on the graph and choose Monitors > Add Measurements . The UNIX Resources dialog box opens.
In the Monitored Server Machines section, click Add. The Add Machine dialog box opens.
3 .Enter the server name or IP address of the machine you want to monitor,and click OK .
4 .In the Resource Measurements section of the UNIX Resources dialog box,select the measurements you want to monitor.
5 .To select additional measurements, click Add .
6 .Continue with Configuring the UNIX Resources Monitor.
附录 A: Windows Resource Performance Counters
Object | Measurement | Description |
System | % Total Processor Time | The average percentage of time that all the processors on the system are busy executing non-idle threads. On a multiprocessor system, if all processors are always busy, this is 100%, if all processors are 50% busy this is 50% and if 1/4 of the processors are 100% busy this is 25%. It can be viewed as the fraction of the time spent doing useful work. Each processor is assigned an Idle thread in the Idle process which consumes those unproductive processor cycles not used by any other threads. |
System | File Data Operations/sec | The rate at which the computer issues read and write operations to file system devices.This does not include File Control Operations. |
Processor | % Processor Time (Windows 2000) | The percentage of time that the processor is executing a non-idle thread. This counter was designed as a primary indicator of processor activity. It is calculated by measuring the time that the processor spends executing the thread of the idle process in each sample interval, and subtracting that value from 100%. (Each processor has an idle thread which consumes cycles when no other threads are ready to run). It can be viewed as the percentage of the sample interval spent doing useful work. This counter displays the average percentage of busy time observed during the sample interval. It is calculated by monitoring the time the service was inactive, and then subtracting that value from 100%. |
System | Processor Queue Length | The instantaneous length of the processor queue in units of threads. This counter is always 0 unless you are also monitoring a thread counter. All processors use a single queue in which threads wait for processor cycles. This length does not include the threads that are currently executing. A sustained processor queue length greater than two generally indicates processor congestion. This is an instantaneous count, not an average over the time interval. |
Memory | Page Faults/sec | This is a count of the page faults in the processor. A page fault occurs when a process refers to a virtual memory page that is not in its Working Set in the main memory. A page fault will not cause the page to be fetched from disk if that page is on the standby list (and hence already in main memory), or if it is in use by another process with which the page is shared. |
PhysicalDisk | % Disk Time | The percentage of elapsed time that the selected disk drive is busy servicing read or write requests. |
Memory | Pool Nonpaged Bytes | The number of bytes in the nonpaged pool, a system memory area where space is acquired by operating system components as they accomplish their appointed tasks.Nonpaged pool pages cannot be paged outto the paging file. They remain in main memory as long as they are allocated. |
Memory | Pages/sec | The number of pages read from the disk or written to the disk to resolve memory references to pages that were not in memory at the time of the reference. This is the sum of Pages Input/sec and Pages Output/sec. This counter includes paging traffic on behalf of the system cache to access file data for applications. This value also includes the pages to/from non-cached mapped memory files. This is the primary counter to observe if you are concerned about excessive memory pressure (that is,thrashing), and the excessive paging that may result. |
System | Total Interrupts/sec | The rate at which the computer is receiving and servicing hardware interrupts. The devices that can generate interrupts are the system timer, the mouse, data communication lines, network interface cards, and other peripheral devices. This counter provides an indication of how busy these devices are on a computer-wide basis. See also Processor:Interrupts/sec. |
Objects | Threads | The number of threads in the computer at the time of data collection. Notice that this is an instantaneous count, not an average over the time interval. A thread is the basic executable entity that can execute instructions in a processor. |
Process | Private Bytes | The current number of bytes that the process has allocated that cannot be shared with other processes. |
附录 B: UNIX Resources Performance Counters
Measurement | Description |
Average load | Average number of processes simultaneously in Ready state during the last minute |
Collision rate | Collisions per second detected on the Ethernet |
Context switches rate | Number of switches between processes or threads,per second |
CPU utilization | Percent of time that the CPU is utilized |
Disk rate | Rate of disk transfers |
Incoming packets error rate | Errors per second while receiving Ethernet packets |
Incoming packets rate | Incoming Ethernet packets per second |
Interrupt rate | Number of device interrupts per second |
Outgoing packets errors rate | Errors per second while sending Ethernet packets |
Outgoing packets rate | Outgoing Ethernet packets per second |
Page-in rate | Number of pages read to physical memory, per second |
Page-out rate | Number of pages written to pagefile(s) and removed from physical memory, per second |
Paging rate | Number of pages read to physical memory or written to pagefile(s), per second |
Swap-in rate | Number of processes being swapped |
Swap-out rate | Number of processes being swapped |
System mode CPU utilization | Percent of time that the CPU is utilized in system mode |
User mode CPU utilization | Percent of time that the CPU is utilized in user mode |