Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛(api) fix raccordementenum database type #342

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

jmaupetit
Copy link
Member

@jmaupetit jmaupetit commented Jan 15, 2025

Purpose

Mypy requires a more explict definition for Enum type fields.

The raccordementemum database type has never been fixed.

Proposal

  • use SQLModel Column(sa_type=...) to explicitly define Enum fields
  • rename raccordementemum field type to raccordementenum with an 'N' 😅 in a database migration

@jmaupetit jmaupetit self-assigned this Jan 15, 2025
@jmaupetit jmaupetit added improvement schema Discussions around data schemas API Item related to the API service labels Jan 15, 2025
Copy link

Current benchmark

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s Failures/s 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100% git timestamp version
GET /auth/whoami 4 0 340.0 475.2695747499871 2.6307380000503144 1016.5449389999708 160.0 0.4598264149538876 0.0 550 550 1000 1000 1000 1000 1000 1000 1000 1000 1000 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
POST /dynamique/session/ 6 0 140.0 164.0483723333356 17.81567900002301 479.4572549999998 45.0 0.6897396224308314 0.0 160 160 170 170 480 480 480 480 480 480 480 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
POST /dynamique/session/bulk 11 0 36.0 157.2571412727267 17.737183999997796 787.4086560000251 411.0 1.264522641123191 0.0 36 170 280 280 300 790 790 790 790 790 790 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
GET /dynamique/status/ 7 0 170.0 326.19940928571265 19.71201799995015 807.5164499999801 244.57142857142856 0.8046962261693034 0.0 170 290 800 800 810 810 810 810 810 810 810 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
POST /dynamique/status/ 9 0 29.0 155.41803777776724 12.893380999969397 833.6607680000157 45.0 1.0346094336462472 0.0 29 32 37 410 830 830 830 830 830 830 830 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3 7 0 28.0 151.72959571429243 10.885644000040884 475.3758979999816 283.0 0.8046962261693034 0.0 28 170 350 350 480 480 480 480 480 480 480 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3/history 8 0 24.0 183.5641627499953 12.198857999976552 788.4166939999773 11680.5 0.9196528299077752 0.0 31 32 550 550 790 790 790 790 790 790 790 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
POST /dynamique/status/bulk 7 0 310.0 383.3446534285778 16.073553000012453 956.7100849999974 411.0 0.8046962261693034 0.0 310 390 820 820 960 960 960 960 960 960 960 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
POST /statique/ 5 2 32.0 34.809327200014195 28.62734600000749 46.77098900003784 49.2 0.5747830186923595 0.2299132074769438 32 38 38 47 47 47 47 47 47 47 47 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
GET /statique/?limit=10 8 0 170.0 317.2089491250034 23.01302300003272 807.1884080000018 13826.0 0.9196528299077752 0.0 270 350 740 740 810 810 810 810 810 810 810 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
GET /statique/?limit=100 8 0 190.0 384.0637195000127 142.30668999999807 947.5737580000329 129006.0 0.9196528299077752 0.0 450 510 550 550 950 950 950 950 950 950 950 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
PUT /statique/FR073EP7QU5233 4 0 30.0 189.9644222500001 29.71296399999801 649.8647870000127 1371.0 0.4598264149538876 0.0 51 51 650 650 650 650 650 650 650 650 650 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
GET /statique/FRALLEGO002006P3 6 0 310.0 339.39241866665765 20.862319999992 766.7623509999544 1202.0 0.6897396224308314 0.0 340 340 400 400 770 770 770 770 770 770 770 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
POST /statique/bulk 7 0 810.0 743.4288909999996 394.0937429999849 1026.425985000003 1134.7142857142858 0.8046962261693034 0.0 810 830 1000 1000 1000 1000 1000 1000 1000 1000 1000 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0
Aggregated 97 2 160.0 281.4003171237118 2.6307380000503144 1026.425985000003 13086.505154639177 11.150790562631776 0.2299132074769438 160 340 480 550 810 950 1000 1000 1000 1000 1000 2ddf8cb 2025-01-15 16:57:19.246699+00:00 0.16.0

Comparison with the latest previous benchmark

A lower (negative) value means the current version performs better than the previous one.

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s
GET /auth/whoami
POST /dynamique/session/
POST /dynamique/session/bulk
GET /dynamique/status/
POST /dynamique/status/
GET /dynamique/status/FRALLEGO002006P3
GET /dynamique/status/FRALLEGO002006P3/history
POST /dynamique/status/bulk
POST /statique/
GET /statique/?limit=10
GET /statique/?limit=100
PUT /statique/FR073EP7QU5233
GET /statique/FRALLEGO002006P3
POST /statique/bulk
Aggregated

Copy link
Collaborator

@loco-philippe loco-philippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAS

We've cooked a database migration to for the raccordementemum Enum
migration to raccordementenum with an 'N' 😅
@jmaupetit jmaupetit force-pushed the api-fix-enum-db-values branch from c6ce14e to 6a0ccaf Compare January 16, 2025 11:07
@jmaupetit jmaupetit added bug Something isn't working and removed improvement labels Jan 16, 2025
@jmaupetit jmaupetit changed the title 🗃️(api) improve Enum management in database schema 🐛(api) fix raccordementenum database type Jan 16, 2025
Copy link

Current benchmark

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s Failures/s 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100% git timestamp version
GET /auth/whoami 31 0 150.0 302.8152700322596 2.822542999979305 1643.32564099999 160.0 1.4596579826937528 0.0 150 380 530 590 680 960 1600 1600 1600 1600 1600 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
POST /dynamique/session/ 22 0 370.0 566.5579509545415 11.766605999980584 2156.159355 45.0 1.0358863102987923 0.0 390 670 720 930 1500 1500 2200 2200 2200 2200 2200 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
POST /dynamique/session/bulk 20 0 290.0 485.9870010000037 7.604008000043905 2293.5924999999884 411.0 0.9417148275443568 0.0 380 480 770 770 1500 2300 2300 2300 2300 2300 2300 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
GET /dynamique/status/ 19 0 500.0 523.2746152105183 8.388463000017055 1609.028584999976 285.0 0.8946290861671389 0.0 500 670 770 800 970 1600 1600 1600 1600 1600 1600 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
POST /dynamique/status/ 26 0 350.0 542.5961483846147 8.79716100001815 1800.3302949999809 45.0 1.2242292758076638 0.0 390 880 920 1100 1400 1600 1800 1800 1800 1800 1800 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3 28 0 510.0 580.1759174285681 16.249804000040058 1755.168246999972 283.0 1.3184007585620994 0.0 520 720 810 940 1300 1500 1800 1800 1800 1800 1800 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3/history 20 0 570.0 639.4640737499969 9.227626999972928 1461.683086999983 41578.6 0.9417148275443568 0.0 570 970 1100 1100 1300 1500 1500 1500 1500 1500 1500 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
POST /dynamique/status/bulk 25 0 350.0 566.2757598000098 8.955769000010605 2290.65848800002 411.0 1.177143534430446 0.0 350 520 1000 1400 1400 1500 2300 2300 2300 2300 2300 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
POST /statique/ 11 4 110.0 326.32094963636604 25.654250999991746 1149.4724010000257 56.90909090909091 0.5179431551493962 0.1883429655088713 110 460 530 530 750 1100 1100 1100 1100 1100 1100 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
GET /statique/?limit=10 21 0 350.0 510.373045619041 18.29279099996484 1536.547145999975 13826.47619047619 0.9888005689215744 0.0 350 480 770 870 1300 1500 1500 1500 1500 1500 1500 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
GET /statique/?limit=100 25 0 870.0 930.2398095199987 136.9988149999699 2291.7820210000173 129006.48 1.177143534430446 0.0 870 1200 1500 1600 1800 1800 2300 2300 2300 2300 2300 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
PUT /statique/FR073EP7QU5233 24 0 350.0 535.3029065000073 39.527297000006456 1657.6123730000063 1371.0 1.130057793053228 0.0 360 480 720 740 1600 1700 1700 1700 1700 1700 1700 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
GET /statique/FRALLEGO002006P3 25 0 470.0 591.7405087200038 18.796408000014253 1518.972141000006 1202.0 1.177143534430446 0.0 470 730 770 1100 1500 1500 1500 1500 1500 1500 1500 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
POST /statique/bulk 21 0 910.0 961.5826523809552 321.2243039999976 1769.4842800000288 1127.047619047619 0.9888005689215744 0.0 910 1100 1300 1400 1500 1500 1800 1800 1800 1800 1800 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0
Aggregated 318 4 430.0 579.275109537737 2.822542999979305 2293.5924999999884 14066.955974842767 14.973265757955271 0.1883429655088713 440 720 910 1000 1500 1600 1800 2200 2300 2300 2300 86a19b9 2025-01-16 11:10:17.919245+00:00 0.16.0

Comparison with the latest previous benchmark

A lower (negative) value means the current version performs better than the previous one.

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s
GET /auth/whoami
POST /dynamique/session/
POST /dynamique/session/bulk
GET /dynamique/status/
POST /dynamique/status/
GET /dynamique/status/FRALLEGO002006P3
GET /dynamique/status/FRALLEGO002006P3/history
POST /dynamique/status/bulk
POST /statique/
GET /statique/?limit=10
GET /statique/?limit=100
PUT /statique/FR073EP7QU5233
GET /statique/FRALLEGO002006P3
POST /statique/bulk
Aggregated

@jmaupetit jmaupetit merged commit dfc5f1e into main Jan 16, 2025
15 checks passed
@jmaupetit jmaupetit deleted the api-fix-enum-db-values branch January 16, 2025 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Item related to the API service bug Something isn't working schema Discussions around data schemas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants