OurBigBook logoOurBigBook Docs OurBigBook logoOurBigBook.comSite Source code
This tends to be a better good way for benchmarking than DEBUG sql:
OURBIGBOOK_LOG_DB=1 npm run dev
which sets in the Sequelize constructor:
rew Sequelize({ logging: console.log })
and produces many outputs of type:
Executed (default): SELECT 1+1 AS result Elapsed time: 0ms
so we get explicit elapsed time measurements rather than deltas, and without the corresponding Executing marker.
Furthermore, because we try to code the server correctly by making multiple async requests simultaneously wherever possible, the slowest of those requests finishes, last, and is the last "Elapsed time" to get logged! So you generally just have to look at the last logged line if there's one slow bottleneck query, rather than going over all the previous "Elapsed time" entries.
This method uses Sequelize's benchamrk: true option as per: stackoverflow.com/questions/52260934/how-to-measure-query-execution-time-in-seqilize.

Ancestors (4)

  1. Log database queries
  2. OurBigBook Web development
  3. OurBigBook Web
  4. Home