benchmark_data/Joubu | ||
data/sql | ||
AUTHORS | ||
benchmark_them_all.pl | ||
collect_benchmark_data.pl | ||
cp_debian_files.pl | ||
cp_zebra_files.pl | ||
create_superlibrarian.pl | ||
custom-sample.sql | ||
do_all_you_can_do.pl | ||
insert_data.pl | ||
koha_schema_to_openapi.pl | ||
LICENSE | ||
populate_db.pl | ||
README.md | ||
reset_plack.pl | ||
run_tests.pl | ||
setup_sip.pl |
Koha misc4dev
Create a handy kit for Koha developpers (https://koha-community.org).
Why this is not in the Koha codebase?
The Koha community does not have enough people to test patches. Developpers need handy tools to make their everyday works and do not want to wait for people to be interested in what they need.
Who should not use these scripts?
If you do not know what they are, do not use them.
They are mostly used internally by koha-testing-docker and so our CI (jenkins), see http://wiki.koha-community.org/wiki/Developer_handbook first, then https://gitlab.com/koha-community/koha-testing-docker/
How to use it
You want to fill your existing database
As the root user
% perl do_all_you_can_do.pl
You want to reset your database
Note that this is very useful if you want to git bisect
As the root user
% alias reset_my_db='mysql -u koha_kohadev -ppassword -e"DROP DATABASE koha_kohadev";mysql -u koha_kohadev -ppassword -e"CREATE DATABASE koha_kohadev";perl /kohadevbox/misc4dev/do_all_you_can_do.pl'
% reset_my_db
If you are inside a koha-testing-docker container you should use the reset_all
alias instead.
You want to benchmark Koha
You can compare Koha versions 3.14, 3.16, 3.18, 3.20, 3.22, 16.05 and 16.11.
A new branch perf_${version}.x has been pushed to https://github.com/joubu/Koha.git my Koha github repository. On top of the stable versions, a new commit "wip perfs ${version}.x" adds and or adapts the selenium script for the branches it is missing, and a new "search" step has been added to the selenium script.
To benchmark Koha using the t/db_dependent/selenium/basic_workflow.pl
script, you need to do the following steps:
Add the Joubu's Koha git repository
As the root user
% cd kohaclone % git remote add Joubu https://github.com/joubu/Koha.git
Configure Selenium and install firefox
% sudo wget https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar -O /opt/selenium-server-standalone-2.53.0.jar
% SELENIUM_PATH=/opt/selenium-server-standalone-2.53.0.jar
% echo "deb http://packages.linuxmint.com debian import" | sudo tee /etc/apt/sources.list.d/firefox.list
% apt update && apt install firefox xvfb
Benchmark!
Start the selenium server
% Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
% DISPLAY=:1 java -jar $SELENIUM_PATH
Launch the benchmark script
% perl koha-misc4dev/benchmark_them_all.pl # That will take a while, almost 1h on my laptop
Note that you can set a verbose flag (edit the script and set $verbose = 1)
The performance data have been created into /tmp/${version}[_plack].txt
The _plack files are only generated if the debian/templates/koha.psgi
file exists (from 3.22)
Collect the data
% perl koha-misc4dev/collect_benchmark_data.pl /tmp/3.14.txt /tmp/3.16.txt /tmp/3.18.txt /tmp/3.20.txt /tmp/3.22.txt /tmp/3.22_plack.txt /tmp/16.05.txt /tmp/16.05_plack.txt /tmp/16.11.txt /tmp/16.11_plack.txt # Yes this could be improved
That will produce 2 sections, the "Raw data" (not really useful) and the "Average".
You can have a look at my own generated file in the benchmark_data
directory.
Generate a graph
To generate a graph, copy and paste the "Average" section into a spreadsheet program (Calc for instance).
You can take a look at my generated graph in benchmark_data/Joubu/results.ods