[8654] | 1 | ===================== |
---|
| 2 | Stress Tests for Kofa |
---|
| 3 | ===================== |
---|
| 4 | |
---|
| 5 | Stress- and performance tests in here are based on the Python package |
---|
| 6 | `multi-mechanize`. See the homepage |
---|
| 7 | http://testutils.org/multi-mechanize/ for details. |
---|
| 8 | |
---|
| 9 | Installation |
---|
| 10 | ------------ |
---|
| 11 | |
---|
[8658] | 12 | The stuff in here is basically buildout-based. But as two of the |
---|
| 13 | required packages (namely `matplotlib`) seem not to cope very well |
---|
| 14 | with `setuptools`, we have to install them locally before running |
---|
| 15 | 'bootstrap.py'. |
---|
[8654] | 16 | |
---|
| 17 | To make it work, you need a Python with the packages |
---|
| 18 | `multi-mechanize`, `numpy`, and `matplotlib` installed. |
---|
| 19 | |
---|
| 20 | I'm used to install such packages in a virtual environment like this:: |
---|
| 21 | |
---|
| 22 | $ virtualenv --no-site-packages mysandbox |
---|
| 23 | $ source mysandbox/bin/activate |
---|
| 24 | |
---|
| 25 | Afterwards the required packages can be installed into this sandbox:: |
---|
| 26 | |
---|
| 27 | (mysandbox) $ pip install numpy |
---|
| 28 | (mysandbox) $ pip install matplotlib |
---|
| 29 | (mysandbox) $ pip install multi-mechanize |
---|
| 30 | |
---|
| 31 | Especially `matplotlib` is very demanding regarding already installed |
---|
| 32 | (C and C++) libraries. On my Ubuntu I had to install at least:: |
---|
| 33 | |
---|
| 34 | $ sudo apt-get install libfreetype6-dev |
---|
| 35 | $ sudo apt-get install libpng12-dev |
---|
| 36 | |
---|
| 37 | to make it compile and install. |
---|
| 38 | |
---|
[8658] | 39 | Afterwards we can run buildout:: |
---|
| 40 | |
---|
| 41 | (mysandbox) $ python bootstrap.py |
---|
| 42 | |
---|
| 43 | which will generate the local buildout script. We use it:: |
---|
| 44 | |
---|
| 45 | (mysandbox) $ ./bin/buildout |
---|
| 46 | |
---|
| 47 | will take a long time. It installs local Kofa instances in the |
---|
| 48 | 'instances/' dir and generates some scripts we will need. |
---|
| 49 | |
---|
| 50 | Before we can really do stress tests, we need the local instances to |
---|
| 51 | be bootstrapped/buildouted once:: |
---|
| 52 | |
---|
| 53 | (mysandbox) $ ./bin/bootstrap_instances |
---|
| 54 | |
---|
| 55 | takes care for that. It runs bootstrap.py and buildout for each |
---|
| 56 | instance in 'instances/'. |
---|
| 57 | |
---|
| 58 | Finally, the stress tests can be run. |
---|
| 59 | |
---|
[8654] | 60 | Running Stresstests |
---|
| 61 | ------------------- |
---|
| 62 | |
---|
| 63 | The different stress tests are put into different multi-mechanize |
---|
| 64 | 'projects'. Each project runs a certain stress test for which you have |
---|
| 65 | to setup certain things to make it work. |
---|
| 66 | |
---|
| 67 | Basically, you run a stresstest like this:: |
---|
| 68 | |
---|
[8672] | 69 | (mysandbox) $ ./bin/stress-run <PROJECT> |
---|
[8654] | 70 | |
---|
[8672] | 71 | where ``<PROJECT>`` is the name of one of the directories in here like |
---|
| 72 | 'kofa01'. |
---|
[8654] | 73 | |
---|
[8658] | 74 | So,:: |
---|
| 75 | |
---|
[8672] | 76 | (mysandbox) $ ./bin/stress-run kofa01 |
---|
[8658] | 77 | |
---|
| 78 | should give some results. |
---|
| 79 | |
---|
[8654] | 80 | The projects in here are the subdirectories, each one representing a |
---|
| 81 | different 'project' or kind of stresstest. Please see the respective |
---|
| 82 | README files in this folder to learn what conditions must be met to |
---|
| 83 | run each test. |
---|
| 84 | |
---|
[8672] | 85 | Generally, for each test project the configuration can be done in the |
---|
| 86 | test project root. Here you will find at least a `config.cfg` for |
---|
| 87 | ini-style configuration (required) and optionally a `pre_run.py` and |
---|
| 88 | `post_run.py` to care for things like setting up an instance and |
---|
| 89 | shutting it down afterwards. |
---|
| 90 | |
---|
[8654] | 91 | Please keep in mind, that these tests normally require some local or |
---|
| 92 | remote setup, for instance a running Kofa instance with certain |
---|
| 93 | reachable URLs. Again, you can lookup the specific READMEs in this |
---|
| 94 | directory to learn what setup is required to run a certain test. |
---|