sidorares / sidorares/node-mysql2

How can I measure query `queue_wait` time?

Open
#2,979 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

How can I measure the time a query spends waiting in the connection pool queue when using the waitForConnections: true option in a connection pool?

I'm looking for to somehow do this:

const [result, meta] = await pool.query("SELECT * FROM ......")
console.lg(meta.queteWait) // if this value if bigger than 0, it means this query waited for a connection before being executed in mysql server.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by tracing pool.query with waitForConnections enabled through the connection-pool entry points, then determine where queue-wait timing could be exposed and how it should be verified; done means callers can reliably measure time spent waiting before execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, nodejs, typescript
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.