annotate PerfsDb/README.md @ 156:f1a75985caa8

first Db test framework - work in progress
author am@osimis.io
date Thu, 16 Aug 2018 17:13:32 +0200
parents
children df1f9946571c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
156
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
1 Performance Db tests
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
2 ====================
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
3
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
4 Introduction
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
5 ------------
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
6
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
7 This project performs benchmark tests of Orthanc with its various DB servers.
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
8
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
9 It can be used to:
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
10
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
11 - compare DB servers performance
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
12 - compare performance between small and big DB
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
13 - test the effectiveness of some code refactoring
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
14
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
15 In a first step, the project creates a set of DB servers and populates them.
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
16 Then, it will perform a set of basic operations on Orthanc with each of these servers
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
17 and measure the time required for each operation.
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
18
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
19 Timings are measured at the API level. Since we want to measure mainly the DB performance,
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
20 we'll mainly use very small DICOM files (without pixels data).
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
21
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
22 Prerequisites
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
23 -------------
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
24
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
25 - install python3, pip3 and pipenv
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
26
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
27 ```bash
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
28 sudo apt-get install -y python3 python3-pip python3-venv
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
29 ```
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
30
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
31 - [install Docker-CE](https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository)
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
32 - [install docker-compose](https://docs.docker.com/compose/install/)
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
33 - have access to docker without typing `sudo`. This is done by typing: `sudo groupadd docker` and `sudo usermod -aG docker $USER`
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
34 - have Orthanc and its DB plugins natively installed or compiled on your host system
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
35
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
36 Once all prerequisites are installed, you should always execute all commands from a python virtual-env. To initialize the virtual env the first time:
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
37
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
38 ```bash
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
39 python3 -m venv .env
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
40 source .env/bin/activate
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
41 pip install -r requirements.txt
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
42 ```
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
43
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
44 To enter the virtual-env the next times:
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
45
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
46 ```bash
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
47 source .env/bin/activate
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
48 ```
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
49
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
50 Initializing a DB before tests
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
51 -----------------
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
52
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
53 ```bash
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
54 python run.py --orthanc-path=/home/amazy/builds/orthanc-build-release/ --plugins-path=/home/amazy/builds/mysql-release/ --init --mysql-small
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
55 ```
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
56
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
57 Clearing a DB
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
58 -----------------
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
59
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
60 ```bash
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
61 python run.py --orthanc-path=/home/amazy/builds/orthanc-build-release/ --plugins-path=/home/amazy/builds/mysql-release/ --clear --mysql-small
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
62 ```
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
63
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
64 Runing tests on two DBs
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
65 -----------------
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
66
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
67 ```bash
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
68 python run.py --orthanc-path=/home/amazy/builds/orthanc-build-release/ --plugins-path=/home/amazy/builds/mysql-release/ --run --mysql-large --mysql-small
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
69 ```