Skip to content

Commit

Permalink
improve benchmark by using multiple geojson so we can check caching
Browse files Browse the repository at this point in the history
  • Loading branch information
BielStela committed Sep 25, 2024
1 parent c6b316a commit d5ae18b
Showing 1 changed file with 114 additions and 7 deletions.
121 changes: 114 additions & 7 deletions api/tests/benchmark_grid_post.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- command:
-- wrk -c 100 -t 10 -d 10s -s benchmark_grid_post.lua 'http://localhost:8000/grid/tile/815f7ffffffffff?columns=AMIN'

wrk.method = "POST"
wrk.body = [[
{
local geojsons = {
[[
{
"type": "Feature",
"properties": {},
"geometry": {
Expand Down Expand Up @@ -34,7 +34,114 @@ wrk.body = [[
"type": "Polygon"
}
}
]]
wrk.headers["Content-Type"] = "application/json"
wrk.headers["accept"] = "application/json"
wrk.headers["Authorization"] = "Bearer 1234"
]],
[[
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
-66.98965634041855,
-2.552105344245007
],
[
-66.98965634041855,
-6.931424712822178
],
[
-60.673596725229004,
-6.931424712822178
],
[
-60.673596725229004,
-2.552105344245007
],
[
-66.98965634041855,
-2.552105344245007
]
]
],
"type": "Polygon"
}
}
]],
[[
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
-59.40141593993765,
-0.8180702598489091
],
[
-59.40141593993765,
-3.8038880006152453
],
[
-56.08276971246181,
-3.8038880006152453
],
[
-56.08276971246181,
-0.8180702598489091
],
[
-59.40141593993765,
-0.8180702598489091
]
]
],
"type": "Polygon"
}
}
]],
[[
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
-68.36016539573357,
-3.4797077655746023
],
[
-68.36016539573357,
-10.328634044400019
],
[
-60.34168576692953,
-10.328634044400019
],
[
-60.34168576692953,
-3.4797077655746023
],
[
-68.36016539573357,
-3.4797077655746023
]
]
],
"type": "Polygon"
}
}
]]
}


request = function()
wrk.method = "POST"
wrk.body = geojsons[math.random(1, #geojsons)]
wrk.headers["Content-Type"] = "application/json"
wrk.headers["accept"] = "application/json"
wrk.headers["Authorization"] = "Bearer 1234"
return wrk.format()
end

0 comments on commit d5ae18b

Please sign in to comment.