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

Closed
louptheron opened this issue Oct 16, 2024 · 0 comments · Fixed by #3780 or #3986
Closed

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 or #3986
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)
@louptheron louptheron moved this to Backlog in Board MonitorFish Oct 16, 2024
@louptheron louptheron added feat. enhancement feature enhancement dev labels Oct 16, 2024
@ivangabriele ivangabriele moved this from Backlog to In progress in Board MonitorFish Oct 18, 2024
@ivangabriele ivangabriele moved this from In progress to In Code Review in Board MonitorFish Oct 18, 2024
@github-project-automation github-project-automation bot moved this from In Code Review to To deploy in INT for review in Board MonitorFish Oct 18, 2024
@louptheron louptheron moved this from To deploy in INT for review to To review in INT in Board MonitorFish Oct 28, 2024
@louptheron louptheron reopened this Oct 28, 2024
@github-project-automation github-project-automation bot moved this from To do to In progress in Board MonitorFish Oct 28, 2024
@ivangabriele ivangabriele removed their assignment Nov 29, 2024
@louptheron louptheron self-assigned this Dec 5, 2024
@louptheron louptheron moved this from To do to Backlog in Board MonitorFish Dec 19, 2024
@github-project-automation github-project-automation bot moved this from Backlog to To deploy in INT for review in Board MonitorFish Dec 20, 2024
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: To deploy in INT for review
2 participants