Skip to main content

Posts

Showing posts from July, 2015

Performance Measurement commands for Unix

If you have been following my ongoing video tutorials on  jmeter performance testing  then you may have wondered what server side statistics should be gathered during performance testing. We have not yet looked in to specific statistics which we should gather for server side monitoring. In this post we would have a look at useful linux commands which can be used to gather several important performance statistics. We would use these commands in future performance testing tutorials to gather server side performance statistics. Most of the description of these commands is from command "man"ual. So lets begin -   top command and options vmstat command and options iostat command and options lsof command and options tcpdump command and options netstat command and options

netstat command and options

Back to performance measurement commands netstat (network statistics) - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships Type the following command: $netstat Listening on all ports     $netstat -a OPTIONS -l, --listening        Show only listening sockets.  (These are omitted by default.)     $netstat -i

tcpdump command and options

Back to performance measurement commands tcpdump - dump traffic on a network. Tcpdump  prints  out a description of the contents of packets on a network interface that match the boolean expression. Type the following command: $tcpdump You need to interrupt the command else it would keep scrolling http://unix.stackexchange.com/questions/82919/what-does-the-eth0-interface-name-mean-in-linux OPTIONS -i interface --interface=interface Listen on interface.  If unspecified, tcpdump searches the system interface list for the lowest numbered,  configured  up  interface (excluding loopback), which may turn out to be, for example, ``eth0''.     $tcpdump -i eth0 -c count               Exit after receiving count packets. $tcpdump -c 30 -i eth0         -D --list-interfaces, prints  the list of the network interfaces available on the system and on which tcpdump can capture packets.  For each network interface, a number and an interface name, possibly

lsof command and options

Back to performance measurement commands lsof - list open files. An  open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream or a network file (Internet socket, NFS file or UNIX domain socket.)  A specific file or all the files in a file system may be selected by path. Given that this command identifies which files are being used, this information can be used when disk can not be unmounted due to files being used or opened. Type the following command: $lsof     Herein - FD – stands for File descriptor and may have some of the values as: cwd current working directory rtd root directory txt program text (code and data) mem memory-mapped file Also in FD column numbers like 41u is actual file descriptor and followed by u,r,w of it’s mode as: r for read access. w for write access. u for read and write access. TYPE – of files and it’s identification. DIR – Dire

iostat command and options

Back to performance measurement commands iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. It is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates.The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. The first report generated by the iostat command provides statistics concerning the time since the system was booted, unless the -y  option is used (in this case, this first report is omitted).  Each subsequent report covers the time since the previous report. Type the following command: $iostat REPORTS The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. CPU Utilization Report - The first report generated by the iostat command is the CPU Utilization Report. For mu

free command and options

Back to performance measurement commands Free command is frontend to /proc/meminfo file. It provide more human readable output to show you the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel: $ free -m vmstat command =========================================== The vmstat, sar and iostat commands are the collection of package included in sysstat – the system monitoring tools. vmstat - Report virtual memory statistics. It reports information about processes, memory, paging, block IO, traps, disks and cpu activity. The  first report produced gives averages since the last reboot.  Additional reports give information on a sampling period of length delay. Type the following command: $vmstat FIELD DESCRIPTION FOR VM MODE   Procs        r: The number of runnable processes (running or waiting for run time).        b: The number of processes in uninterruptible sleep.   Memory        swpd: the amo

top command and options

Back to performance measurement commands The top program provides a dynamic real-time view of a running system.  It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. Type the following command: $ top The top command used to display all the running and active real-time processes in ordered list and updates it regularly. Press ‘c‘ option in running top command, it will display absolute path of running process. If you want to kill a running process then use kill command as - {kill -9 <process-id>} Press (Shift+W) to save the running top command results under /root/.toprc. OPTIONS -u | -U  :User-filter-mode as:  -u | -U number or name Display only processes with a user id or user name matching that given.  The '-u' option matches on  effective user whereas  the  '-U' option matches on any user (real, effective, saved, or filesystem). Prepending  an  exclamation point

STF and Android Test Automation

SeleniumTestsFramework (aka  STF ) has been available publicly for quite some time now. Given the importance of mobile market, test automation for mobile sites and apps can not be ignored any more. So here is the version 2.0 of STF which supports android testing, both m-site as well as app. STF internally uses appium APIs to control android automation hence you don't need to switch to a new framework if you have already been using appium. Use the following configuration in your testng.xml file to run test on android browser -  Make sure you set android emulator or real device first as described in  appium tutorial You can use  sample test project  which uses latest version of STF and is configured to run test on android browser. Let us know your feedback :-)