Skip to content

Commit

Permalink
V4.1.0 (#47)
Browse files Browse the repository at this point in the history
v4.1.0
  • Loading branch information
charles-001 authored Feb 8, 2024
1 parent 2a8ce21 commit 0339896
Show file tree
Hide file tree
Showing 15 changed files with 1,046 additions and 819 deletions.
122 changes: 70 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,63 +69,81 @@ positional arguments:
options:
--help show this help message and exit
-u USER, --user USER Username for MySQL
-p PASSWORD, --password PASSWORD
Password for MySQL
--ask-pass Ask for password (hidden text)
-h HOST, --host HOST Hostname/IP address for MySQL
-P PORT, --port PORT Port for MySQL (Socket has precendence)
-S SOCKET, --socket SOCKET
Socket file for MySQL
-c CONFIG_FILE, --config-file CONFIG_FILE
Config file path to use. This should use [client] section. See below for options support [default: ~/.my.cnf]
-f HOST_CACHE_FILE, --host-cache-file HOST_CACHE_FILE
-u , --user Username for MySQL
-p , --password Password for MySQL
-h , --host Hostname/IP address for MySQL
-P , --port Port for MySQL (Socket has precendence)
-S , --socket Socket file for MySQL
--config-file Dolphie's config file to use [default: ~/.dolphie]
--mycnf-file MySQL config file path to use. This should use [client] section. See below for options support [default: ~/.my.cnf]
-f , --host-cache-file
Resolve IPs to hostnames when your DNS is unable to. Each IP/hostname pair should be on its own line using format: ip=hostname [default: ~/dolphie_host_cache]
-q HOST_SETUP_FILE, --host-setup-file HOST_SETUP_FILE
-q , --host-setup-file
Specify location of file that stores the available hosts to use in host setup modal [default: ~/dolphie_hosts]
-l LOGIN_PATH, --login-path LOGIN_PATH
Specify login path to use mysql_config_editor's file ~/.mylogin.cnf for encrypted login credentials. Supercedes config file [default: client]
-r REFRESH_INTERVAL, --refresh_interval REFRESH_INTERVAL
-l , --login-path Specify login path to use mysql_config_editor's file ~/.mylogin.cnf for encrypted login credentials. Supercedes config file [default: client]
-r , --refresh_interval
How much time to wait in seconds between each refresh [default: 1]
-H HEARTBEAT_TABLE, --heartbeat-table HEARTBEAT_TABLE
-H , --heartbeat-table
If your hosts use pt-heartbeat, specify table in format db.table to use the timestamp it has for replication lag instead of Seconds_Behind_Master from SHOW SLAVE STATUS
--ssl-mode SSL_MODE Desired security state of the connection to the host. Supports: REQUIRED/VERIFY_CA/VERIFY_IDENTITY [default: OFF]
--ssl-ca SSL_CA Path to the file that contains a PEM-formatted CA certificate
--ssl-cert SSL_CERT Path to the file that contains a PEM-formatted client certificate
--ssl-key SSL_KEY Path to the file that contains a PEM-formatted private key for the client certificate
--panels STARTUP_PANELS
What panels to display on startup separated by a comma. Supports: dashboard/replication/processlist/graphs/locks [default: dashboard,processlist]
--graph-marker GRAPH_MARKER
What marker to use for graphs (available options: https://tinyurl.com/dolphie-markers) [default: braille]
--ssl-mode Desired security state of the connection to the host. Supports: REQUIRED/VERIFY_CA/VERIFY_IDENTITY [default: OFF]
--ssl-ca Path to the file that contains a PEM-formatted CA certificate
--ssl-cert Path to the file that contains a PEM-formatted client certificate
--ssl-key Path to the file that contains a PEM-formatted private key for the client certificate
--panels What panels to display on startup separated by a comma. Supports: dashboard/processlist/graphs/replication/locks/ddl [default: dashboard,processlist]
--graph-marker What marker to use for graphs (available options: https://tinyurl.com/dolphie-markers) [default: braille]
--pypi-repository What PyPi repository to use when checking for a new version. If not specified, it will use Dolphie's PyPi repository
--show-trxs-only Start with only showing threads that have an active transaction
--additional-columns Start with additional columns in Processlist panel
--use-processlist Start with using Information Schema instead of Performance Schema for processlist panel
--historical-locks Always run the locks query so it can save historical data to its graph instead of only when the Locks panel is open. This query can be expensive in some environments
-V, --version Display version and exit
Config file with [client] section supports these options:
host
user
password
port
socket
ssl_mode REQUIRED/VERIFY_CA/VERIFY_IDENTITY
ssl_ca
ssl_cert
ssl_key
MySQL my.cnf file supports these options under [client] section:
host
user
password
port
socket
ssl_mode REQUIRED/VERIFY_CA/VERIFY_IDENTITY
ssl_ca
ssl_cert
ssl_key
Login path file supports these options:
host
user
password
port
socket
host
user
password
port
socket
Environment variables support these options:
DOLPHIE_USER
DOLPHIE_PASSWORD
DOLPHIE_HOST
DOLPHIE_PORT
DOLPHIE_SOCKET
DOLPHIE_USER
DOLPHIE_PASSWORD
DOLPHIE_HOST
DOLPHIE_PORT
DOLPHIE_SOCKET
Dolphie config file supports these options under [dolphie] section:
(str) user
(str) password
(str) host
(int) port
(str) socket
(str) ssl_mode
(str) ssl_ca
(str) ssl_cert
(str) ssl_key
(str) mycnf_file
(str) login_path
(str) host_cache_file
(str) host_setup_file
(int) refresh_interval
(str) heartbeat_table
(str) startup_panels
(str) graph_marker
(str) pypi_repository
(bool) show_trxs_only
(bool) show_additional_query_columns
(bool) historical_locks
```

## Supported MySQL versions
Expand All @@ -147,15 +165,14 @@ Environment variables support these options:
6. BACKUP_ADMIN (MySQL 8 only)

## Features
- Dolphie uses panels to present groups of data. They can all be turned on/off to have a view of your database server that you prefer (see Help screenshot for panels available)
- Tabs at the top for multiple connections
- Dolphie uses panels to present groups of data. They can all be turned on/off to have a view of your database server that you prefer
- Graphs for many metrics that can give you great insight into how your database is performing
- Sparkline to show queries per second in a live view
- Quick switch host for connecting to different hosts instead of reloading the application. It keeps a history of the servers you connect to that provides autocompletion for hostnames
- Prefers Performance Schema over Processlist if it's turned on for listing queries. Can be switched to use Processlist by pressing key "1" (or using parameter) since P_S can truncate query length for explaining queries
- 3 options for finding replica lag in this order of precedence:
- 2 options for finding replica lag in this order of precedence:
- `pt-heartbeat table` (specified by `--heartbeat-table`)
- `Performance Schema` (MySQL 8 only)
- `SHOW SLAVE STATUS`
- Keeps a history of the servers you connect to that provides autocompletion for hostnames in the Host Setup modal
- Host cache file. This provides users a way to specify hostnames for IPs when their network's DNS can't resolve them. An example use case for this is when you connect to your work's VPN and DNS isn't available to resolve IPs. In my opinion, it's a lot easier to look at hostnames than IPs!
- Supports encrypted login credentials via `mysql_config_editor`
- Automatic conversion of large numbers & bytes to human-readable
Expand All @@ -167,8 +184,9 @@ Environment variables support these options:
Order of precedence for variables passed to Dolphie:
1. Command-line
2. Environment variables
3. ~/.mylogin.cnf (`mysql_config_editor`)
4. ~/.my.cnf
3. Dolphie's config file
4. ~/.mylogin.cnf (`mysql_config_editor`)
5. ~/.my.cnf

## Feedback
I welcome all questions, bug reports, and requests. If you enjoy Dolphie, please let me know! I'd love to hear from you :smiley:
13 changes: 13 additions & 0 deletions dolphie/DataTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Replica:
host: str
connection: Database = None
table: Table = None
replication_status: Dict[str, str] = None
lag_source: str = None
lag: int = None
previous_sbm: int = 0
mysql_version: str = None

Expand Down Expand Up @@ -117,3 +120,13 @@ def _get_formatted_trx_time(self, trx_time: str) -> str:

def _get_formatted_query(self, query: str) -> str:
return markup_escape(re.sub(r"\s+", " ", query)) if query else ""


class HotkeyCommands:
show_thread = "show_thread"
thread_filter = "thread_filter"
thread_kill_by_id = "thread_kill_by_id"
thread_kill_by_parameter = "thread_kill_by_parameter"
variable_search = "variable_search"
rename_tab = "rename_tab"
refresh_interval = "refresh_interval"
Loading

0 comments on commit 0339896

Please sign in to comment.