Skip to content

Commit 41f079c

Browse files
scripts: benchmark currentness indicator with hurl
1 parent 026e91b commit 41f079c

File tree

7 files changed

+71
-0
lines changed

7 files changed

+71
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.hurl
2+
!template.hurl
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# README
2+
3+
## Usage
4+
```
5+
python generate_hurl_files.py
6+
hurl --jobs=1 --repeat 1 indicator-building-count-rhineland-palatinate-ohsomedb.hurl
7+
```
8+
9+
## Results
10+
11+
| Indicator | Topic | Region | Requests | ohsome API [s] | ohsome DB [s] |
12+
| -- | --- | --- | --- | --- | --- |
13+
| Currentness | Buildings (count) | Heidelberg | 1 | 12 | 0.9 |
14+
| Currentness | Buildings (count) | Heidelberg | 10 | 29 | 2.8 |
15+
| Currentness | Buildings (count) | Heidelberg | 100 | 240 | 25 |
16+
| Currentness | Buildings (count) | Frankfurt | 1 | 49 | 1.3 |
17+
| Currentness | Buildings (count) | Frankfurt | 10 | 96 | 4 |
18+
| Currentness | Buildings (count) | Frankfurt | 100 | 693 | 31 |
19+
| Currentness | Buildings (count) | Rhineland-Palatinate | 1 | 37 | 3.5 |
20+
| Currentness | Buildings (count) | Rhineland-Palatinate | 10 | 83 | 19 |
21+
| Currentness | Buildings (count) | Rhineland-Palatinate | 100 | 656 | 149 |
22+
| Currentness | Roads (length) | Heidelberg | 1 | 6 | 0.8 |
23+
| Currentness | Roads (length) | Heidelberg | 10 | 10 | 3 |
24+
| Currentness | Roads (length) | Heidelberg | 100 | 50 | 22 |
25+
| Currentness | Roads (length) | Frankfurt | 1 | 16 | 0.9 |
26+
| Currentness | Roads (length) | Frankfurt | 10 | 22 | 3 |
27+
| Currentness | Roads (length) | Frankfurt | 100 | 160 | 26 |
28+
| Currentness | Roads (length) | Rhineland-Palatinate | 1 | 71 | 3 |
29+
| Currentness | Roads (length) | Rhineland-Palatinate | 10 | 113 | 17 |
30+
| Currentness | Roads (length) | Rhineland-Palatinate | 100 | 761 | 124 |

regression-tests/currentness/frankfurt.geojson

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import json
2+
from pathlib import Path
3+
from string import Template
4+
5+
dir = Path(__file__).parent
6+
with open(dir / "template.hurl", "r") as file:
7+
hurl_file_template = Template(file.read())
8+
for topic in ("building-count", "roads"):
9+
for region in ("heidelberg", "frankfurt", "rhineland-palatinate"):
10+
for ohsomedb in ("true", "false"):
11+
with open(Path(dir / region).with_suffix(".geojson"), "r") as f:
12+
bpolys = json.load(f)
13+
hurl_file = hurl_file_template.substitute(
14+
base_url="https://api.quality.ohsome.org/v1-test",
15+
indicator="currentness",
16+
topic=topic,
17+
bpolys=json.dumps(bpolys),
18+
ohsomedb=ohsomedb,
19+
)
20+
if ohsomedb == "true":
21+
ohsomedb_text = "-ohsomedb"
22+
else:
23+
ohsomedb_text = ""
24+
path = Path(dir) / f"indicator-{topic}-{region}{ohsomedb_text}.hurl"
25+
with open(path, "w") as f:
26+
f.write(hurl_file)

regression-tests/currentness/heidelberg.geojson

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

regression-tests/currentness/rhineland-palatinate.geojson

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
POST $base_url/indicators/$indicator
2+
accept: application/json
3+
{
4+
"topic": "$topic",
5+
"ohsomedb": "$ohsomedb",
6+
"bpolys": $bpolys
7+
}
8+
HTTP 200
9+
[Captures]
10+
duration_in_ms: duration

0 commit comments

Comments
 (0)