-
Notifications
You must be signed in to change notification settings - Fork 29
[MO] How to log your queries duration with Knex #147
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blabla ? ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blabla ? :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahah j'ai oublié de clean mon template
@@ -118,6 +118,7 @@ | |||
- [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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blabla ? :-D
|
||
knex | ||
.on('query', query => { | ||
times[uid] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A mettre ici now : https://m33.gitbook.io/standards/technical-gesture/performance
No description provided.