From 5166a6b94c0814054e3536b13c83950aed2a0c95 Mon Sep 17 00:00:00 2001
From: Mussab Abdalla <mussab.abdalla@eox.at>
Date: Tue, 9 Jun 2020 12:33:41 +0200
Subject: [PATCH] updateperformance test(wms+wcs)

---
 performance_test/README.md    | 16 +++++++++----
 performance_test/emg.py       | 36 -----------------------------
 performance_test/emg_wcs.py   | 43 +++++++++++++++++++++++++++++++++++
 performance_test/emg_wms.py   | 42 ++++++++++++++++++++++++++++++++++
 performance_test/vhr18.py     | 35 ----------------------------
 performance_test/vhr18_wcs.py | 43 +++++++++++++++++++++++++++++++++++
 performance_test/vhr18_wms.py | 42 ++++++++++++++++++++++++++++++++++
 7 files changed, 181 insertions(+), 76 deletions(-)
 delete mode 100644 performance_test/emg.py
 create mode 100644 performance_test/emg_wcs.py
 create mode 100644 performance_test/emg_wms.py
 delete mode 100644 performance_test/vhr18.py
 create mode 100644 performance_test/vhr18_wcs.py
 create mode 100644 performance_test/vhr18_wms.py

diff --git a/performance_test/README.md b/performance_test/README.md
index 606c139f..1c666e31 100644
--- a/performance_test/README.md
+++ b/performance_test/README.md
@@ -1,14 +1,20 @@
 # PERFORMANCE TEST
-separate test.py files for both *PRISM* sites `vhr18` and `emg`, using `*locust*` testing tool.
+separate test.py files for both *PRISM* sites `vhr18` and `emg`, using *`locust`* testing tool. Using auto-generated samples
+from `opensearch` result of **`Emergency`** collection and `level3` of **`vhr_18`** Collection.
+
+- `Http`tested requests :
+- **`WMS`**
+- **`WCS`**
 
 # USAGE
+example of usage below
 
 ```bash
-# to test vhr18
-locust -f <path_to_file>/vhr18.py 
+# to test vhr18 wms requests
+locust -f <path_to_file>/vhr18_wms.py 
 
-# to test emg
-locust -f <path_to_file>/emg.py
+# to test emg wcs requests
+locust -f <path_to_file>/emg_wcs.py
 
 ```
 
diff --git a/performance_test/emg.py b/performance_test/emg.py
deleted file mode 100644
index 311431a5..00000000
--- a/performance_test/emg.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import random
-from locust import HttpUser, task, between
-
-REQUESTS = [
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=16.083984375%2C44.560546875%2C16.171875%2C44.6484375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=15.99609375%2C44.736328125%2C16.083984375%2C44.82421875',
-    'ows?STYLES=&CRS=EPSG%3A4326&service=WMS&format=image%2Fpng&request=GetMap&layers=urn%3Aeop%3AEUSI%3AGY01%3A1050050042DD6600%3A058963051010&height=63&width=100&version=1.3.0&BBOX=45.122960%2C15.757141%2C45.232591%2C15.930519&TRANSPARENT=true',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=12.4420166015625%2C43.9178466796875%2C12.447509765625%2C43.92333984375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-0.977783203125%2C39.495849609375%2C-0.966796875%2C39.5068359375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-0.933837890625%2C39.48486328125%2C-0.9228515625%2C39.495849609375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-0.19775390625%2C53.1298828125%2C-0.17578125%2C53.15185546875',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-0.3076171875%2C53.10791015625%2C-0.28564453125%2C53.1298828125',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-0.28564453125%2C53.06396484375%2C-0.263671875%2C53.0859375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=8.338623046875%2C52.6904296875%2C8.349609375%2C52.701416015625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=8.3935546875%2C52.679443359375%2C8.404541015625%2C52.6904296875',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=8.338623046875%2C52.66845703125%2C8.349609375%2C52.679443359375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=13.157501220703125%2C52.101287841796875%2C13.15887451171875%2C52.1026611328125',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=13.160247802734375%2C52.09991455078125%2C13.16162109375%2C52.101287841796875',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=32.607421875%2C15.556640625%2C32.6513671875%2C15.6005859375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=32.607421875%2C15.556640625%2C32.6513671875%2C15.6005859375',
-    'ows?STYLES=&CRS=EPSG%3A4326&service=WMS&format=image%2Fpng&request=GetMap&layers=urn%3Aeop%3APHR%3AMULTISPECTRAL_0.5m%3ADS_PHR1A_201908220836513_FR1_PX_E032N15_0614_01938_c8ae&height=100&width=72&version=1.3.0&BBOX=15.481628%2C32.441728%2C15.675272%2C32.581165&TRANSPARENT=true',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=32.607421875%2C15.5126953125%2C32.6513671875%2C15.556640625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Emergency__TRUE_COLOR&STYLES=&time=2019-01-01T00%3A00%3A00Z%2F2019-12-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=32.431640625%2C15.46875%2C32.4755859375%2C15.5126953125'
-]  
-
-
-class QuickstartUser(HttpUser):
-    wait_time = between(5, 9)
-
-    @task(3)
-    def view_item(self):
-       item_id = random.randint(0, 18)
-       item = REQUESTS[item_id]
-
-       # replace the strings 'username' and 'Password' with the pdas/vs credintials 
-       self.client.get(f"{item}", auth=('username', 'Password'))
diff --git a/performance_test/emg_wcs.py b/performance_test/emg_wcs.py
new file mode 100644
index 00000000..0145c6d7
--- /dev/null
+++ b/performance_test/emg_wcs.py
@@ -0,0 +1,43 @@
+import gevent.monkey
+gevent.monkey.patch_all()
+import random
+import requests
+import time
+from xml.etree import ElementTree
+
+from locust import HttpUser, task, between
+
+
+wcs_list = []
+
+
+def get_requests (url, user, password):
+        response = requests.get(url = url, auth = (user, password))
+
+        catalog = ElementTree.fromstring(response.content)
+        entries = catalog.findall('{http://www.w3.org/2005/Atom}entry')
+
+        for entry in entries :
+            wcs_offers = entry.findall('{http://www.opengis.net/owc/1.0}offering[@code="http://www.opengis.net/spec/owc-atom/1.0/req/wcs"]')
+            for offer in wcs_offers :
+                services = offer.findall('{http://www.opengis.net/owc/1.0}operation[@code="GetCoverage"]')
+                if len(services) > 0 :
+                    modified_request = '%s&scalesize=x(50),y(50)' % (services[0].get('href').replace('https://emg.pdas.prism.eox.at/',''))
+                    wcs_list.append(modified_request)
+    
+# replace the strings 'username' and 'Password' with the pdas/vs credintials 
+get_requests('https://emg.pdas.prism.eox.at/opensearch/collections/Emergency/atom/', 'username', 'password' )
+
+class QuickstartUser(HttpUser):
+
+
+    wait_time = between(0, 0)
+
+    @task(3)
+    def view_item(self):
+       item_id = random.randint(0, len(wcs_list)-1)
+       item = wcs_list[item_id]
+       # replace the strings 'username' and 'Password' with the pdas/vs credintials 
+
+       self.client.get(f"{item}", auth=('username', 'password'))
+    
diff --git a/performance_test/emg_wms.py b/performance_test/emg_wms.py
new file mode 100644
index 00000000..475a4d28
--- /dev/null
+++ b/performance_test/emg_wms.py
@@ -0,0 +1,42 @@
+import gevent.monkey
+gevent.monkey.patch_all()
+import random
+import requests
+import time
+from xml.etree import ElementTree
+
+from locust import HttpUser, task, between
+
+wms_list = []
+
+def get_requests (url, user, password):
+        response = requests.get(url = url, auth = (user, password))
+
+        catalog = ElementTree.fromstring(response.content)
+        entries = catalog.findall('{http://www.w3.org/2005/Atom}entry')
+
+        for entry in entries :
+
+            wms_offers = entry.findall('{http://www.opengis.net/owc/1.0}offering[@code="http://www.opengis.net/spec/owc-atom/1.0/req/wms"]')
+            for offer in wms_offers :
+                services = offer.findall('{http://www.opengis.net/owc/1.0}operation[@code="GetMap"]')
+                if len(services) > 0 :
+                    wms_list.append(services[0].get('href').replace('https://emg.pdas.prism.eox.at/','')) 
+
+
+# replace the strings 'username' and 'Password' with the pdas/vs credintials 
+get_requests('https://emg.pdas.prism.eox.at/opensearch/collections/Emergency/atom/', 'username', 'password' )
+
+class QuickstartUser(HttpUser):
+
+
+    wait_time = between(0, 0)
+
+    @task(3)
+    def view_item(self):
+       item_id = random.randint(0, len(wms_list)-1)
+       item = wms_list[item_id]
+       # replace the strings 'username' and 'Password' with the pdas/vs credintials 
+
+       self.client.get(f"{item}", auth=('username', 'password'))
+    
diff --git a/performance_test/vhr18.py b/performance_test/vhr18.py
deleted file mode 100644
index b8fd318c..00000000
--- a/performance_test/vhr18.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import random
-from locust import HttpUser, task, between
-
-REQUESTS = [
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=8.96484375%2C50.625%2C9.052734375%2C50.712890625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=8.701171875%2C50.888671875%2C8.7890625%2C50.9765625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=5.625%2C59.4140625%2C5.9765625%2C59.765625',
-    'ows?STYLES=&CRS=EPSG%3A4326&service=WMS&format=image%2Fpng&request=GetMap&layers=urn%3Aeop%3APHR%3AMULTISPECTRAL_2m%3ADS_PHR1B_201808301049554_FR1_PX_E007N59_0208_06528_6d55&height=100&width=48&version=1.3.0&BBOX=58.910973%2C6.897674%2C59.754323%2C7.303657&TRANSPARENT=true',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=7.03125%2C59.4140625%2C7.3828125%2C59.765625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=0.28564453125%2C52.4267578125%2C0.3076171875%2C52.44873046875',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=0.28564453125%2C52.5146484375%2C0.3076171875%2C52.53662109375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=0.2197265625%2C52.470703125%2C0.24169921875%2C52.49267578125',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-2.8125%2C53.0859375%2C-2.4609375%2C53.4375',
-    'ows?STYLES=&CRS=EPSG%3A4326&service=WMS&format=image%2Fpng&request=GetMap&layers=urn%3Aeop%3APHR%3AMULTISPECTRAL_2m%3ADS_PHR1B_201808311131545_FR1_PX_W004N54_0418_06488_f211&height=100&width=47&version=1.3.0&BBOX=54.450326%2C-3.667708%2C54.702967%2C-3.547633&TRANSPARENT=true',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-3.5980224609375%2C54.5196533203125%2C-3.592529296875%2C54.525146484375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-3.6474609375%2C54.5361328125%2C-3.603515625%2C54.580078125',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=0.28564453125%2C52.5146484375%2C0.3076171875%2C52.53662109375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=37.177734375%2C36.71630859375%2C37.19970703125%2C36.73828125',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=37.11181640625%2C36.76025390625%2C37.1337890625%2C36.7822265625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=36.5625%2C36.5625%2C36.9140625%2C36.9140625',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=35.09033203125%2C37.68035888671875%2C35.091705322265625%2C37.681732177734375',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=35.080718994140625%2C37.681732177734375%2C35.08209228515625%2C37.68310546875',
-    'ows?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=VHR_IMAGE_2018_Level_3__TRUE_COLOR&STYLES=&time=2018-08-01T00%3A00%3A00Z%2F2018-08-31T23%3A59%3A59Z&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=34.98046875%2C37.68310546875%2C35.00244140625%2C37.705078125'
-]  
-
-
-class QuickstartUser(HttpUser):
-    wait_time = between(5, 9)
-
-    @task(3)
-    def view_item(self):
-       item_id = random.randint(0, 18)
-       item = REQUESTS[item_id]
-       # replace the strings 'username' and 'Password' with the pdas/vs credintials 
-       self.client.get(f"{item}", auth=('username', 'Password'))
diff --git a/performance_test/vhr18_wcs.py b/performance_test/vhr18_wcs.py
new file mode 100644
index 00000000..7ebb6b84
--- /dev/null
+++ b/performance_test/vhr18_wcs.py
@@ -0,0 +1,43 @@
+import gevent.monkey
+gevent.monkey.patch_all()
+import random
+import requests
+import time
+from xml.etree import ElementTree
+
+from locust import HttpUser, task, between
+
+
+wcs_list = []
+
+
+def get_requests (url, user, password):
+        response = requests.get(url = url, auth = (user, password))
+
+        catalog = ElementTree.fromstring(response.content)
+        entries = catalog.findall('{http://www.w3.org/2005/Atom}entry')
+
+        for entry in entries :
+            wcs_offers = entry.findall('{http://www.opengis.net/owc/1.0}offering[@code="http://www.opengis.net/spec/owc-atom/1.0/req/wcs"]')
+            for offer in wcs_offers :
+                services = offer.findall('{http://www.opengis.net/owc/1.0}operation[@code="GetCoverage"]')
+                if len(services) > 0 :
+                    modified_request = '%s&scalesize=x(50),y(50)' % (services[0].get('href').replace('https://emg.pdas.prism.eox.at/',''))
+                    wcs_list.append(modified_request)
+
+# replace the strings 'username' and 'Password' with the pdas/vs credintials 
+get_requests('http://vhr18.pdas.prism.eox.at/opensearch/collections/VHR_IMAGE_2018_Level_3/atom', 'username', 'password')
+
+class QuickstartUser(HttpUser):
+
+
+    wait_time = between(0, 0)
+
+    @task(3)
+    def view_item(self):
+       item_id = random.randint(0, len(wcs_list)-1)
+       item = wcs_list[item_id]
+       # replace the strings 'username' and 'Password' with the pdas/vs credintials 
+
+       self.client.get(f"{item}", auth=('username', 'password'))
+    
diff --git a/performance_test/vhr18_wms.py b/performance_test/vhr18_wms.py
new file mode 100644
index 00000000..0921ba0b
--- /dev/null
+++ b/performance_test/vhr18_wms.py
@@ -0,0 +1,42 @@
+import gevent.monkey
+gevent.monkey.patch_all()
+import random
+import requests
+import time
+from xml.etree import ElementTree
+
+from locust import HttpUser, task, between
+
+wms_list = []
+
+def get_requests (url, user, password):
+        response = requests.get(url = url, auth = (user, password))
+
+        catalog = ElementTree.fromstring(response.content)
+        entries = catalog.findall('{http://www.w3.org/2005/Atom}entry')
+
+        for entry in entries :
+
+            wms_offers = entry.findall('{http://www.opengis.net/owc/1.0}offering[@code="http://www.opengis.net/spec/owc-atom/1.0/req/wms"]')
+            for offer in wms_offers :
+                services = offer.findall('{http://www.opengis.net/owc/1.0}operation[@code="GetMap"]')
+                if len(services) > 0 :
+                    wms_list.append(services[0].get('href').replace('https://emg.pdas.prism.eox.at/','')) 
+
+
+# replace the strings 'username' and 'Password' with the pdas/vs credintials 
+get_requests('http://vhr18.pdas.prism.eox.at/opensearch/collections/VHR_IMAGE_2018_Level_3/atom', 'username', 'password')
+
+class QuickstartUser(HttpUser):
+
+
+    wait_time = between(0, 0)
+
+    @task(3)
+    def view_item(self):
+       item_id = random.randint(0, len(wms_list)-1)
+       item = wms_list[item_id]
+       # replace the strings 'username' and 'Password' with the pdas/vs credintials 
+
+       self.client.get(f"{item}", auth=('username', 'password'))
+    
-- 
GitLab