Skip to content

Commit

Permalink
v4.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-001 committed Feb 29, 2024
1 parent e0cb5ad commit 7b76932
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions dolphie/DataTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def __init__(self, thread_data: Dict[str, str]):
self.db = thread_data.get("db", "")
self.query = thread_data.get("query", "")
self.time = int(thread_data.get("time", 0))
self.protocol = self._get_formatted_string(thread_data.get("connection_type", ""))
self.formatted_query = self._get_formatted_query(thread_data.get("query", ""))
self.formatted_time = self._get_formatted_time()
self.command = self._get_formatted_command(thread_data.get("command", ""))
Expand Down
2 changes: 1 addition & 1 deletion dolphie/Modules/ArgumentParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def _parse(self):

if not hosts:
self.exit(
f"Hostgroup [red2]{hostgroup}[/red2] cannot be loaded because"
f"{config_file}: Hostgroup [red2]{hostgroup}[/red2] cannot be loaded because"
f" it doesn't have any hosts listed under its section in Dolphie's config"
)

Expand Down
8 changes: 4 additions & 4 deletions dolphie/Modules/MySQL.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def __init__(
self.ssl = ssl
self.save_connection_id = save_connection_id

self.max_reconnect_attempts = 3
self.running_query = False
self.using_ssl = False
self.max_reconnect_attempts: int = 3
self.running_query: bool = False
self.using_ssl: str = None

if auto_connect:
self.connect()
Expand All @@ -58,7 +58,7 @@ def connect(self):
if self.save_connection_id:
self.connection_id = self.fetch_value_from_field("SELECT CONNECTION_ID()")

# Check if SSL is being used
# Determine if SSL is being used
self.using_ssl = "ON" if self.fetch_value_from_field("SHOW STATUS LIKE 'Ssl_cipher'", "Value") else "OFF"

except pymysql.Error as e:
Expand Down
6 changes: 4 additions & 2 deletions dolphie/Modules/Queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class MySQLQueries:
IFNULL(trx_rows_locked, "0") AS trx_rows_locked,
IFNULL(trx_rows_modified, "0") AS trx_rows_modified,
IFNULL(trx_concurrency_tickets, "") AS trx_concurrency_tickets,
IFNULL(TIMESTAMPDIFF(SECOND, trx_started, NOW()), "") AS trx_time
IFNULL(TIMESTAMPDIFF(SECOND, trx_started, NOW()), "") AS trx_time,
"" AS connection_type
FROM
information_schema.PROCESSLIST pl
LEFT JOIN information_schema.innodb_trx ON trx_mysql_thread_id = pl.Id
Expand All @@ -44,7 +45,8 @@ class MySQLQueries:
IFNULL(trx_rows_locked, "0") AS trx_rows_locked,
IFNULL(trx_rows_modified, "0") AS trx_rows_modified,
IFNULL(trx_concurrency_tickets, "") AS trx_concurrency_tickets,
IFNULL(TIMESTAMPDIFF(SECOND, trx_started, NOW()), "") AS trx_time
IFNULL(TIMESTAMPDIFF(SECOND, trx_started, NOW()), "") AS trx_time,
IFNULL(connection_type, "") AS connection_type
FROM
performance_schema.threads t
LEFT JOIN information_schema.innodb_trx tx ON trx_mysql_thread_id = t.processlist_id
Expand Down
3 changes: 2 additions & 1 deletion dolphie/Modules/TabManager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
from dataclasses import dataclass
from typing import List

import dolphie.Modules.MetricManager as MetricManager
from dolphie import Dolphie
Expand Down Expand Up @@ -457,7 +458,7 @@ def get_tab(self, id: int) -> Tab:
if id in self.tabs:
return self.tabs[id]

def get_all_tabs(self) -> list[Tab]:
def get_all_tabs(self) -> List[Tab]:
all_tabs = []

for tab in self.tabs.values():
Expand Down
1 change: 1 addition & 0 deletions dolphie/Panels/processlist_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def create_panel(tab: Tab) -> DataTable:

columns = [
{"name": "Process ID", "field": "id", "width": 11, "format_number": False},
{"name": "Protocol", "field": "protocol", "width": 8, "format_number": False},
{"name": "Username", "field": "user", "width": 20, "format_number": False},
]

Expand Down
4 changes: 4 additions & 0 deletions dolphie/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,10 @@ def execute_kill(thread_id):

thread_id = additional_data
thread_data: ProcesslistThread = dolphie.processlist_threads_snapshot.get(thread_id)
if not thread_data:
self.notify(f"Thread ID [highlight]{thread_id}[/highlight] was not found", severity="error")
return

thread_table.add_row("[label]Thread ID", thread_id)
thread_table.add_row("[label]User", thread_data.user)
thread_table.add_row("[label]Host", thread_data.host)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dolphie"
version = "4.3.1"
version = "4.3.2"
license = "GPL-3.0-or-later"
description = "Echolocate your MySQL health with real-time monitoring in the terminal"
authors = ["Charles Thompson <[email protected]>"]
Expand Down

0 comments on commit 7b76932

Please sign in to comment.