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

Préavis - Ajouter un debounce dans les filtres de la liste des préavis #3773

Open
louptheron opened this issue Oct 16, 2024 · 0 comments · Fixed by #3780
Open

Préavis - Ajouter un debounce dans les filtres de la liste des préavis #3773

louptheron opened this issue Oct 16, 2024 · 0 comments · Fixed by #3780
Assignees
Labels
dev feat. enhancement feature enhancement

Comments

@louptheron
Copy link
Collaborator

louptheron commented Oct 16, 2024

Constat

La requête logbookReportRepository.findAllPriorNotifications() est la plus lente, analyse sur 7 jours (9624 requêtes) en PROD.

  • 42 fois au-dessus de 10 secondes (1 fois sur 230)
  • 200 fois entre 5 et 10 secondes (1 fois sur 50)
  • 766 fois entre 2 et 5 secondes (1 fois sur 13)
  • 1067 fois à 1 secondes (1 fois sur 10)
  • Le reste est en-dessous de 1 seconde

Problème

Une des causes de l'augmentation de temps de requête c'est la fréquence très rapprochée d'envois de requêtes, et donc un flood de la DB.

Par exemple, ici un navire recherché qui déclenche 5 requêtes dans la même seconde.

  • Oct 14, 2024 @ 08:08:18.549

REQUEST GET /bff/v1/prior_notifications?pageNumber=0&pageSize=50&seafrontGroup=ALL&searchQuery=ILE BOURBON&sortColumn=EXPECTED_ARRIVAL_DATE&sortDirection=DESC&willArriveAfter=2024-10-14T08:08:07.364Z&willArriveBefore=2024-10-14T12:08:07.364Z

  • Oct 14, 2024 @ 08:08:18.508

REQUEST GET /bff/v1/prior_notifications?pageNumber=0&pageSize=50&seafrontGroup=ALL&searchQuery=ILE BOURBO&sortColumn=EXPECTED_ARRIVAL_DATE&sortDirection=DESC&willArriveAfter=2024-10-14T08:08:07.274Z&willArriveBefore=2024-10-14T12:08:07.274Z

  • Oct 14, 2024 @ 08:08:18.339

REQUEST GET /bff/v1/prior_notifications?pageNumber=0&pageSize=50&seafrontGroup=ALL&searchQuery=ILE BOURB&sortColumn=EXPECTED_ARRIVAL_DATE&sortDirection=DESC&willArriveAfter=2024-10-14T08:08:07.094Z&willArriveBefore=2024-10-14T12:08:07.094Z

  • Oct 14, 2024 @ 08:08:18.235

REQUEST GET /bff/v1/prior_notifications?pageNumber=0&pageSize=50&seafrontGroup=ALL&searchQuery=ILE BOUR&sortColumn=EXPECTED_ARRIVAL_DATE&sortDirection=DESC&willArriveAfter=2024-10-14T08:08:06.762Z&willArriveBefore=2024-10-14T12:08:06.762Z

  • Oct 14, 2024 @ 08:08:17.258

REQUEST GET /bff/v1/prior_notifications?pageNumber=0&pageSize=50&seafrontGroup=ALL&searchQuery=ILE BOU&sortColumn=EXPECTED_ARRIVAL_DATE&sortDirection=DESC&willArriveAfter=2024-10-14T08:08:06.621Z&willArriveBefore=2024-10-14T12:08:06.621Z
Ici on a 5 requêtes à quelques ms d'intervalle, lorsque l'utilisateur filtre avec un navire.

Solution

Ajouter un debounce dans :

  • la recherche par navire des préavis
  • dans les autres filtres (si c'est faisable rapidement)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev feat. enhancement feature enhancement
Projects
Status: In progress
2 participants