Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit query duration metric #23

Open
imiric opened this issue Jul 26, 2022 · 0 comments
Open

Emit query duration metric #23

imiric opened this issue Jul 26, 2022 · 0 comments

Comments

@imiric
Copy link
Contributor

imiric commented Jul 26, 2022

The extension currently doesn't emit any SQL-specific k6 metrics. A basic one that would be useful for tracking DB performance would be query_duration. It should be possible to apply thresholds and tags per query, as mentioned in #22.

While this could be implemented in JS as shown in this example, it's a very imprecise method.

Suggested solution

Golang's database/sql doesn't seem to expose any such statistics, but there's an example here that wraps driver.Driver to calculate the value. It's essentially doing what the above JS example does, but in Go, so it's not great, but it's an improvement nonetheless.

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

No branches or pull requests

1 participant