Examples of configurations to make things easier.
This commit is contained in:
parent
1bc6306cf2
commit
c1792ef245
4 changed files with 79 additions and 8 deletions
27
config_examples/mysql_with_tunnel_config.json
Normal file
27
config_examples/mysql_with_tunnel_config.json
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"connection_details": {
|
||||||
|
"engine": "mysql",
|
||||||
|
"host": "the-actual-host",
|
||||||
|
"port": 3306,
|
||||||
|
"user": "your_user",
|
||||||
|
"password": "your_password",
|
||||||
|
"schema": "comprea",
|
||||||
|
"ssh_tunneling": {
|
||||||
|
"use_tunnel": true,
|
||||||
|
"ssh_host": "the_ssh_tunnel_host",
|
||||||
|
"ssh_username": "the_ssh_tunnel_user",
|
||||||
|
"ssh_port": 22,
|
||||||
|
"path_to_key": "G:\\path\\to\\ssh\\key.pem"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"queries_to_measure": [
|
||||||
|
{
|
||||||
|
"name": "Fast Smoke Test",
|
||||||
|
"query_string": "SELECT 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Delivered carts on a day",
|
||||||
|
"query_string": "select * from comprea.cart c where c.status = 'delivered' and c.date_delivered >= UNIX_TIMESTAMP(date('2022-05-24'))"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
22
config_examples/mysql_without_tunnel_config.json
Normal file
22
config_examples/mysql_without_tunnel_config.json
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"connection_details": {
|
||||||
|
"engine": "mysql",
|
||||||
|
"host": "the-sql-host",
|
||||||
|
"port": 3306,
|
||||||
|
"user": "your_user",
|
||||||
|
"password": "your_password",
|
||||||
|
"schema": "comprea",
|
||||||
|
"ssh_tunneling": {
|
||||||
|
"use_tunnel": false
|
||||||
|
},
|
||||||
|
"queries_to_measure": [
|
||||||
|
{
|
||||||
|
"name": "Fast Smoke Test",
|
||||||
|
"query_string": "SELECT 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Delivered carts on a day",
|
||||||
|
"query_string": "select * from comprea.cart c where c.status = 'delivered' and c.date_delivered >= UNIX_TIMESTAMP(date('2022-05-24'))"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
22
config_examples/trino_config.json
Normal file
22
config_examples/trino_config.json
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"connection_details": {
|
||||||
|
"engine": "trino",
|
||||||
|
"host": "the_trino_host",
|
||||||
|
"port": "443",
|
||||||
|
"user": "your_user",
|
||||||
|
"password": "your_password",
|
||||||
|
"http_scheme": "https",
|
||||||
|
"catalog": "app_lm_mysql",
|
||||||
|
"schema": "comprea"
|
||||||
|
},
|
||||||
|
"queries_to_measure": [
|
||||||
|
{
|
||||||
|
"name": "Fast Smoke Test",
|
||||||
|
"query_string": "SELECT * FROM system.runtime.nodes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Delivered carts on a day",
|
||||||
|
"query_string": "select * from app_lm_mysql.comprea.cart c where c.status = 'delivered' and c.date_delivered >= to_unixtime(date('2022-05-24'))"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@ several queries and measure how long it takes for results to come back to your l
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
1. First, you need to install the package in your Python installation or a virtual environment. If you have our Google
|
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:
|
Drive Shared Drive replicated locally, you can do it like this:
|
||||||
|
|
||||||
```commandline
|
```commandline
|
||||||
pip install "git+file:///g:\shared drives\data drive\90 useful\trino_query_performance_gauge@master"```
|
pip install "git+file:///g:\shared drives\data drive\90 useful\trino_query_performance_gauge@master"```
|
||||||
|
|
@ -22,16 +22,16 @@ measure_query_performance --config my_config_file.json
|
||||||
|
|
||||||
## Composing a config file
|
## Composing a config file
|
||||||
|
|
||||||
You can take a look at the `example-config.json` in this repository.
|
You can take a look at examples for different setups in `config_examples`. If you want to make a new config file, it
|
||||||
|
will probably be easier for you to start from one of those templates.
|
||||||
|
|
||||||
A few notes:
|
A few notes:
|
||||||
|
|
||||||
- The valid engines are `"trino"` and `"mysql"`.
|
- The valid engines are `"trino"` and `"mysql"`.
|
||||||
- You can place as many queries as you would like in the `queries_to_measure` list.
|
- 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
|
- 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.
|
quickly confirm that everything is set up properly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## A few more details
|
## A few more details
|
||||||
|
|
||||||
- Queries are run sequentially, as in the second query will only start after the first query is finished.
|
- Queries are run sequentially, as in the second query will only start after the first query is finished.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue