From 7c4b96e5bc455783aae1627cac843873c5ea3920 Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sat, 28 Sep 2024 01:34:40 +0200 Subject: [PATCH 1/5] .ops: add performance-test to run k6 against an instance Put result summary into a json we can diff easily for each endpoint. --- .ops/performance-test/.gitignore | 1 + .ops/performance-test/README.md | 14 + .ops/performance-test/docker-compose.yml | 12 + .ops/performance-test/output.json | 795 +++++++++++++++++++++++ .ops/performance-test/package-lock.json | 30 + .ops/performance-test/package.json | 15 + .ops/performance-test/script.js | 224 +++++++ 7 files changed, 1091 insertions(+) create mode 100644 .ops/performance-test/.gitignore create mode 100644 .ops/performance-test/README.md create mode 100644 .ops/performance-test/docker-compose.yml create mode 100644 .ops/performance-test/output.json create mode 100644 .ops/performance-test/package-lock.json create mode 100644 .ops/performance-test/package.json create mode 100644 .ops/performance-test/script.js diff --git a/.ops/performance-test/.gitignore b/.ops/performance-test/.gitignore new file mode 100644 index 0000000000..07e6e472cc --- /dev/null +++ b/.ops/performance-test/.gitignore @@ -0,0 +1 @@ +/node_modules diff --git a/.ops/performance-test/README.md b/.ops/performance-test/README.md new file mode 100644 index 0000000000..1053270868 --- /dev/null +++ b/.ops/performance-test/README.md @@ -0,0 +1,14 @@ +# Performance tests + +Run tests + +```shell +docker compose run --rm performance-test run --quiet script.js | jq --sort-keys > output.json +``` + +Run tests once to debug + + +```shell +docker compose run --rm -e VUS=1 -e ITERATIONS=1 performance-test run script.js +``` diff --git a/.ops/performance-test/docker-compose.yml b/.ops/performance-test/docker-compose.yml new file mode 100644 index 0000000000..b5340ad38d --- /dev/null +++ b/.ops/performance-test/docker-compose.yml @@ -0,0 +1,12 @@ +services: + performance-test: + image: grafana/k6:0.53.0 + volumes: + - .:/app + user: ${USER_ID:-1000} + network_mode: host + working_dir: /app +# environment: +# - K6_WEB_DASHBOARD=true + ports: + - '5665:5665' diff --git a/.ops/performance-test/output.json b/.ops/performance-test/output.json new file mode 100644 index 0000000000..2af5a90856 --- /dev/null +++ b/.ops/performance-test/output.json @@ -0,0 +1,795 @@ +{ + "metrics": { + "_api_": { + "contains": "default", + "type": "trend", + "values": { + "avg": 597.4005492000001, + "max": 4663.846625, + "med": 329.070555, + "min": 67.791249, + "p(90)": 1038.200255800001, + "p(95)": 2034.5660830499996 + } + }, + "_api_activities": { + "contains": "default", + "type": "trend", + "values": { + "avg": 9395.326058859997, + "max": 30302.253395, + "med": 1440.2965239999999, + "min": 294.988985, + "p(90)": 24382.5620121, + "p(95)": 26113.910084549996 + } + }, + "_api_activity_progress_labels": { + "contains": "default", + "type": "trend", + "values": { + "avg": 552.7501968196722, + "max": 1479.086328, + "med": 485.875092, + "min": 135.239422, + "p(90)": 899.371711, + "p(95)": 1090.047917 + } + }, + "_api_activity_progress_labels_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 582.8107194098361, + "max": 4407.515983, + "med": 422.573973, + "min": 81.149763, + "p(90)": 1137.031778, + "p(95)": 1318.970499 + } + }, + "_api_activity_responsibles": { + "contains": "default", + "type": "trend", + "values": { + "avg": 1177.2161277540984, + "max": 5234.167978, + "med": 1106.540332, + "min": 587.929215, + "p(90)": 1489.038896, + "p(95)": 1587.35552 + } + }, + "_api_activity_responsibles_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 602.7535208524591, + "max": 3346.651675, + "med": 470.509543, + "min": 72.723023, + "p(90)": 1036.108451, + "p(95)": 1355.191711 + } + }, + "_api_authentication_token": { + "contains": "default", + "type": "trend", + "values": { + "avg": 446.8095940666666, + "max": 1174.191059, + "med": 335.95858, + "min": 19.811852, + "p(90)": 967.1843569999999, + "p(95)": 1056.2673565999999 + } + }, + "_api_camp_collaborations": { + "contains": "default", + "type": "trend", + "values": { + "avg": 7449.638928999999, + "max": 11314.866176, + "med": 6884.716679, + "min": 5350.655695, + "p(90)": 10364.930908, + "p(95)": 10783.348565 + } + }, + "_api_camp_collaborations_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 660.5595105081965, + "max": 2621.720404, + "med": 597.742865, + "min": 158.779038, + "p(90)": 982.804226, + "p(95)": 1261.436229 + } + }, + "_api_camps": { + "contains": "default", + "type": "trend", + "values": { + "avg": 2479.8968553606564, + "max": 5503.943108, + "med": 2504.987789, + "min": 958.770926, + "p(90)": 3619.481391, + "p(95)": 4085.424941 + } + }, + "_api_camps_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 801.032204196721, + "max": 8847.985497, + "med": 468.117274, + "min": 155.986414, + "p(90)": 1017.219679, + "p(95)": 1389.397833 + } + }, + "_api_categories": { + "contains": "default", + "type": "trend", + "values": { + "avg": 2892.2354181475416, + "max": 6905.705148, + "med": 2938.272375, + "min": 182.17225, + "p(90)": 5620.136875, + "p(95)": 6017.59529 + } + }, + "_api_categories_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 634.3042482888891, + "max": 2598.111737, + "med": 447.99005, + "min": 56.854684, + "p(90)": 1420.7547880000002, + "p(95)": 1575.2670325999998 + } + }, + "_api_checklist_items": { + "contains": "default", + "type": "trend", + "values": { + "avg": 488.16366829508223, + "max": 1999.248444, + "med": 403.842376, + "min": 36.583704, + "p(90)": 895.73299, + "p(95)": 1129.653232 + } + }, + "_api_checklists": { + "contains": "default", + "type": "trend", + "values": { + "avg": 438.2620532622952, + "max": 1670.360519, + "med": 400.031172, + "min": 30.846822, + "p(90)": 698.10293, + "p(95)": 1193.113187 + } + }, + "_api_content_node_checklist_nodes": { + "contains": "default", + "type": "trend", + "values": { + "avg": 719.0971186000002, + "max": 1197.105103, + "med": 707.191877, + "min": 395.429768, + "p(90)": 1080.4763543999998, + "p(95)": 1196.7691625 + } + }, + "_api_content_node_column_layouts": { + "contains": "default", + "type": "trend", + "values": { + "avg": 2912.625475466667, + "max": 5900.323973, + "med": 4001.563376, + "min": 205.920722, + "p(90)": 4794.306740200001, + "p(95)": 5180.802872799999 + } + }, + "_api_content_node_column_layouts_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 661.2959354444445, + "max": 2305.871281, + "med": 498.103599, + "min": 127.816801, + "p(90)": 1149.9025266000003, + "p(95)": 1727.8869037999996 + } + }, + "_api_content_node_material_nodes": { + "contains": "default", + "type": "trend", + "values": { + "avg": 7251.7507898, + "max": 13814.349528, + "med": 6796.461324, + "min": 603.602806, + "p(90)": 12454.7977346, + "p(95)": 12974.1256743 + } + }, + "_api_content_node_material_nodes_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 1257.2401178571429, + "max": 2672.409212, + "med": 919.471861, + "min": 229.917778, + "p(90)": 2435.1252272, + "p(95)": 2553.7672196 + } + }, + "_api_content_node_multi_selects": { + "contains": "default", + "type": "trend", + "values": { + "avg": 1006.2790087333332, + "max": 1900.726952, + "med": 859.301018, + "min": 482.991763, + "p(90)": 1574.0191249999998, + "p(95)": 1761.4326464999997 + } + }, + "_api_content_node_multi_selects_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 382.7923359999999, + "max": 704.742835, + "med": 355.284105, + "min": 87.87552, + "p(90)": 666.480774, + "p(95)": 696.5156419 + } + }, + "_api_content_node_responsive_layouts": { + "contains": "default", + "type": "trend", + "values": { + "avg": 2060.9886846666664, + "max": 3880.344475, + "med": 1825.639992, + "min": 1114.299854, + "p(90)": 3257.7510661999995, + "p(95)": 3859.5648112 + } + }, + "_api_content_node_responsive_layouts_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 438.8198235714285, + "max": 855.320056, + "med": 423.4677845, + "min": 128.730054, + "p(90)": 779.0791851000002, + "p(95)": 837.6443759 + } + }, + "_api_content_node_single_texts": { + "contains": "default", + "type": "trend", + "values": { + "avg": 4175.911153066667, + "max": 6266.570066, + "med": 4406.249482, + "min": 718.46453, + "p(90)": 5611.5130158, + "p(95)": 5994.3562423 + } + }, + "_api_content_node_single_texts_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 807.5571537692306, + "max": 2996.474143, + "med": 636.39604, + "min": 45.474194, + "p(90)": 1175.1627016, + "p(95)": 1919.7981105999975 + } + }, + "_api_content_node_storyboards": { + "contains": "default", + "type": "trend", + "values": { + "avg": 1526.5467385333332, + "max": 2805.308703, + "med": 1470.078597, + "min": 500.102294, + "p(90)": 2652.6750382, + "p(95)": 2796.9525734000003 + } + }, + "_api_content_node_storyboards_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 869.6125727777776, + "max": 3326.254339, + "med": 384.44504, + "min": 61.743225, + "p(90)": 2100.8778718000003, + "p(95)": 2713.5661053999993 + } + }, + "_api_content_nodes": { + "contains": "default", + "type": "trend", + "values": { + "avg": 11509.877850836067, + "max": 23842.769024, + "med": 13791.266867, + "min": 396.931964, + "p(90)": 18064.80742, + "p(95)": 19299.655926 + } + }, + "_api_content_types": { + "contains": "default", + "type": "trend", + "values": { + "avg": 638.8612655333333, + "max": 1685.506, + "med": 519.998562, + "min": 40.954297, + "p(90)": 1054.8648718, + "p(95)": 1263.9320478999994 + } + }, + "_api_content_types_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 737.4143689333333, + "max": 3884.639287, + "med": 399.519472, + "min": 38.497211, + "p(90)": 1131.3171372, + "p(95)": 1983.828522699997 + } + }, + "_api_day_responsibles": { + "contains": "default", + "type": "trend", + "values": { + "avg": 518.8284316666667, + "max": 2058.165119, + "med": 224.267095, + "min": 73.183762, + "p(90)": 1062.7214576, + "p(95)": 1387.3803434999988 + } + }, + "_api_day_responsibles_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 558.8925259333333, + "max": 2078.256039, + "med": 396.660747, + "min": 35.939584, + "p(90)": 1236.8691861999998, + "p(95)": 1623.7216341999992 + } + }, + "_api_days": { + "contains": "default", + "type": "trend", + "values": { + "avg": 2432.1698788666667, + "max": 4207.147683, + "med": 2980.677184, + "min": 838.39421, + "p(90)": 3352.5868246, + "p(95)": 3631.1128501999992 + } + }, + "_api_days_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 494.47562046666667, + "max": 1260.388001, + "med": 483.471908, + "min": 45.641602, + "p(90)": 936.9364496, + "p(95)": 1054.9265426999996 + } + }, + "_api_invitations": { + "contains": "default", + "type": "trend", + "values": { + "avg": 510.98144441000005, + "max": 4041.08791, + "med": 321.7490045, + "min": 76.215162, + "p(90)": 1100.3291612000007, + "p(95)": 1431.1838546499998 + } + }, + "_api_material_items": { + "contains": "default", + "type": "trend", + "values": { + "avg": 3663.1448093999998, + "max": 5702.815798, + "med": 3667.294481, + "min": 1150.647747, + "p(90)": 5139.0225338, + "p(95)": 5445.799483899999 + } + }, + "_api_material_items_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 944.2136472666666, + "max": 3504.139376, + "med": 598.448257, + "min": 39.469715, + "p(90)": 2502.2812439999993, + "p(95)": 3259.7129643999997 + } + }, + "_api_material_lists": { + "contains": "default", + "type": "trend", + "values": { + "avg": 2025.3355919333337, + "max": 3531.136117, + "med": 2042.110835, + "min": 590.202204, + "p(90)": 3068.9691898, + "p(95)": 3216.3898151999997 + } + }, + "_api_material_lists_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 443.44199180000004, + "max": 1564.843189, + "med": 391.222193, + "min": 37.785308, + "p(90)": 755.5695261999999, + "p(95)": 1010.1970087999991 + } + }, + "_api_periods": { + "contains": "default", + "type": "trend", + "values": { + "avg": 485.5953614666667, + "max": 1492.607928, + "med": 321.299876, + "min": 51.127719, + "p(90)": 1044.6267748, + "p(95)": 1198.4025591999996 + } + }, + "_api_periods_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 508.1552747333333, + "max": 1182.713267, + "med": 423.750033, + "min": 65.01387, + "p(90)": 1093.1671044, + "p(95)": 1132.2256879 + } + }, + "_api_personal_invitations": { + "contains": "default", + "type": "trend", + "values": { + "avg": 401.68846167, + "max": 2296.938181, + "med": 316.430596, + "min": 73.64524, + "p(90)": 744.2027036000005, + "p(95)": 908.0621995 + } + }, + "_api_personal_invitations_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 435.19021709999987, + "max": 2513.232637, + "med": 297.62640899999997, + "min": 80.268622, + "p(90)": 868.1752073000004, + "p(95)": 1420.1195071999996 + } + }, + "_api_profiles": { + "contains": "default", + "type": "trend", + "values": { + "avg": 546.5153629333333, + "max": 1304.812836, + "med": 445.969248, + "min": 96.685712, + "p(90)": 1028.1827899999998, + "p(95)": 1130.1731931999998 + } + }, + "_api_profiles_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 479.52568566666673, + "max": 2030.454989, + "med": 313.948454, + "min": 32.432281, + "p(90)": 944.2938545999999, + "p(95)": 1384.587974199999 + } + }, + "_api_schedule_entries": { + "contains": "default", + "type": "trend", + "values": { + "avg": 3780.8127758666665, + "max": 5281.385553, + "med": 4162.742584, + "min": 1488.187168, + "p(90)": 4565.6386116, + "p(95)": 4801.1221491 + } + }, + "_api_schedule_entries_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": 463.9364663333334, + "max": 1261.124306, + "med": 393.114615, + "min": 68.207107, + "p(90)": 754.1058068, + "p(95)": 914.2348371999994 + } + }, + "_api_users": { + "contains": "default", + "type": "trend", + "values": { + "avg": 1427.5247893333333, + "max": 3037.699943, + "med": 1200.233969, + "min": 708.399203, + "p(90)": 1917.1336844, + "p(95)": 2261.048059299999 + } + }, + "data_received": { + "contains": "data", + "type": "counter", + "values": { + "count": 243762316, + "rate": 636278.973972607 + } + }, + "data_sent": { + "contains": "data", + "type": "counter", + "values": { + "count": 1833101, + "rate": 4784.839767719305 + } + }, + "http_req_blocked": { + "contains": "time", + "type": "trend", + "values": { + "avg": 0.02212960802638794, + "max": 16.457965, + "med": 0.006565, + "min": 0.003772, + "p(90)": 0.008954600000000002, + "p(95)": 0.009994999999999993 + } + }, + "http_req_connecting": { + "contains": "time", + "type": "trend", + "values": { + "avg": 0.007799586036283672, + "max": 4.22926, + "med": 0, + "min": 0, + "p(90)": 0, + "p(95)": 0 + } + }, + "http_req_duration": { + "contains": "time", + "type": "trend", + "values": { + "avg": 2044.4413049279874, + "max": 30302.253395, + "med": 622.820094, + "min": 19.811852, + "p(90)": 4738.693915200002, + "p(95)": 10836.851380099997 + } + }, + "http_req_duration{expected_response:true}": { + "contains": "time", + "type": "trend", + "values": { + "avg": 1315.8145404588404, + "max": 13814.349528, + "med": 607.204373, + "min": 30.846822, + "p(90)": 3510.3804269000007, + "p(95)": 5773.0622399 + } + }, + "http_req_failed": { + "contains": "default", + "type": "rate", + "values": { + "fails": 1482, + "passes": 337, + "rate": 0.18526663001649257 + } + }, + "http_req_receiving": { + "contains": "time", + "type": "trend", + "values": { + "avg": 0.6953062083562401, + "max": 31.314619, + "med": 0.10875, + "min": 0.028636, + "p(90)": 1.0859442000000008, + "p(95)": 2.855566299999999 + } + }, + "http_req_sending": { + "contains": "time", + "type": "trend", + "values": { + "avg": 0.05446428752061577, + "max": 7.958742, + "med": 0.022002, + "min": 0.009988, + "p(90)": 0.038428, + "p(95)": 0.047635 + } + }, + "http_req_tls_handshaking": { + "contains": "time", + "type": "trend", + "values": { + "avg": 0, + "max": 0, + "med": 0, + "min": 0, + "p(90)": 0, + "p(95)": 0 + } + }, + "http_req_waiting": { + "contains": "time", + "type": "trend", + "values": { + "avg": 2043.6915344321026, + "max": 30302.156867, + "med": 622.665103, + "min": 19.680352, + "p(90)": 4713.584906000004, + "p(95)": 10836.749867499997 + } + }, + "http_reqs": { + "contains": "default", + "type": "counter", + "values": { + "count": 1819, + "rate": 4.748032725682554 + } + }, + "iteration_duration": { + "contains": "time", + "type": "trend", + "values": { + "avg": 37350.77616242001, + "max": 82779.860569, + "med": 34675.388172, + "min": 17959.880297, + "p(90)": 60315.1668492, + "p(95)": 71934.44362430001 + } + }, + "iterations": { + "contains": "default", + "type": "counter", + "values": { + "count": 100, + "rate": 0.2610243389600085 + } + }, + "login": { + "contains": "default", + "type": "trend", + "values": { + "avg": 997.9409991200004, + "max": 3604.53853, + "med": 841.5868175, + "min": 509.389163, + "p(90)": 1412.3664702000003, + "p(95)": 2148.1781490500002 + } + }, + "vus": { + "contains": "default", + "type": "gauge", + "values": { + "max": 10, + "min": 1, + "value": 1 + } + }, + "vus_max": { + "contains": "default", + "type": "gauge", + "values": { + "max": 10, + "min": 10, + "value": 10 + } + } + }, + "options": { + "noColor": false, + "summaryTimeUnit": "", + "summaryTrendStats": [ + "avg", + "min", + "med", + "max", + "p(90)", + "p(95)" + ] + }, + "root_group": { + "checks": [], + "groups": [], + "id": "d41d8cd98f00b204e9800998ecf8427e", + "name": "", + "path": "" + }, + "state": { + "isStdErrTTY": false, + "isStdOutTTY": false, + "testRunDurationMs": 383106.036772 + } +} diff --git a/.ops/performance-test/package-lock.json b/.ops/performance-test/package-lock.json new file mode 100644 index 0000000000..d9533ce3db --- /dev/null +++ b/.ops/performance-test/package-lock.json @@ -0,0 +1,30 @@ +{ + "name": "performance-test", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "performance-test", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@types/k6": "0.53.2" + } + }, + "node_modules/@types/k6": { + "version": "0.53.2", + "resolved": "https://registry.npmjs.org/@types/k6/-/k6-0.53.2.tgz", + "integrity": "sha512-TxFJbeSfD/RfQe+GeMbpdwiOOySRTj3vfHvcA4yoLQ3wvGPjyppCqmyKXgktf3535T+YAc41bB7GkhuCPRmfUg==", + "dev": true + } + }, + "dependencies": { + "@types/k6": { + "version": "0.53.2", + "resolved": "https://registry.npmjs.org/@types/k6/-/k6-0.53.2.tgz", + "integrity": "sha512-TxFJbeSfD/RfQe+GeMbpdwiOOySRTj3vfHvcA4yoLQ3wvGPjyppCqmyKXgktf3535T+YAc41bB7GkhuCPRmfUg==", + "dev": true + } + } +} diff --git a/.ops/performance-test/package.json b/.ops/performance-test/package.json new file mode 100644 index 0000000000..e45e4deadc --- /dev/null +++ b/.ops/performance-test/package.json @@ -0,0 +1,15 @@ +{ + "name": "performance-test", + "version": "1.0.0", + "description": "", + "main": "script.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/k6": "0.53.2" + } +} diff --git a/.ops/performance-test/script.js b/.ops/performance-test/script.js new file mode 100644 index 0000000000..92fd75259d --- /dev/null +++ b/.ops/performance-test/script.js @@ -0,0 +1,224 @@ +import http from 'k6/http' +import { Trend } from 'k6/metrics' + +export const options = { + // A number specifying the number of VUs to run concurrently. + vus: __ENV.VUS || 10, + iterations: __ENV.ITERATIONS || 100, + // A string specifying the total duration of the test run. + duration: __ENV.DURATION, +} + +const host = __ENV.API_ROOT_URL || 'http://localhost:3000' + +const specialEndpoints = [ + '/', + '/api', + '/authentication_token', + '/auth/google', + '/auth/pbsmidata', + '/auth/cevidb', + '/auth/jubladb', + '/auth/reset_password', + '/auth/resend_activation', + '/invitations', + '/personal_invitations', +] + +const metricsMap = new Map() + +const loginTrend = new Trend('login') + +for (const [_, value] of Object.entries(getUrlsToMeasure()._links)) { + const urlWithoutTemplate = value.href.replace(/{.*$/, '') + if (!specialEndpoints.includes(urlWithoutTemplate)) { + metricsMap.set(`${urlWithoutTemplate}`, new Trend(toMetricName(urlWithoutTemplate))) + metricsMap.set(`${urlWithoutTemplate}/item`, new Trend(toMetricName(`${urlWithoutTemplate}/item`))) + } +} + + +export default function() { + const payload = JSON.stringify({ + identifier: __ENV.USER || 'test@example.com', password: __ENV.PASSWORD || 'test', + }) + const loginResponse = http.post( + `${host}/api/authentication_token`, + payload, + { headers: { 'Content-Type': 'application/json' } }) + loginTrend.add(loginResponse.timings.duration); + + for (const [_, value] of Object.entries(getUrlsToMeasure()._links)) { + const urlWithoutTemplate = value.href.replace(/{.*$/, '') + if (!specialEndpoints.includes(urlWithoutTemplate)) { + const url = `${host}${urlWithoutTemplate}.jsonhal` + const collection = http.get(url) + + metricsMap.get(urlWithoutTemplate)?.add(collection.timings.duration) + + const itemUrl = JSON.parse(collection.body)?._embedded?.items[0]?._links?.self?.href + if (itemUrl) { + const itemResponse = http.get(`${host}${itemUrl}.jsonhal`) + metricsMap.get(`${urlWithoutTemplate}/item`)?.add(itemResponse.timings.duration) + } + } + } +} + + +// noinspection JSUnusedGlobalSymbols +export function handleSummary(data) { + return { + 'stdout': JSON.stringify(data), + }; +} + + +function getUrlsToMeasure() { + return { + '_links': { + 'self': { + 'href': '/api/', + }, + 'invitations': { + 'href': '/api/invitations{/id}{/action}', + 'templated': true, + }, + 'personalInvitations': { + 'href': '/api/personal_invitations{/id}{/action}', + 'templated': true, + }, + 'activities': { + 'href': '/api/activities{/id}{?camp,camp[]}', + 'templated': true, + }, + 'activityProgressLabels': { + 'href': '/api/activity_progress_labels{/id}{?camp,camp[]}', + 'templated': true, + }, + 'activityResponsibles': { + 'href': '/api/activity_responsibles{/id}{?activity,activity[],activity.camp,activity.camp[]}', + 'templated': true, + }, + 'camps': { + 'href': '/api/camps{/id}{?isPrototype,isPrototype[]}', + 'templated': true, + }, + 'campCollaborations': { + 'href': '/api/camp_collaborations{/id}{/action}{?camp,camp[],activityResponsibles.activity,activityResponsibles.activity[]}', + 'templated': true, + }, + 'categories': { + 'href': '/api/categories{/id}{?camp,camp[]}', + 'templated': true, + }, + 'checklists': { + 'href': '/api/checklists{/id}{?camp,camp[],isPrototype,isPrototype[]}', + 'templated': true, + }, + 'checklistItems': { + 'href': '/api/checklist_items{/id}{?checklist,checklist[],checklist.camp,checklist.camp[]}', + 'templated': true, + }, + 'contentNodes': { + 'href': '/api/content_nodes{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'checklistNodes': { + 'href': '/api/content_node/checklist_nodes{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'columnLayouts': { + 'href': '/api/content_node/column_layouts{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'materialNodes': { + 'href': '/api/content_node/material_nodes{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'multiSelects': { + 'href': '/api/content_node/multi_selects{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'responsiveLayouts': { + 'href': '/api/content_node/responsive_layouts{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'singleTexts': { + 'href': '/api/content_node/single_texts{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'storyboards': { + 'href': '/api/content_node/storyboards{/id}{?contentType,contentType[],root,root[],period}', + 'templated': true, + }, + 'contentTypes': { + 'href': '/api/content_types{/id}{?categories,categories[]}', + 'templated': true, + }, + 'days': { + 'href': '/api/days{/id}{?period,period[],period.camp,period.camp[]}', + 'templated': true, + }, + 'dayResponsibles': { + 'href': '/api/day_responsibles{/id}{?day,day[],day.period,day.period[]}', + 'templated': true, + }, + 'materialItems': { + 'href': '/api/material_items{/id}{?materialList,materialList[],materialNode,materialNode[],period}', + 'templated': true, + }, + 'materialLists': { + 'href': '/api/material_lists{/id}{?camp,camp[]}', + 'templated': true, + }, + 'periods': { + 'href': '/api/periods{/id}{?camp,camp[]}', + 'templated': true, + }, + 'profiles': { + 'href': '/api/profiles{/id}{?user.collaborations.camp,user.collaborations.camp[]}', + 'templated': true, + }, + 'scheduleEntries': { + 'href': '/api/schedule_entries{/id}{?period,period[],activity,activity[],start[before],start[strictly_before],start[after],start[strictly_after],end[before],end[strictly_before],end[after],end[strictly_after]}', + 'templated': true, + }, + 'users': { + 'href': '/api/users{/id}{/action}', + 'templated': true, + }, + 'login': { + 'href': '/api/authentication_token', + }, + 'oauthGoogle': { + 'href': '/api/auth/google{?callback}', + 'templated': true, + }, + 'oauthPbsmidata': { + 'href': '/api/auth/pbsmidata{?callback}', + 'templated': true, + }, + 'oauthCevidb': { + 'href': '/api/auth/cevidb{?callback}', + 'templated': true, + }, + 'oauthJubladb': { + 'href': '/api/auth/jubladb{?callback}', + 'templated': true, + }, + 'resetPassword': { + 'href': '/api/auth/reset_password{/id}', + 'templated': true, + }, + 'resendActivation': { + 'href': '/api/auth/resend_activation', + 'templated': false, + }, + }, + } +} + +function toMetricName(name) { + return name.replaceAll("/", "_") +} From 6fab69130800015397a8bbc0354fec733817415e Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sun, 29 Sep 2024 10:27:29 +0200 Subject: [PATCH 2/5] hook_db_restore: use network_mode host for local development That we find the url for the local db easily. --- .helm/ecamp3/files/hook_db_restore/.env-example | 2 +- .helm/ecamp3/files/hook_db_restore/docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.helm/ecamp3/files/hook_db_restore/.env-example b/.helm/ecamp3/files/hook_db_restore/.env-example index 70d82034be..8da6068f7c 100644 --- a/.helm/ecamp3/files/hook_db_restore/.env-example +++ b/.helm/ecamp3/files/hook_db_restore/.env-example @@ -2,7 +2,7 @@ SOURCE_FILE=latest APP_NAME=test-db-backup-job DATABASE_URL= #if you want to restore to your local database: -#DATABASE_URL=postgresql://ecamp3:ecamp3@:5432/ecamp3dev +#DATABASE_URL=postgresql://ecamp3:ecamp3@localhost:5432/ecamp3dev ENCRYPTION_KEY=test S3_ENDPOINT=https://s3.eu-west-3.amazonaws.com S3_BUCKET= diff --git a/.helm/ecamp3/files/hook_db_restore/docker-compose.yml b/.helm/ecamp3/files/hook_db_restore/docker-compose.yml index 4c414f4a1b..58e0315019 100644 --- a/.helm/ecamp3/files/hook_db_restore/docker-compose.yml +++ b/.helm/ecamp3/files/hook_db_restore/docker-compose.yml @@ -10,3 +10,4 @@ services: - "-x" - /restore-backup.sh env_file: .env + network_mode: host From 12c0203545b3f4c854e83ff12a9818965589d0d4 Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sun, 29 Sep 2024 10:28:27 +0200 Subject: [PATCH 3/5] hook_db_restore: add update-support-email.sh for local development This does not end up in the docker image or in the helm deployment. --- .helm/ecamp3/files/hook_db_restore/README.md | 7 +++++++ .../files/hook_db_restore/docker-compose.yml | 1 + .../hook_db_restore/update-support-email.sh | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 .helm/ecamp3/files/hook_db_restore/update-support-email.sh diff --git a/.helm/ecamp3/files/hook_db_restore/README.md b/.helm/ecamp3/files/hook_db_restore/README.md index 135a2b8b76..7ae7001837 100644 --- a/.helm/ecamp3/files/hook_db_restore/README.md +++ b/.helm/ecamp3/files/hook_db_restore/README.md @@ -16,3 +16,10 @@ It also contains a docker-compose.yml file to easily test the [restore-backup.sh ```shell docker compose run --rm restore-backup ``` +4. Maybe locally: change username and password of the support account + That we don't need sharp credentials in the local performance testing. + + ```shell + docker compose run --rm restore-backup sh update-support-email.sh + ``` + diff --git a/.helm/ecamp3/files/hook_db_restore/docker-compose.yml b/.helm/ecamp3/files/hook_db_restore/docker-compose.yml index 58e0315019..0dd5ad2572 100644 --- a/.helm/ecamp3/files/hook_db_restore/docker-compose.yml +++ b/.helm/ecamp3/files/hook_db_restore/docker-compose.yml @@ -5,6 +5,7 @@ services: dockerfile: Dockerfile volumes: - ./restore-backup.sh:/restore-backup.sh + - ./update-support-email.sh:/update-support-email.sh command: - sh - "-x" diff --git a/.helm/ecamp3/files/hook_db_restore/update-support-email.sh b/.helm/ecamp3/files/hook_db_restore/update-support-email.sh new file mode 100644 index 0000000000..958984b3a5 --- /dev/null +++ b/.helm/ecamp3/files/hook_db_restore/update-support-email.sh @@ -0,0 +1,17 @@ +set -e + +tmpfile=$(mktemp) + +cat << 'EOF' | tee -a $tmpfile +BEGIN; + +WITH profile as (SELECT id from profile WHERE email = 'support@ecamp3.ch'), + update_password as (UPDATE "user" SET password = '$2y$13$KTCSklVQHNvbwJQ3Awl8Ee7t0wJB1gfRBXDANeQlBblqwJ4wgOEmC' WHERE profileid = (SELECT id FROM profile)), + update_email as (UPDATE "profile" SET email = 'test@example.com' WHERE id = (SELECT id FROM profile)) +SELECT 1; + +COMMIT; + +EOF + +psql $DATABASE_URL -v ON_ERROR_STOP=1 < $tmpfile From 30287c03213170ed75bc2cf28088a0383b30c5e8 Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sun, 29 Sep 2024 10:47:57 +0200 Subject: [PATCH 4/5] performance-test: also add failing endpoints to metrics Else the results shift and are not diffable. Use a large negative number that it is clear that an id for a item endpoint could not be found. --- .ops/performance-test/output.json | 806 +++++++++++++++++------------- .ops/performance-test/script.js | 2 + 2 files changed, 453 insertions(+), 355 deletions(-) diff --git a/.ops/performance-test/output.json b/.ops/performance-test/output.json index 2af5a90856..4e97fb5f55 100644 --- a/.ops/performance-test/output.json +++ b/.ops/performance-test/output.json @@ -4,624 +4,720 @@ "contains": "default", "type": "trend", "values": { - "avg": 597.4005492000001, - "max": 4663.846625, - "med": 329.070555, - "min": 67.791249, - "p(90)": 1038.200255800001, - "p(95)": 2034.5660830499996 + "avg": 527.4997892600003, + "max": 4136.446824, + "med": 344.323632, + "min": 64.40607, + "p(90)": 1086.9011152, + "p(95)": 1665.6265822499995 + } + }, + "_api__item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_activities": { "contains": "default", "type": "trend", "values": { - "avg": 9395.326058859997, - "max": 30302.253395, - "med": 1440.2965239999999, - "min": 294.988985, - "p(90)": 24382.5620121, - "p(95)": 26113.910084549996 + "avg": 8800.766479040003, + "max": 27298.537974, + "med": 1284.4512140000002, + "min": 391.279274, + "p(90)": 23721.92230200001, + "p(95)": 25423.76307335 + } + }, + "_api_activities_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_activity_progress_labels": { "contains": "default", "type": "trend", "values": { - "avg": 552.7501968196722, - "max": 1479.086328, - "med": 485.875092, - "min": 135.239422, - "p(90)": 899.371711, - "p(95)": 1090.047917 + "avg": 555.2684541147543, + "max": 4808.292938, + "med": 463.614346, + "min": 83.170556, + "p(90)": 822.303482, + "p(95)": 904.707295 } }, "_api_activity_progress_labels_item": { "contains": "default", "type": "trend", "values": { - "avg": 582.8107194098361, - "max": 4407.515983, - "med": 422.573973, - "min": 81.149763, - "p(90)": 1137.031778, - "p(95)": 1318.970499 + "avg": 475.5558011311475, + "max": 1792.345108, + "med": 351.12257, + "min": 66.852355, + "p(90)": 911.39863, + "p(95)": 1010.594548 } }, "_api_activity_responsibles": { "contains": "default", "type": "trend", "values": { - "avg": 1177.2161277540984, - "max": 5234.167978, - "med": 1106.540332, - "min": 587.929215, - "p(90)": 1489.038896, - "p(95)": 1587.35552 + "avg": 1105.4301964590165, + "max": 2522.206747, + "med": 996.667561, + "min": 599.08792, + "p(90)": 1587.269149, + "p(95)": 1884.812916 } }, "_api_activity_responsibles_item": { "contains": "default", "type": "trend", "values": { - "avg": 602.7535208524591, - "max": 3346.651675, - "med": 470.509543, - "min": 72.723023, - "p(90)": 1036.108451, - "p(95)": 1355.191711 + "avg": 486.1014467377049, + "max": 1962.582328, + "med": 363.689855, + "min": 72.714119, + "p(90)": 799.698755, + "p(95)": 1062.485492 } }, "_api_authentication_token": { "contains": "default", "type": "trend", "values": { - "avg": 446.8095940666666, - "max": 1174.191059, - "med": 335.95858, - "min": 19.811852, - "p(90)": 967.1843569999999, - "p(95)": 1056.2673565999999 + "avg": 441.74872454545454, + "max": 1211.134289, + "med": 416.831236, + "min": 22.302102, + "p(90)": 719.172437, + "p(95)": 965.153363 } }, "_api_camp_collaborations": { "contains": "default", "type": "trend", "values": { - "avg": 7449.638928999999, - "max": 11314.866176, - "med": 6884.716679, - "min": 5350.655695, - "p(90)": 10364.930908, - "p(95)": 10783.348565 + "avg": 7958.618062081971, + "max": 15857.761334, + "med": 7246.395723, + "min": 5111.239378, + "p(90)": 10961.5493, + "p(95)": 13407.390658 } }, "_api_camp_collaborations_item": { "contains": "default", "type": "trend", "values": { - "avg": 660.5595105081965, - "max": 2621.720404, - "med": 597.742865, - "min": 158.779038, - "p(90)": 982.804226, - "p(95)": 1261.436229 + "avg": 714.1130304262296, + "max": 1333.955421, + "med": 674.404403, + "min": 110.970282, + "p(90)": 1139.575704, + "p(95)": 1189.339789 } }, "_api_camps": { "contains": "default", "type": "trend", "values": { - "avg": 2479.8968553606564, - "max": 5503.943108, - "med": 2504.987789, - "min": 958.770926, - "p(90)": 3619.481391, - "p(95)": 4085.424941 + "avg": 2456.602586016393, + "max": 5209.851377, + "med": 2292.731441, + "min": 756.096714, + "p(90)": 3834.214987, + "p(95)": 3986.207601 } }, "_api_camps_item": { "contains": "default", "type": "trend", "values": { - "avg": 801.032204196721, - "max": 8847.985497, - "med": 468.117274, - "min": 155.986414, - "p(90)": 1017.219679, - "p(95)": 1389.397833 + "avg": 747.1907217377051, + "max": 5267.43074, + "med": 587.936093, + "min": 183.641305, + "p(90)": 1349.220825, + "p(95)": 1588.293542 } }, "_api_categories": { "contains": "default", "type": "trend", "values": { - "avg": 2892.2354181475416, - "max": 6905.705148, - "med": 2938.272375, - "min": 182.17225, - "p(90)": 5620.136875, - "p(95)": 6017.59529 + "avg": 2905.403573540983, + "max": 5765.963953, + "med": 2901.081104, + "min": 196.40331, + "p(90)": 5014.737174, + "p(95)": 5224.840961 } }, "_api_categories_item": { "contains": "default", "type": "trend", "values": { - "avg": 634.3042482888891, - "max": 2598.111737, - "med": 447.99005, - "min": 56.854684, - "p(90)": 1420.7547880000002, - "p(95)": 1575.2670325999998 + "avg": -213114352.65941057, + "max": 1557.940897, + "med": 366.665055, + "min": -1000000000, + "p(90)": 973.465312, + "p(95)": 1069.960755 } }, "_api_checklist_items": { "contains": "default", "type": "trend", "values": { - "avg": 488.16366829508223, - "max": 1999.248444, - "med": 403.842376, - "min": 36.583704, - "p(90)": 895.73299, - "p(95)": 1129.653232 + "avg": 509.2287099016391, + "max": 2008.017509, + "med": 378.074791, + "min": 34.284281, + "p(90)": 1101.745692, + "p(95)": 1816.496333 + } + }, + "_api_checklist_items_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_checklists": { "contains": "default", "type": "trend", "values": { - "avg": 438.2620532622952, - "max": 1670.360519, - "med": 400.031172, - "min": 30.846822, - "p(90)": 698.10293, - "p(95)": 1193.113187 + "avg": 537.2138319508198, + "max": 2915.884962, + "med": 360.154268, + "min": 30.206037, + "p(90)": 1009.670591, + "p(95)": 1736.462526 + } + }, + "_api_checklists_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_content_node_checklist_nodes": { "contains": "default", "type": "trend", "values": { - "avg": 719.0971186000002, - "max": 1197.105103, - "med": 707.191877, - "min": 395.429768, - "p(90)": 1080.4763543999998, - "p(95)": 1196.7691625 + "avg": 964.3449896363637, + "max": 2004.319255, + "med": 968.973266, + "min": 496.532074, + "p(90)": 1191.119436, + "p(95)": 1597.7193455000001 + } + }, + "_api_content_node_checklist_nodes_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_content_node_column_layouts": { "contains": "default", "type": "trend", "values": { - "avg": 2912.625475466667, - "max": 5900.323973, - "med": 4001.563376, - "min": 205.920722, - "p(90)": 4794.306740200001, - "p(95)": 5180.802872799999 + "avg": 3081.5614953636364, + "max": 5207.62519, + "med": 4045.21638, + "min": 295.868269, + "p(90)": 5078.299962, + "p(95)": 5142.962576 } }, "_api_content_node_column_layouts_item": { "contains": "default", "type": "trend", "values": { - "avg": 661.2959354444445, - "max": 2305.871281, - "med": 498.103599, - "min": 127.816801, - "p(90)": 1149.9025266000003, - "p(95)": 1727.8869037999996 + "avg": -363636029.39295566, + "max": 1226.760026, + "med": 139.982731, + "min": -1000000000, + "p(90)": 670.816197, + "p(95)": 948.7881115 } }, "_api_content_node_material_nodes": { "contains": "default", "type": "trend", "values": { - "avg": 7251.7507898, - "max": 13814.349528, - "med": 6796.461324, - "min": 603.602806, - "p(90)": 12454.7977346, - "p(95)": 12974.1256743 + "avg": 6152.121571545455, + "max": 13091.05509, + "med": 5757.678854, + "min": 700.17353, + "p(90)": 12064.444703, + "p(95)": 12577.7498965 } }, "_api_content_node_material_nodes_item": { "contains": "default", "type": "trend", "values": { - "avg": 1257.2401178571429, - "max": 2672.409212, - "med": 919.471861, - "min": 229.917778, - "p(90)": 2435.1252272, - "p(95)": 2553.7672196 + "avg": -636363479.7116147, + "max": 565.409013, + "med": -1000000000, + "min": -1000000000, + "p(90)": 449.56132, + "p(95)": 507.4851665 } }, "_api_content_node_multi_selects": { "contains": "default", "type": "trend", "values": { - "avg": 1006.2790087333332, - "max": 1900.726952, - "med": 859.301018, - "min": 482.991763, - "p(90)": 1574.0191249999998, - "p(95)": 1761.4326464999997 + "avg": 740.155763, + "max": 1188.288423, + "med": 787.37743, + "min": 298.226413, + "p(90)": 1178.112303, + "p(95)": 1183.200363 } }, "_api_content_node_multi_selects_item": { "contains": "default", "type": "trend", "values": { - "avg": 382.7923359999999, - "max": 704.742835, - "med": 355.284105, - "min": 87.87552, - "p(90)": 666.480774, - "p(95)": 696.5156419 + "avg": 649.7503516363637, + "max": 1378.873665, + "med": 599.154332, + "min": 107.083223, + "p(90)": 1273.315869, + "p(95)": 1326.094767 } }, "_api_content_node_responsive_layouts": { "contains": "default", "type": "trend", "values": { - "avg": 2060.9886846666664, - "max": 3880.344475, - "med": 1825.639992, - "min": 1114.299854, - "p(90)": 3257.7510661999995, - "p(95)": 3859.5648112 + "avg": 2013.7902961818183, + "max": 4253.366161, + "med": 1993.454574, + "min": 481.184087, + "p(90)": 2781.312178, + "p(95)": 3517.3391695 } }, "_api_content_node_responsive_layouts_item": { "contains": "default", "type": "trend", "values": { - "avg": 438.8198235714285, - "max": 855.320056, - "med": 423.4677845, - "min": 128.730054, - "p(90)": 779.0791851000002, - "p(95)": 837.6443759 + "avg": -90908526.30832818, + "max": 1347.097247, + "med": 407.361131, + "min": -1000000000, + "p(90)": 1231.133938, + "p(95)": 1289.1155924999998 } }, "_api_content_node_single_texts": { "contains": "default", "type": "trend", "values": { - "avg": 4175.911153066667, - "max": 6266.570066, - "med": 4406.249482, - "min": 718.46453, - "p(90)": 5611.5130158, - "p(95)": 5994.3562423 + "avg": 4302.103385, + "max": 5827.570565, + "med": 4275.295917, + "min": 1299.109783, + "p(90)": 5535.302326, + "p(95)": 5681.4364454999995 } }, "_api_content_node_single_texts_item": { "contains": "default", "type": "trend", "values": { - "avg": 807.5571537692306, - "max": 2996.474143, - "med": 636.39604, - "min": 45.474194, - "p(90)": 1175.1627016, - "p(95)": 1919.7981105999975 + "avg": -90908103.89624718, + "max": 3589.141484, + "med": 454.894371, + "min": -1000000000, + "p(90)": 3106.900086, + "p(95)": 3348.020785 } }, "_api_content_node_storyboards": { "contains": "default", "type": "trend", "values": { - "avg": 1526.5467385333332, - "max": 2805.308703, - "med": 1470.078597, - "min": 500.102294, - "p(90)": 2652.6750382, - "p(95)": 2796.9525734000003 + "avg": 2097.160224090909, + "max": 3100.922497, + "med": 2288.175982, + "min": 486.174279, + "p(90)": 3036.874788, + "p(95)": 3068.8986425000003 } }, "_api_content_node_storyboards_item": { "contains": "default", "type": "trend", "values": { - "avg": 869.6125727777776, - "max": 3326.254339, - "med": 384.44504, - "min": 61.743225, - "p(90)": 2100.8778718000003, - "p(95)": 2713.5661053999993 + "avg": -181817698.0051521, + "max": 1294.705599, + "med": 483.453294, + "min": -1000000000, + "p(90)": 890.021131, + "p(95)": 1092.363365 } }, "_api_content_nodes": { "contains": "default", "type": "trend", "values": { - "avg": 11509.877850836067, - "max": 23842.769024, - "med": 13791.266867, - "min": 396.931964, - "p(90)": 18064.80742, - "p(95)": 19299.655926 + "avg": 12646.263931852462, + "max": 20107.567812, + "med": 15159.489536, + "min": 383.057294, + "p(90)": 18772.950077, + "p(95)": 19166.671785 + } + }, + "_api_content_nodes_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_content_types": { "contains": "default", "type": "trend", "values": { - "avg": 638.8612655333333, - "max": 1685.506, - "med": 519.998562, - "min": 40.954297, - "p(90)": 1054.8648718, - "p(95)": 1263.9320478999994 + "avg": 818.8026850909092, + "max": 1842.400548, + "med": 520.548065, + "min": 108.556819, + "p(90)": 1507.74756, + "p(95)": 1675.0740540000002 } }, "_api_content_types_item": { "contains": "default", "type": "trend", "values": { - "avg": 737.4143689333333, - "max": 3884.639287, - "med": 399.519472, - "min": 38.497211, - "p(90)": 1131.3171372, - "p(95)": 1983.828522699997 + "avg": 311.817194909091, + "max": 504.52471, + "med": 322.779429, + "min": 106.082176, + "p(90)": 434.673193, + "p(95)": 469.5989515 } }, "_api_day_responsibles": { "contains": "default", "type": "trend", "values": { - "avg": 518.8284316666667, - "max": 2058.165119, - "med": 224.267095, - "min": 73.183762, - "p(90)": 1062.7214576, - "p(95)": 1387.3803434999988 + "avg": 705.683157090909, + "max": 2140.087628, + "med": 573.910552, + "min": 136.829194, + "p(90)": 1162.300567, + "p(95)": 1651.1940975000002 } }, "_api_day_responsibles_item": { "contains": "default", "type": "trend", "values": { - "avg": 558.8925259333333, - "max": 2078.256039, - "med": 396.660747, - "min": 35.939584, - "p(90)": 1236.8691861999998, - "p(95)": 1623.7216341999992 + "avg": 750.6482066363637, + "max": 2526.907073, + "med": 467.788709, + "min": 60.313158, + "p(90)": 1845.822713, + "p(95)": 2186.364893 } }, "_api_days": { "contains": "default", "type": "trend", "values": { - "avg": 2432.1698788666667, - "max": 4207.147683, - "med": 2980.677184, - "min": 838.39421, - "p(90)": 3352.5868246, - "p(95)": 3631.1128501999992 + "avg": 3072.6852266363635, + "max": 5730.989821, + "med": 2988.53446, + "min": 1517.020575, + "p(90)": 3867.625011, + "p(95)": 4799.307416 } }, "_api_days_item": { "contains": "default", "type": "trend", "values": { - "avg": 494.47562046666667, - "max": 1260.388001, - "med": 483.471908, - "min": 45.641602, - "p(90)": 936.9364496, - "p(95)": 1054.9265426999996 + "avg": 442.86526109090914, + "max": 1227.781307, + "med": 480.002181, + "min": 87.225287, + "p(90)": 553.03057, + "p(95)": 890.4059385 } }, "_api_invitations": { "contains": "default", "type": "trend", "values": { - "avg": 510.98144441000005, - "max": 4041.08791, - "med": 321.7490045, - "min": 76.215162, - "p(90)": 1100.3291612000007, - "p(95)": 1431.1838546499998 + "avg": 428.8643584800001, + "max": 2220.730279, + "med": 309.5659255, + "min": 34.784298, + "p(90)": 789.2337381000008, + "p(95)": 1069.7557868 + } + }, + "_api_invitations_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "_api_material_items": { "contains": "default", "type": "trend", "values": { - "avg": 3663.1448093999998, - "max": 5702.815798, - "med": 3667.294481, - "min": 1150.647747, - "p(90)": 5139.0225338, - "p(95)": 5445.799483899999 + "avg": 3347.740704909091, + "max": 4354.611092, + "med": 3274.812511, + "min": 2133.806903, + "p(90)": 4326.73716, + "p(95)": 4340.674126 } }, "_api_material_items_item": { "contains": "default", "type": "trend", "values": { - "avg": 944.2136472666666, - "max": 3504.139376, - "med": 598.448257, - "min": 39.469715, - "p(90)": 2502.2812439999993, - "p(95)": 3259.7129643999997 + "avg": 447.93050254545454, + "max": 933.249485, + "med": 378.183966, + "min": 81.511626, + "p(90)": 837.90705, + "p(95)": 885.5782675 } }, "_api_material_lists": { "contains": "default", "type": "trend", "values": { - "avg": 2025.3355919333337, - "max": 3531.136117, - "med": 2042.110835, - "min": 590.202204, - "p(90)": 3068.9691898, - "p(95)": 3216.3898151999997 + "avg": 1993.9722844545458, + "max": 3200.51142, + "med": 1843.69854, + "min": 1284.494701, + "p(90)": 3095.236406, + "p(95)": 3147.873913 } }, "_api_material_lists_item": { "contains": "default", "type": "trend", "values": { - "avg": 443.44199180000004, - "max": 1564.843189, - "med": 391.222193, - "min": 37.785308, - "p(90)": 755.5695261999999, - "p(95)": 1010.1970087999991 + "avg": 352.5665192727273, + "max": 993.762591, + "med": 259.270431, + "min": 101.579147, + "p(90)": 662.918801, + "p(95)": 828.340696 } }, "_api_periods": { "contains": "default", "type": "trend", "values": { - "avg": 485.5953614666667, - "max": 1492.607928, - "med": 321.299876, - "min": 51.127719, - "p(90)": 1044.6267748, - "p(95)": 1198.4025591999996 + "avg": 1379.5549943636363, + "max": 9632.537449, + "med": 536.079934, + "min": 133.218947, + "p(90)": 1194.193487, + "p(95)": 5413.365468 } }, "_api_periods_item": { "contains": "default", "type": "trend", "values": { - "avg": 508.1552747333333, - "max": 1182.713267, - "med": 423.750033, - "min": 65.01387, - "p(90)": 1093.1671044, - "p(95)": 1132.2256879 + "avg": 636.0823792727273, + "max": 1336.47818, + "med": 601.067674, + "min": 131.976043, + "p(90)": 901.067282, + "p(95)": 1118.772731 } }, "_api_personal_invitations": { "contains": "default", "type": "trend", "values": { - "avg": 401.68846167, - "max": 2296.938181, - "med": 316.430596, - "min": 73.64524, - "p(90)": 744.2027036000005, - "p(95)": 908.0621995 + "avg": 558.2161909400002, + "max": 2497.894973, + "med": 399.4252345, + "min": 82.799039, + "p(90)": 1251.0350002000002, + "p(95)": 1655.9311901499996 } }, "_api_personal_invitations_item": { "contains": "default", "type": "trend", "values": { - "avg": 435.19021709999987, - "max": 2513.232637, - "med": 297.62640899999997, - "min": 80.268622, - "p(90)": 868.1752073000004, - "p(95)": 1420.1195071999996 + "avg": 523.8622190900002, + "max": 4169.460419, + "med": 381.2235105, + "min": 61.702446, + "p(90)": 993.0917326000006, + "p(95)": 1428.6824797499994 } }, "_api_profiles": { "contains": "default", "type": "trend", "values": { - "avg": 546.5153629333333, - "max": 1304.812836, - "med": 445.969248, - "min": 96.685712, - "p(90)": 1028.1827899999998, - "p(95)": 1130.1731931999998 + "avg": 463.74775463636365, + "max": 1143.197088, + "med": 398.886702, + "min": 153.899878, + "p(90)": 801.431191, + "p(95)": 972.3141395 } }, "_api_profiles_item": { "contains": "default", "type": "trend", "values": { - "avg": 479.52568566666673, - "max": 2030.454989, - "med": 313.948454, - "min": 32.432281, - "p(90)": 944.2938545999999, - "p(95)": 1384.587974199999 + "avg": 416.25007409090904, + "max": 1208.825811, + "med": 292.883878, + "min": 108.820879, + "p(90)": 648.206297, + "p(95)": 928.5160539999999 } }, "_api_schedule_entries": { "contains": "default", "type": "trend", "values": { - "avg": 3780.8127758666665, - "max": 5281.385553, - "med": 4162.742584, - "min": 1488.187168, - "p(90)": 4565.6386116, - "p(95)": 4801.1221491 + "avg": 3869.8862491818177, + "max": 5108.921192, + "med": 3692.321161, + "min": 2509.059526, + "p(90)": 4780.447629, + "p(95)": 4944.6844105 } }, "_api_schedule_entries_item": { "contains": "default", "type": "trend", "values": { - "avg": 463.9364663333334, - "max": 1261.124306, - "med": 393.114615, - "min": 68.207107, - "p(90)": 754.1058068, - "p(95)": 914.2348371999994 + "avg": 324.6559731818182, + "max": 629.666354, + "med": 348.512958, + "min": 100.543918, + "p(90)": 509.065197, + "p(95)": 569.3657754999999 } }, "_api_users": { "contains": "default", "type": "trend", "values": { - "avg": 1427.5247893333333, - "max": 3037.699943, - "med": 1200.233969, - "min": 708.399203, - "p(90)": 1917.1336844, - "p(95)": 2261.048059299999 + "avg": 1132.778494818182, + "max": 1465.073227, + "med": 1170.214555, + "min": 884.806944, + "p(90)": 1390.087482, + "p(95)": 1427.5803544999999 + } + }, + "_api_users_item": { + "contains": "default", + "type": "trend", + "values": { + "avg": -1000000000, + "max": -1000000000, + "med": -1000000000, + "min": -1000000000, + "p(90)": -1000000000, + "p(95)": -1000000000 } }, "data_received": { "contains": "data", "type": "counter", "values": { - "count": 243762316, - "rate": 636278.973972607 + "count": 208856006, + "rate": 564215.7747984792 } }, "data_sent": { "contains": "data", "type": "counter", "values": { - "count": 1833101, - "rate": 4784.839767719305 + "count": 1713565, + "rate": 4629.124259622948 } }, "http_req_blocked": { "contains": "time", "type": "trend", "values": { - "avg": 0.02212960802638794, - "max": 16.457965, - "med": 0.006565, - "min": 0.003772, - "p(90)": 0.008954600000000002, - "p(95)": 0.009994999999999993 + "avg": 0.010443526377491153, + "max": 2.460709, + "med": 0.0064255, + "min": 0.00426, + "p(90)": 0.00894, + "p(95)": 0.009988 } }, "http_req_connecting": { "contains": "time", "type": "trend", "values": { - "avg": 0.007799586036283672, - "max": 4.22926, + "avg": 0.0007941266119577961, + "max": 0.577657, "med": 0, "min": 0, "p(90)": 0, @@ -632,57 +728,57 @@ "contains": "time", "type": "trend", "values": { - "avg": 2044.4413049279874, - "max": 30302.253395, - "med": 622.820094, - "min": 19.811852, - "p(90)": 4738.693915200002, - "p(95)": 10836.851380099997 + "avg": 2100.7560702596693, + "max": 27298.537974, + "med": 650.8179259999999, + "min": 22.302102, + "p(90)": 5093.6105769999995, + "p(95)": 12566.855815750001 } }, "http_req_duration{expected_response:true}": { "contains": "time", "type": "trend", "values": { - "avg": 1315.8145404588404, - "max": 13814.349528, - "med": 607.204373, - "min": 30.846822, - "p(90)": 3510.3804269000007, - "p(95)": 5773.0622399 + "avg": 1319.819711823866, + "max": 15857.761334, + "med": 622.376119, + "min": 30.206037, + "p(90)": 3388.609002, + "p(95)": 5521.9821555 } }, "http_req_failed": { "contains": "default", "type": "rate", "values": { - "fails": 1482, - "passes": 337, - "rate": 0.18526663001649257 + "fails": 1391, + "passes": 315, + "rate": 0.1846424384525205 } }, "http_req_receiving": { "contains": "time", "type": "trend", "values": { - "avg": 0.6953062083562401, - "max": 31.314619, - "med": 0.10875, - "min": 0.028636, - "p(90)": 1.0859442000000008, - "p(95)": 2.855566299999999 + "avg": 0.6175293645955446, + "max": 42.213549, + "med": 0.105255, + "min": 0.024794, + "p(90)": 0.9944, + "p(95)": 2.42123825 } }, "http_req_sending": { "contains": "time", "type": "trend", "values": { - "avg": 0.05446428752061577, - "max": 7.958742, - "med": 0.022002, - "min": 0.009988, - "p(90)": 0.038428, - "p(95)": 0.047635 + "avg": 0.052075466588511136, + "max": 6.732036, + "med": 0.0210225, + "min": 0.010336, + "p(90)": 0.0369815, + "p(95)": 0.0451895 } }, "http_req_tls_handshaking": { @@ -701,32 +797,32 @@ "contains": "time", "type": "trend", "values": { - "avg": 2043.6915344321026, - "max": 30302.156867, - "med": 622.665103, - "min": 19.680352, - "p(90)": 4713.584906000004, - "p(95)": 10836.749867499997 + "avg": 2100.0864654284856, + "max": 27298.413022, + "med": 650.735372, + "min": 22.116524, + "p(90)": 5088.098738000001, + "p(95)": 12566.7588565 } }, "http_reqs": { "contains": "default", "type": "counter", "values": { - "count": 1819, - "rate": 4.748032725682554 + "count": 1706, + "rate": 4.608687728167153 } }, "iteration_duration": { "contains": "time", "type": "trend", "values": { - "avg": 37350.77616242001, - "max": 82779.860569, - "med": 34675.388172, - "min": 17959.880297, - "p(90)": 60315.1668492, - "p(95)": 71934.44362430001 + "avg": 35975.27867414001, + "max": 86533.876241, + "med": 34404.231635000004, + "min": 14724.511359, + "p(90)": 55194.30593560001, + "p(95)": 67127.75142815 } }, "iterations": { @@ -734,19 +830,19 @@ "type": "counter", "values": { "count": 100, - "rate": 0.2610243389600085 + "rate": 0.27014582228412387 } }, "login": { "contains": "default", "type": "trend", "values": { - "avg": 997.9409991200004, - "max": 3604.53853, - "med": 841.5868175, - "min": 509.389163, - "p(90)": 1412.3664702000003, - "p(95)": 2148.1781490500002 + "avg": 1007.6077330100001, + "max": 3044.485288, + "med": 858.6340455, + "min": 501.044181, + "p(90)": 1542.0048600000002, + "p(95)": 1971.0620938999998 } }, "vus": { @@ -790,6 +886,6 @@ "state": { "isStdErrTTY": false, "isStdOutTTY": false, - "testRunDurationMs": 383106.036772 + "testRunDurationMs": 370170.447777 } } diff --git a/.ops/performance-test/script.js b/.ops/performance-test/script.js index 92fd75259d..9902e30803 100644 --- a/.ops/performance-test/script.js +++ b/.ops/performance-test/script.js @@ -60,6 +60,8 @@ export default function() { if (itemUrl) { const itemResponse = http.get(`${host}${itemUrl}.jsonhal`) metricsMap.get(`${urlWithoutTemplate}/item`)?.add(itemResponse.timings.duration) + } else { + metricsMap.get(`${urlWithoutTemplate}/item`)?.add(-1E9) } } } From 048a7f2778e3875521270a4e5826637448a7e457 Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sat, 19 Oct 2024 16:48:15 +0200 Subject: [PATCH 5/5] script.js: fix specialEndpoints be really excluded from the requests Tested against the local dev instance. --- .ops/performance-test/output.json | 782 ++++++++++++++---------------- .ops/performance-test/script.js | 28 +- 2 files changed, 377 insertions(+), 433 deletions(-) diff --git a/.ops/performance-test/output.json b/.ops/performance-test/output.json index 4e97fb5f55..b54a566596 100644 --- a/.ops/performance-test/output.json +++ b/.ops/performance-test/output.json @@ -4,12 +4,12 @@ "contains": "default", "type": "trend", "values": { - "avg": 527.4997892600003, - "max": 4136.446824, - "med": 344.323632, - "min": 64.40607, - "p(90)": 1086.9011152, - "p(95)": 1665.6265822499995 + "avg": 488.27428080999994, + "max": 787.886004, + "med": 464.5849845, + "min": 323.809102, + "p(90)": 617.7130405, + "p(95)": 686.0770987499999 } }, "_api__item": { @@ -28,648 +28,588 @@ "contains": "default", "type": "trend", "values": { - "avg": 8800.766479040003, - "max": 27298.537974, - "med": 1284.4512140000002, - "min": 391.279274, - "p(90)": 23721.92230200001, - "p(95)": 25423.76307335 + "avg": 6557.076427409998, + "max": 10062.296899, + "med": 6023.648541500001, + "min": 5310.69271, + "p(90)": 8274.809629200005, + "p(95)": 9226.332316049999 } }, "_api_activities_item": { "contains": "default", "type": "trend", "values": { - "avg": -1000000000, - "max": -1000000000, - "med": -1000000000, - "min": -1000000000, - "p(90)": -1000000000, - "p(95)": -1000000000 + "avg": 906.1673087799999, + "max": 1577.457043, + "med": 821.3326, + "min": 623.407903, + "p(90)": 1261.5599443000006, + "p(95)": 1415.9576202 } }, "_api_activity_progress_labels": { "contains": "default", "type": "trend", "values": { - "avg": 555.2684541147543, - "max": 4808.292938, - "med": 463.614346, - "min": 83.170556, - "p(90)": 822.303482, - "p(95)": 904.707295 + "avg": 556.4940495400002, + "max": 940.433305, + "med": 527.409776, + "min": 372.518734, + "p(90)": 689.2372950000001, + "p(95)": 748.8468727000001 } }, "_api_activity_progress_labels_item": { "contains": "default", "type": "trend", "values": { - "avg": 475.5558011311475, - "max": 1792.345108, - "med": 351.12257, - "min": 66.852355, - "p(90)": 911.39863, - "p(95)": 1010.594548 + "avg": 498.6723856199999, + "max": 965.198148, + "med": 469.055883, + "min": 367.944331, + "p(90)": 644.8576996000004, + "p(95)": 723.9314564 } }, "_api_activity_responsibles": { "contains": "default", "type": "trend", "values": { - "avg": 1105.4301964590165, - "max": 2522.206747, - "med": 996.667561, - "min": 599.08792, - "p(90)": 1587.269149, - "p(95)": 1884.812916 + "avg": 832.09780413, + "max": 1504.786087, + "med": 786.3558915, + "min": 635.338446, + "p(90)": 980.6277088000002, + "p(95)": 1214.9605129000001 } }, "_api_activity_responsibles_item": { "contains": "default", "type": "trend", "values": { - "avg": 486.1014467377049, - "max": 1962.582328, - "med": 363.689855, - "min": 72.714119, - "p(90)": 799.698755, - "p(95)": 1062.485492 - } - }, - "_api_authentication_token": { - "contains": "default", - "type": "trend", - "values": { - "avg": 441.74872454545454, - "max": 1211.134289, - "med": 416.831236, - "min": 22.302102, - "p(90)": 719.172437, - "p(95)": 965.153363 + "avg": 497.5865404199997, + "max": 944.223732, + "med": 470.106212, + "min": 367.971002, + "p(90)": 633.0887983, + "p(95)": 692.5035365499999 } }, "_api_camp_collaborations": { "contains": "default", "type": "trend", "values": { - "avg": 7958.618062081971, - "max": 15857.761334, - "med": 7246.395723, - "min": 5111.239378, - "p(90)": 10961.5493, - "p(95)": 13407.390658 + "avg": 2540.4398061399997, + "max": 4103.739108, + "med": 2420.600457, + "min": 1954.552684, + "p(90)": 3023.926461100003, + "p(95)": 3674.40306405 } }, "_api_camp_collaborations_item": { "contains": "default", "type": "trend", "values": { - "avg": 714.1130304262296, - "max": 1333.955421, - "med": 674.404403, - "min": 110.970282, - "p(90)": 1139.575704, - "p(95)": 1189.339789 + "avg": 582.0090920099999, + "max": 1103.180613, + "med": 557.5463045, + "min": 422.495329, + "p(90)": 714.8001973, + "p(95)": 778.8541868999998 } }, "_api_camps": { "contains": "default", "type": "trend", "values": { - "avg": 2456.602586016393, - "max": 5209.851377, - "med": 2292.731441, - "min": 756.096714, - "p(90)": 3834.214987, - "p(95)": 3986.207601 + "avg": 911.7208314200001, + "max": 1606.258161, + "med": 858.3213995, + "min": 728.741779, + "p(90)": 1160.8116515000006, + "p(95)": 1285.61101285 } }, "_api_camps_item": { "contains": "default", "type": "trend", "values": { - "avg": 747.1907217377051, - "max": 5267.43074, - "med": 587.936093, - "min": 183.641305, - "p(90)": 1349.220825, - "p(95)": 1588.293542 + "avg": 648.0463910699999, + "max": 1170.993656, + "med": 592.579705, + "min": 478.841279, + "p(90)": 902.5530084000002, + "p(95)": 984.88443945 } }, "_api_categories": { "contains": "default", "type": "trend", "values": { - "avg": 2905.403573540983, - "max": 5765.963953, - "med": 2901.081104, - "min": 196.40331, - "p(90)": 5014.737174, - "p(95)": 5224.840961 + "avg": 1504.1456050900001, + "max": 2396.414899, + "med": 1403.5349145, + "min": 1188.056941, + "p(90)": 1787.8241172000005, + "p(95)": 2194.5492987 } }, "_api_categories_item": { "contains": "default", "type": "trend", "values": { - "avg": -213114352.65941057, - "max": 1557.940897, - "med": 366.665055, - "min": -1000000000, - "p(90)": 973.465312, - "p(95)": 1069.960755 + "avg": 669.7263214499997, + "max": 1104.542898, + "med": 638.4521104999999, + "min": 502.343359, + "p(90)": 817.5193157, + "p(95)": 875.3253253500001 } }, "_api_checklist_items": { "contains": "default", "type": "trend", "values": { - "avg": 509.2287099016391, - "max": 2008.017509, - "med": 378.074791, - "min": 34.284281, - "p(90)": 1101.745692, - "p(95)": 1816.496333 + "avg": 1592.8483001199995, + "max": 2215.041318, + "med": 1549.007227, + "min": 1145.014371, + "p(90)": 1890.8339775000002, + "p(95)": 2081.1277405 } }, "_api_checklist_items_item": { "contains": "default", "type": "trend", "values": { - "avg": -1000000000, - "max": -1000000000, - "med": -1000000000, - "min": -1000000000, - "p(90)": -1000000000, - "p(95)": -1000000000 + "avg": 547.00320459, + "max": 1006.317935, + "med": 527.3450825, + "min": 426.848763, + "p(90)": 633.3295986, + "p(95)": 731.2003969499999 } }, "_api_checklists": { "contains": "default", "type": "trend", "values": { - "avg": 537.2138319508198, - "max": 2915.884962, - "med": 360.154268, - "min": 30.206037, - "p(90)": 1009.670591, - "p(95)": 1736.462526 + "avg": 499.58535931, + "max": 981.590119, + "med": 483.13010299999996, + "min": 365.542627, + "p(90)": 587.8707385, + "p(95)": 632.28984635 } }, "_api_checklists_item": { "contains": "default", "type": "trend", "values": { - "avg": -1000000000, - "max": -1000000000, - "med": -1000000000, - "min": -1000000000, - "p(90)": -1000000000, - "p(95)": -1000000000 + "avg": 487.11720286999997, + "max": 800.304469, + "med": 473.233568, + "min": 367.128559, + "p(90)": 575.2614062000001, + "p(95)": 631.5177087499999 } }, "_api_content_node_checklist_nodes": { "contains": "default", "type": "trend", "values": { - "avg": 964.3449896363637, - "max": 2004.319255, - "med": 968.973266, - "min": 496.532074, - "p(90)": 1191.119436, - "p(95)": 1597.7193455000001 + "avg": 726.1742617200002, + "max": 1281.325004, + "med": 662.169485, + "min": 530.079225, + "p(90)": 1004.9784793000001, + "p(95)": 1103.76799725 } }, "_api_content_node_checklist_nodes_item": { "contains": "default", "type": "trend", "values": { - "avg": -1000000000, - "max": -1000000000, - "med": -1000000000, - "min": -1000000000, - "p(90)": -1000000000, - "p(95)": -1000000000 + "avg": 570.5249922799999, + "max": 1064.263921, + "med": 543.3341375, + "min": 405.603277, + "p(90)": 738.5167006, + "p(95)": 782.9159225499999 } }, "_api_content_node_column_layouts": { "contains": "default", "type": "trend", "values": { - "avg": 3081.5614953636364, - "max": 5207.62519, - "med": 4045.21638, - "min": 295.868269, - "p(90)": 5078.299962, - "p(95)": 5142.962576 + "avg": 1850.674536040001, + "max": 2873.910528, + "med": 1753.9640995, + "min": 1430.839811, + "p(90)": 2411.1506716000004, + "p(95)": 2508.27258055 } }, "_api_content_node_column_layouts_item": { "contains": "default", "type": "trend", "values": { - "avg": -363636029.39295566, - "max": 1226.760026, - "med": 139.982731, - "min": -1000000000, - "p(90)": 670.816197, - "p(95)": 948.7881115 + "avg": 558.4438894499998, + "max": 963.860031, + "med": 532.6501089999999, + "min": 397.044234, + "p(90)": 709.7281732, + "p(95)": 778.1480253999999 } }, "_api_content_node_material_nodes": { "contains": "default", "type": "trend", "values": { - "avg": 6152.121571545455, - "max": 13091.05509, - "med": 5757.678854, - "min": 700.17353, - "p(90)": 12064.444703, - "p(95)": 12577.7498965 + "avg": 2182.58908281, + "max": 3964.642457, + "med": 2007.7325624999999, + "min": 1623.769258, + "p(90)": 2805.517470500001, + "p(95)": 3146.26037775 } }, "_api_content_node_material_nodes_item": { "contains": "default", "type": "trend", "values": { - "avg": -636363479.7116147, - "max": 565.409013, - "med": -1000000000, - "min": -1000000000, - "p(90)": 449.56132, - "p(95)": 507.4851665 + "avg": 598.35579744, + "max": 1170.297856, + "med": 537.0159415, + "min": 415.393528, + "p(90)": 797.0211687999999, + "p(95)": 906.3410945999998 } }, "_api_content_node_multi_selects": { "contains": "default", "type": "trend", "values": { - "avg": 740.155763, - "max": 1188.288423, - "med": 787.37743, - "min": 298.226413, - "p(90)": 1178.112303, - "p(95)": 1183.200363 + "avg": 664.3509327799999, + "max": 1157.761689, + "med": 609.3122960000001, + "min": 448.411561, + "p(90)": 939.1757029, + "p(95)": 967.6251264499998 } }, "_api_content_node_multi_selects_item": { "contains": "default", "type": "trend", "values": { - "avg": 649.7503516363637, - "max": 1378.873665, - "med": 599.154332, - "min": 107.083223, - "p(90)": 1273.315869, - "p(95)": 1326.094767 + "avg": 569.9345006300001, + "max": 1210.773925, + "med": 525.0795445, + "min": 398.326435, + "p(90)": 746.3094182000007, + "p(95)": 862.97228435 } }, "_api_content_node_responsive_layouts": { "contains": "default", "type": "trend", "values": { - "avg": 2013.7902961818183, - "max": 4253.366161, - "med": 1993.454574, - "min": 481.184087, - "p(90)": 2781.312178, - "p(95)": 3517.3391695 + "avg": 2109.8706727199997, + "max": 3557.426136, + "med": 1986.2067015, + "min": 1575.954431, + "p(90)": 2824.9436022000004, + "p(95)": 3165.0394149499994 } }, "_api_content_node_responsive_layouts_item": { "contains": "default", "type": "trend", "values": { - "avg": -90908526.30832818, - "max": 1347.097247, - "med": 407.361131, - "min": -1000000000, - "p(90)": 1231.133938, - "p(95)": 1289.1155924999998 + "avg": 578.58630467, + "max": 1169.230736, + "med": 535.5411785, + "min": 407.1835, + "p(90)": 743.1567476000001, + "p(95)": 787.0143473999998 } }, "_api_content_node_single_texts": { "contains": "default", "type": "trend", "values": { - "avg": 4302.103385, - "max": 5827.570565, - "med": 4275.295917, - "min": 1299.109783, - "p(90)": 5535.302326, - "p(95)": 5681.4364454999995 + "avg": 3167.539196309999, + "max": 5729.507143, + "med": 2926.6955525, + "min": 2225.771583, + "p(90)": 3941.4017322, + "p(95)": 4758.841461549999 } }, "_api_content_node_single_texts_item": { "contains": "default", "type": "trend", "values": { - "avg": -90908103.89624718, - "max": 3589.141484, - "med": 454.894371, - "min": -1000000000, - "p(90)": 3106.900086, - "p(95)": 3348.020785 + "avg": 540.0970207800002, + "max": 981.032144, + "med": 513.8947840000001, + "min": 395.475109, + "p(90)": 693.5529264, + "p(95)": 790.4341500999999 } }, "_api_content_node_storyboards": { "contains": "default", "type": "trend", "values": { - "avg": 2097.160224090909, - "max": 3100.922497, - "med": 2288.175982, - "min": 486.174279, - "p(90)": 3036.874788, - "p(95)": 3068.8986425000003 + "avg": 1451.5435588300002, + "max": 2630.703566, + "med": 1371.1063815, + "min": 1126.672465, + "p(90)": 1685.5240628000008, + "p(95)": 2127.81843495 } }, "_api_content_node_storyboards_item": { "contains": "default", "type": "trend", "values": { - "avg": -181817698.0051521, - "max": 1294.705599, - "med": 483.453294, - "min": -1000000000, - "p(90)": 890.021131, - "p(95)": 1092.363365 + "avg": 541.8465271499999, + "max": 986.988285, + "med": 507.981097, + "min": 398.18588, + "p(90)": 737.1021543, + "p(95)": 855.6212876499999 } }, "_api_content_nodes": { "contains": "default", "type": "trend", "values": { - "avg": 12646.263931852462, - "max": 20107.567812, - "med": 15159.489536, - "min": 383.057294, - "p(90)": 18772.950077, - "p(95)": 19166.671785 + "avg": 8393.489254430002, + "max": 10962.980875, + "med": 8010.87372, + "min": 6983.834868, + "p(90)": 10141.9909118, + "p(95)": 10334.03790815 } }, "_api_content_nodes_item": { "contains": "default", "type": "trend", "values": { - "avg": -1000000000, - "max": -1000000000, - "med": -1000000000, - "min": -1000000000, - "p(90)": -1000000000, - "p(95)": -1000000000 + "avg": 570.4918864800001, + "max": 1253.597295, + "med": 538.7556055, + "min": 366.060607, + "p(90)": 718.3874905000001, + "p(95)": 792.0832217499999 } }, "_api_content_types": { "contains": "default", "type": "trend", "values": { - "avg": 818.8026850909092, - "max": 1842.400548, - "med": 520.548065, - "min": 108.556819, - "p(90)": 1507.74756, - "p(95)": 1675.0740540000002 + "avg": 508.5987755099998, + "max": 936.643697, + "med": 480.2182045, + "min": 369.756755, + "p(90)": 636.6170878000001, + "p(95)": 749.0874198499998 } }, "_api_content_types_item": { "contains": "default", "type": "trend", "values": { - "avg": 311.817194909091, - "max": 504.52471, - "med": 322.779429, - "min": 106.082176, - "p(90)": 434.673193, - "p(95)": 469.5989515 + "avg": 460.89289515, + "max": 844.916069, + "med": 436.207495, + "min": 326.89571, + "p(90)": 625.8674076, + "p(95)": 686.3157092499999 } }, "_api_day_responsibles": { "contains": "default", "type": "trend", "values": { - "avg": 705.683157090909, - "max": 2140.087628, - "med": 573.910552, - "min": 136.829194, - "p(90)": 1162.300567, - "p(95)": 1651.1940975000002 + "avg": 546.84006597, + "max": 1121.098811, + "med": 501.814416, + "min": 414.724768, + "p(90)": 705.3546203000001, + "p(95)": 859.7345209999999 } }, "_api_day_responsibles_item": { "contains": "default", "type": "trend", "values": { - "avg": 750.6482066363637, - "max": 2526.907073, - "med": 467.788709, - "min": 60.313158, - "p(90)": 1845.822713, - "p(95)": 2186.364893 + "avg": 503.1927759599996, + "max": 1040.220349, + "med": 464.58550349999996, + "min": 388.124829, + "p(90)": 636.2367716000002, + "p(95)": 730.2877779999999 } }, "_api_days": { "contains": "default", "type": "trend", "values": { - "avg": 3072.6852266363635, - "max": 5730.989821, - "med": 2988.53446, - "min": 1517.020575, - "p(90)": 3867.625011, - "p(95)": 4799.307416 + "avg": 978.9828307600004, + "max": 1636.985002, + "med": 899.2889865, + "min": 770.737893, + "p(90)": 1273.1474576000005, + "p(95)": 1440.081991 } }, "_api_days_item": { "contains": "default", "type": "trend", "values": { - "avg": 442.86526109090914, - "max": 1227.781307, - "med": 480.002181, - "min": 87.225287, - "p(90)": 553.03057, - "p(95)": 890.4059385 - } - }, - "_api_invitations": { - "contains": "default", - "type": "trend", - "values": { - "avg": 428.8643584800001, - "max": 2220.730279, - "med": 309.5659255, - "min": 34.784298, - "p(90)": 789.2337381000008, - "p(95)": 1069.7557868 - } - }, - "_api_invitations_item": { - "contains": "default", - "type": "trend", - "values": { - "avg": -1000000000, - "max": -1000000000, - "med": -1000000000, - "min": -1000000000, - "p(90)": -1000000000, - "p(95)": -1000000000 + "avg": 531.1034528099999, + "max": 1029.620071, + "med": 481.910895, + "min": 400.864477, + "p(90)": 726.7704377, + "p(95)": 754.2964868 } }, "_api_material_items": { "contains": "default", "type": "trend", "values": { - "avg": 3347.740704909091, - "max": 4354.611092, - "med": 3274.812511, - "min": 2133.806903, - "p(90)": 4326.73716, - "p(95)": 4340.674126 + "avg": 1019.0077525399997, + "max": 1864.189813, + "med": 950.1801365, + "min": 813.321003, + "p(90)": 1332.8622496000003, + "p(95)": 1514.4386375 } }, "_api_material_items_item": { "contains": "default", "type": "trend", "values": { - "avg": 447.93050254545454, - "max": 933.249485, - "med": 378.183966, - "min": 81.511626, - "p(90)": 837.90705, - "p(95)": 885.5782675 + "avg": 524.4055443499998, + "max": 1072.994161, + "med": 482.5733, + "min": 392.772788, + "p(90)": 682.1365568000006, + "p(95)": 826.6762951499999 } }, "_api_material_lists": { "contains": "default", "type": "trend", "values": { - "avg": 1993.9722844545458, - "max": 3200.51142, - "med": 1843.69854, - "min": 1284.494701, - "p(90)": 3095.236406, - "p(95)": 3147.873913 + "avg": 869.0757912899998, + "max": 1640.870464, + "med": 807.034498, + "min": 689.898812, + "p(90)": 1122.6639294000008, + "p(95)": 1410.6409744999999 } }, "_api_material_lists_item": { "contains": "default", "type": "trend", "values": { - "avg": 352.5665192727273, - "max": 993.762591, - "med": 259.270431, - "min": 101.579147, - "p(90)": 662.918801, - "p(95)": 828.340696 + "avg": 487.75947362999983, + "max": 958.567685, + "med": 463.9601135, + "min": 396.601943, + "p(90)": 586.3380875, + "p(95)": 691.15032745 } }, "_api_periods": { "contains": "default", "type": "trend", "values": { - "avg": 1379.5549943636363, - "max": 9632.537449, - "med": 536.079934, - "min": 133.218947, - "p(90)": 1194.193487, - "p(95)": 5413.365468 + "avg": 560.8075945900001, + "max": 1112.05125, + "med": 536.1001925, + "min": 433.021283, + "p(90)": 696.4494225000002, + "p(95)": 775.40546235 } }, "_api_periods_item": { "contains": "default", "type": "trend", "values": { - "avg": 636.0823792727273, - "max": 1336.47818, - "med": 601.067674, - "min": 131.976043, - "p(90)": 901.067282, - "p(95)": 1118.772731 - } - }, - "_api_personal_invitations": { - "contains": "default", - "type": "trend", - "values": { - "avg": 558.2161909400002, - "max": 2497.894973, - "med": 399.4252345, - "min": 82.799039, - "p(90)": 1251.0350002000002, - "p(95)": 1655.9311901499996 - } - }, - "_api_personal_invitations_item": { - "contains": "default", - "type": "trend", - "values": { - "avg": 523.8622190900002, - "max": 4169.460419, - "med": 381.2235105, - "min": 61.702446, - "p(90)": 993.0917326000006, - "p(95)": 1428.6824797499994 + "avg": 586.7855616300003, + "max": 957.325919, + "med": 559.4450385, + "min": 399.386564, + "p(90)": 742.5473638999999, + "p(95)": 846.2182121 } }, "_api_profiles": { "contains": "default", "type": "trend", "values": { - "avg": 463.74775463636365, - "max": 1143.197088, - "med": 398.886702, - "min": 153.899878, - "p(90)": 801.431191, - "p(95)": 972.3141395 + "avg": 457.59432694, + "max": 793.597422, + "med": 448.7442975, + "min": 304.947034, + "p(90)": 507.5785955, + "p(95)": 544.9877706 } }, "_api_profiles_item": { "contains": "default", "type": "trend", "values": { - "avg": 416.25007409090904, - "max": 1208.825811, - "med": 292.883878, - "min": 108.820879, - "p(90)": 648.206297, - "p(95)": 928.5160539999999 + "avg": 415.85626571, + "max": 646.57896, + "med": 406.32797500000004, + "min": 293.13952, + "p(90)": 475.28536, + "p(95)": 521.0818032999999 } }, "_api_schedule_entries": { "contains": "default", "type": "trend", "values": { - "avg": 3869.8862491818177, - "max": 5108.921192, - "med": 3692.321161, - "min": 2509.059526, - "p(90)": 4780.447629, - "p(95)": 4944.6844105 + "avg": 1780.9126508900006, + "max": 3224.642282, + "med": 1684.4058375, + "min": 1127.029774, + "p(90)": 2308.6347971000005, + "p(95)": 2455.0712492499997 } }, "_api_schedule_entries_item": { "contains": "default", "type": "trend", "values": { - "avg": 324.6559731818182, - "max": 629.666354, - "med": 348.512958, - "min": 100.543918, - "p(90)": 509.065197, - "p(95)": 569.3657754999999 + "avg": 656.4876652799999, + "max": 1493.84406, + "med": 596.3231375, + "min": 405.189854, + "p(90)": 892.4058248000001, + "p(95)": 1040.68780475 } }, "_api_users": { "contains": "default", "type": "trend", "values": { - "avg": 1132.778494818182, - "max": 1465.073227, - "med": 1170.214555, - "min": 884.806944, - "p(90)": 1390.087482, - "p(95)": 1427.5803544999999 + "avg": 613.9987469300002, + "max": 1379.121119, + "med": 546.2324189999999, + "min": 385.029566, + "p(90)": 844.7093237, + "p(95)": 1016.07247825 } }, "_api_users_item": { @@ -688,36 +628,36 @@ "contains": "data", "type": "counter", "values": { - "count": 208856006, - "rate": 564215.7747984792 + "count": 239313392, + "rate": 410126.51605225337 } }, "data_sent": { "contains": "data", "type": "counter", "values": { - "count": 1713565, - "rate": 4629.124259622948 + "count": 5345100, + "rate": 9160.236385562992 } }, "http_req_blocked": { "contains": "time", "type": "trend", "values": { - "avg": 0.010443526377491153, - "max": 2.460709, - "med": 0.0064255, - "min": 0.00426, - "p(90)": 0.00894, - "p(95)": 0.009988 + "avg": 0.00458426666666666, + "max": 1.267775, + "med": 0.0036135, + "min": 0.001622, + "p(90)": 0.0053562, + "p(95)": 0.005851150000000001 } }, "http_req_connecting": { "contains": "time", "type": "trend", "values": { - "avg": 0.0007941266119577961, - "max": 0.577657, + "avg": 0.0001988278431372549, + "max": 0.178767, "med": 0, "min": 0, "p(90)": 0, @@ -728,57 +668,57 @@ "contains": "time", "type": "trend", "values": { - "avg": 2100.7560702596693, - "max": 27298.537974, - "med": 650.8179259999999, - "min": 22.302102, - "p(90)": 5093.6105769999995, - "p(95)": 12566.855815750001 + "avg": 1135.5176401225492, + "max": 10962.980875, + "med": 611.4858275, + "min": 293.13952, + "p(90)": 2133.1308368, + "p(95)": 3129.647453550003 } }, "http_req_duration{expected_response:true}": { "contains": "time", "type": "trend", "values": { - "avg": 1319.819711823866, - "max": 15857.761334, - "med": 622.376119, - "min": 30.206037, - "p(90)": 3388.609002, - "p(95)": 5521.9821555 + "avg": 1145.9480179864, + "max": 10962.980875, + "med": 615.582973, + "min": 293.13952, + "p(90)": 2154.8413615000004, + "p(95)": 3157.845091950001 } }, "http_req_failed": { "contains": "default", "type": "rate", "values": { - "fails": 1391, - "passes": 315, - "rate": 0.1846424384525205 + "fails": 5000, + "passes": 100, + "rate": 0.0196078431372549 } }, "http_req_receiving": { "contains": "time", "type": "trend", "values": { - "avg": 0.6175293645955446, - "max": 42.213549, - "med": 0.105255, - "min": 0.024794, - "p(90)": 0.9944, - "p(95)": 2.42123825 + "avg": 36.74209339196076, + "max": 2647.021729, + "med": 0.11634549999999999, + "min": 0.043173, + "p(90)": 0.5884549000000024, + "p(95)": 239.16087620000005 } }, "http_req_sending": { "contains": "time", "type": "trend", "values": { - "avg": 0.052075466588511136, - "max": 6.732036, - "med": 0.0210225, - "min": 0.010336, - "p(90)": 0.0369815, - "p(95)": 0.0451895 + "avg": 0.027501021372548937, + "max": 3.511892, + "med": 0.020097999999999998, + "min": 0.010415, + "p(90)": 0.03227990000000002, + "p(95)": 0.04031345000000001 } }, "http_req_tls_handshaking": { @@ -797,32 +737,32 @@ "contains": "time", "type": "trend", "values": { - "avg": 2100.0864654284856, - "max": 27298.413022, - "med": 650.735372, - "min": 22.116524, - "p(90)": 5088.098738000001, - "p(95)": 12566.7588565 + "avg": 1098.7480457092183, + "max": 9685.160627, + "med": 611.3387984999999, + "min": 293.061947, + "p(90)": 2110.8897091000026, + "p(95)": 2885.9391246000014 } }, "http_reqs": { "contains": "default", "type": "counter", "values": { - "count": 1706, - "rate": 4.608687728167153 + "count": 5100, + "rate": 8.740192992904017 } }, "iteration_duration": { "contains": "time", "type": "trend", "values": { - "avg": 35975.27867414001, - "max": 86533.876241, - "med": 34404.231635000004, - "min": 14724.511359, - "p(90)": 55194.30593560001, - "p(95)": 67127.75142815 + "avg": 58107.41183809001, + "max": 77456.717648, + "med": 55866.379777, + "min": 49611.588258, + "p(90)": 63792.516096500105, + "p(95)": 76081.21888005 } }, "iterations": { @@ -830,19 +770,19 @@ "type": "counter", "values": { "count": 100, - "rate": 0.27014582228412387 + "rate": 0.1713763331941964 } }, "login": { "contains": "default", "type": "trend", "values": { - "avg": 1007.6077330100001, - "max": 3044.485288, - "med": 858.6340455, - "min": 501.044181, - "p(90)": 1542.0048600000002, - "p(95)": 1971.0620938999998 + "avg": 1015.5741510099998, + "max": 1769.832939, + "med": 887.7612905, + "min": 766.118747, + "p(90)": 1545.440230300001, + "p(95)": 1695.9541498 } }, "vus": { @@ -886,6 +826,6 @@ "state": { "isStdErrTTY": false, "isStdOutTTY": false, - "testRunDurationMs": 370170.447777 + "testRunDurationMs": 583511.142619 } } diff --git a/.ops/performance-test/script.js b/.ops/performance-test/script.js index 9902e30803..ebdf50f438 100644 --- a/.ops/performance-test/script.js +++ b/.ops/performance-test/script.js @@ -14,15 +14,15 @@ const host = __ENV.API_ROOT_URL || 'http://localhost:3000' const specialEndpoints = [ '/', '/api', - '/authentication_token', - '/auth/google', - '/auth/pbsmidata', - '/auth/cevidb', - '/auth/jubladb', - '/auth/reset_password', - '/auth/resend_activation', - '/invitations', - '/personal_invitations', + '/api/authentication_token', + '/api/auth/google', + '/api/auth/pbsmidata', + '/api/auth/cevidb', + '/api/auth/jubladb', + '/api/auth/reset_password', + '/api/auth/resend_activation', + '/api/invitations', + '/api/personal_invitations' ] const metricsMap = new Map() @@ -56,11 +56,15 @@ export default function() { metricsMap.get(urlWithoutTemplate)?.add(collection.timings.duration) - const itemUrl = JSON.parse(collection.body)?._embedded?.items[0]?._links?.self?.href - if (itemUrl) { + try { + const itemUrl = JSON.parse(collection.body)._embedded?.items[0]._links.self.href const itemResponse = http.get(`${host}${itemUrl}.jsonhal`) metricsMap.get(`${urlWithoutTemplate}/item`)?.add(itemResponse.timings.duration) - } else { + } + // this also catches the ReferenceError on the long path to find the item url + catch (e) + { + console.log(`Failed to get item for url ${url}, reason: `, e) metricsMap.get(`${urlWithoutTemplate}/item`)?.add(-1E9) } }