Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

[MO] How to log your queries duration with Knex #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeRenouvin
Copy link
Contributor

No description provided.

@bam-bot-tech
Copy link

Warnings
⚠️

log-queries-durations-with-knex.mo.md: Seems you do not need a Troubleshoot part

⚠️

log-queries-durations-with-knex.mo.md: Does not seem to be included in the root readme

Automatic reviewers

cc: @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
Copy link
Contributor

Choose a reason for hiding this comment

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

blabla ? ^^

Copy link
Contributor

Choose a reason for hiding this comment

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

blabla ? :-D

Copy link
Contributor Author

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)
Copy link
Contributor

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
Copy link
Contributor

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] = {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

Copy link
Contributor

@xavierlefevre xavierlefevre left a comment

Choose a reason for hiding this comment

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants