No description
Find a file
2022-07-21 18:30:10 +02:00
.gitignore Initial commit. 2022-07-21 11:56:41 +02:00
cli.py Docstrings, typing, a bit of renaming and minor stuff. 2022-07-21 12:24:35 +02:00
connections.py Created singleton for opening and closing SSH tunnel. 2022-07-21 18:30:10 +02:00
example-config.json Initial commit. 2022-07-21 11:56:41 +02:00
query_performance_gauge.py Docstrings, typing, a bit of renaming and minor stuff. 2022-07-21 12:24:35 +02:00
readme.md Fixed install command and quickstart example in readme.md 2022-07-21 14:17:07 +02:00
requirements.txt Added requirements for SSH tunneling. 2022-07-21 15:04:58 +02:00
setup.py Now including version. 2022-07-21 14:16:41 +02:00

Query Performance Gauge

This is a little script to measure the performance of queries against a Trino or MySQL instance. You can use it to run several queries and measure how long it takes for results to come back to your local machine.

How to use

  1. First, you need to install the package in your Python installation or a virtual environment. If you have our Google Drive Shared Drive replicated locally, you can do it like this:
pip install "git+file:///g:\shared drives\data drive\90 useful\trino_query_performance_gauge@master"```
  1. After, you need to make a config file. See below details on how to compose one.

  2. Once you have your config file ready, run the following command from the terminal.

measure_query_performance --config my_config_file.json

Composing a config file

You can take a look at the example-config.json in this repository.

A few notes:

  • The valid engines are "trino" and "mysql".
  • You can place as many queries as you would like in the queries_to_measure list.
  • I advice you to make the first query a silly, fast query such as SELECT 1 to validate your connection and quickly confirm that everything is set up properly.

A few more details

  • Queries are run sequentially, as in the second query will only start after the first query is finished.
  • For this to work, your local machine must have access and permission to the connection you are targeting, so remember to set up VPNs and other necessary configs properly.