[MO] How to log your queries duration with Knex#147
[MO] How to log your queries duration with Knex#147GuillaumeRenouvin wants to merge 2 commits intomasterfrom
Conversation
Automatic reviewerscc: @louiszawadzki, @tychota Generated by 🚫 dangerJS |
| > Check: Launch your server, call an API route and you should see your queries on the logs | ||
|
|
||
| ### Log query duration (~5min) | ||
| - Blabla |
There was a problem hiding this comment.
Ahah j'ai oublié de clean mon template
| - [1. Cache your routes using varnish](/performance/backend/cache-routes-using-varnish.mo.md) | ||
| - [2. Serve images as static files](/performance/backend/serve-images-as-static-files.mo) | ||
| - [3. Minimize your number of SQL queries](/performance/backend/minimize-number-sql-queries.mo.md) | ||
| - [4. Log queries durations with Knex](/performance/backend/log-queries-durations-with-knex.mo.md) |
There was a problem hiding this comment.
Hummm... je viens de voir que les titres ne sont pas claires, mais le but de cette partie du sommaire, c'est de donner des tips de solutions technique.
Il faut surtout ajouter ton article ici : https://github.com/bamlab/dev-standards/edit/master/performance/performance-decision-flow.s.md
Le sommaire principal !! :-)
Ton outil est un outil d'investigation, il est plus adapté à la 1ere partie des standards perf:
| > Check: Launch your server, call an API route and you should see your queries on the logs | ||
|
|
||
| ### Log query duration (~5min) | ||
| - Blabla |
|
|
||
| knex | ||
| .on('query', query => { | ||
| times[uid] = { |
There was a problem hiding this comment.
- times c'est une variable quelconque instanciée avant ?
- d'où vient uid ?
- pourquoi garder "query" dans times ?
There was a problem hiding this comment.
My bad, times c'était une typo de copier/coller
Pour query, c'est pour afficher la query sql et les paramètres en plus de la durée
xavierlefevre
left a comment
There was a problem hiding this comment.
A mettre ici now : https://m33.gitbook.io/standards/technical-gesture/performance
No description provided.