Skip to content

andresriancho/w3af-performance-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Performance analysis

Analysis tool for performance output generated by w3af. The input for this tool is generated using the AWS Collector.

Installation

Rather complex since we need a patched Python for pytracemalloc:

cd ~/tools/
git clone https://github.com/andresriancho/w3af-performance-analysis.git

cd /tmp/
wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
wget https://pypi.python.org/packages/source/p/pytracemalloc/pytracemalloc-1.2.tar.gz
tar -xf Python-2.7.8.tgz
tar -xf pytracemalloc-1.2.tar.gz
cd Python-2.7.8
patch -p1 < ../pytracemalloc-1.2/patches/2.7/pep445.patch
./configure --enable-unicode=ucs4 --prefix=/opt/tracemalloc/py27
sudo make install
cd ../pytracemalloc-1.2
sudo /opt/tracemalloc/py27/bin/python2.7 setup.py install

cd ~/tools/virtualenvs/
virtualenv --python=/opt/tracemalloc/py27/bin/python2.7 w3af-performance-analysis
. w3af-performance-analysis/bin/activate

cd ~/tools/w3af-performance-analysis/
pip install cython==0.21.2
pip install -r requirements.txt  --allow-external meliae --allow-unverified meliae

# Verify install
python -c 'import tracemalloc'

Usage

$ ./wpa ~/performance_info/master/i-e45d5fb5/

Total memory size:
	0:    64.2 MiB
	1:    68.2 MiB
	2:    123.1 MiB
	3:    665.8 MiB

Memory usage summary:
	Total 8364538 objects, 286 types, Total size = 440.4MiB (461765737 bytes)
	Index   Count    %      Size       %   Cum     Max      Kind
	0       2193778  26     181553569  39  39      4194281  str
	1       12519    0      97231956   21  60      12583052 dict
	2       1599439  19     68293428   14  75      304      tuple
	3       3459765  41     62169616   13  88      20       bzrlib.StaticTuple
	4       82       0      29372712   6   94      8388724  set
	5       1052573  12     12630876   2   97      12       int
	6       1644     0      4693700    1   98      2351848  list
	7       4038     0      2245128    0   99      556      _LazyGroupCompressFactory

CPU Usage:
	System load average: 1.59, 0.81, 0.75
	Top10 most time consuming functions:
		0:    parse_foo()
		1:    parse_bar()
		...
		9:    do_spam()

HTTP requests:
	Total:         5030
	Average RPM:   61
	Top RPM:	   890
	Lowest RPM:	   49

$

The most common usage of this tool looks like this:

# Use the collector to gather some information
$ ./collect config.yml master
$ ./collect config.yml feature/performance-speedup
# In console #1
$ ./wpa ~/performance_info/master/i-e45d5fb5/
# In console #2
$ ./wpa ~/performance_info/feature-performance-speedup/i-f32dafb9/
# User compares performance results for each by putting the two consoles side by side

Processing the performance information can take considerable time, be patient when running wpa!

Internals

This software is tightly coupled with the output of the collector tool, if the collector changes its output format, removes one or more of its files, etc. the wpa tool will most likely crash or return unusable information.

The information is analyzed by various (independent) plugins which are stored in the plugins directory. If at any point you want to add a new analysis plugin, you'll have to create it inside the plugins module, import it from main.py and finally add it to the list of plugins to run.

The logging module can be used by plugins to write any debugging information to the output.

About

Analysis tool for performance output generated by w3af

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published