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.
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.
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 wrapsdriver.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.