ploomber / jupysql

Better SQL in Jupyter. 📊
https://jupysql.ploomber.io
Apache License 2.0
705 stars 75 forks source link

Output Queries-per-Second metric #997

Open flaviomartins opened 6 months ago

flaviomartins commented 6 months ago

What happens?

Every so often when working with a SQL Cell in Jupyterlab I wish to know the estimated QPS for that query formulation.

To Reproduce

It is difficult to do it using %%timeit since there is not easy way to %%capture the output and process it.

OS:

macOS

JupySQL Version:

0.10.9

Full Name:

Flavio Martins

Affiliation:

Instituto Superior Técnico

flaviomartins commented 6 months ago

I am wondering if jupysql could even parse the output of EXPLAIN for this, but here is a reference for a kernel agnostic option that considers the whole cell execution-time https://github.com/deshaw/jupyterlab-execute-time/issues/115

edublancas commented 6 months ago

I am wondering if jupysql could even parse the output of EXPLAIN for this, but here is a reference for a kernel agnostic option that considers the whole cell execution-time https://github.com/deshaw/jupyterlab-execute-time/issues/115

seems like the execute-time extension already gives what you're looking for right? is anything missing?

flaviomartins commented 6 months ago

execute-time displays the total elapsed time for the execution of the cell e.g., 20ms. I think displaying how many times this can be executed in a second makes sense: 1000/20 = 50 QPS

edublancas commented 6 months ago

Got it. I think it'd be relatively simple to add this. Unfortunately, the team is pretty time-constrained, but if you'd like to give it a try, that'd be great!