Comments (16)
I think you should add the thread name. It is interesting to know it is a replication thread versus a regular connection.
The first filter is not obvious, if the lock was granted and is held by the thread, it is interesting to know it is holding that lock for long time (example a python notebook opening a transaction by mistake !). Maybe sort by age desc and allow to filter / sort on the table name ?
from dolphie.
@lefred please chime in :)
from dolphie.
@aadant - good idea on showing the thread name. I've added that under Thread Source
column. I'm stripping out the thread/sql
, thread/innodb
to conserve space.
As for showing all GRANTED
locks for TABLE
, I don't think that's feasible due to how many rows will be created. On my servers for instance, I can have 2,000 of them that are constantly changing each refresh interval. That isn't digestible for anyone. I don't really want to create filters for this panel as I don't think it's needed, but if you'd like to take a jab at working w/ Dolphie's code, you can. For now, I think a good compromise is to change the WHERE clause to something like this to make the panel digestible:
NOT (OBJECT_TYPE = 'TABLE' AND LOCK_STATUS = 'GRANTED' AND PROCESSLIST_TIME <= 2)
This will do what I originally wanted while showing the long-held locks like you want. Thoughts?
from dolphie.
What about grouping them by thread id and lock type, status and group concat for tables ?
from dolphie.
Not a bad idea, but Dolphie's table won't be able to show a lot of the tables concatted. I just tried doing it and GROUP_CONCAT(DISTINCT OBJECT_NAME)
had 10 tables in it. Unfortunately, that many characters doesn't play well in a terminal table.
from dolphie.
I changed the WHERE clause to this which I think limits it a bit better for filtering out spam:
NOT (
OBJECT_TYPE = 'TABLE' AND
LOCK_STATUS = 'GRANTED' AND
LOCK_TYPE LIKE 'SHARED%' AND
PROCESSLIST_TIME <= 2
) AND
I can't see a reason wanting to see any metalocks that relate to the above information below 2 seconds. Can you?
from dolphie.
@aadant - I also just added the filters that the processlist panel uses. I didn't realize how easy it'd be ;)
from dolphie.
SELECT
ANY_VALUE(OBJECT_INSTANCE_BEGIN) AS id,
OBJECT_TYPE,
ANY_VALUE(OBJECT_SCHEMA) AS OBJECT_SCHEMA,
CASE
WHEN COUNT(DISTINCT OBJECT_NAME) = 1 THEN ANY_VALUE(OBJECT_NAME)
WHEN COUNT(DISTINCT OBJECT_NAME) = 0 THEN NULL
ELSE CONCAT(COUNT(DISTINCT OBJECT_NAME), ' objects')
END AS OBJECT_NAME,
LOCK_TYPE,
LOCK_STATUS,
ANY_VALUE(SOURCE) AS CODE_SOURCE,
ANY_VALUE(NAME) AS THREAD_SOURCE,
ANY_VALUE(PROCESSLIST_ID) AS PROCESSLIST_ID,
ANY_VALUE(PROCESSLIST_USER) AS PROCESSLIST_USER,
ANY_VALUE(PROCESSLIST_TIME) AS PROCESSLIST_TIME,
ANY_VALUE(PROCESSLIST_INFO) AS PROCESSLIST_INFO
FROM
`performance_schema`.`metadata_locks` mlb JOIN
`performance_schema`.`threads` t ON mlb.OWNER_THREAD_ID = t.THREAD_ID
WHERE
NOT (
OBJECT_TYPE = 'TABLE' AND
LOCK_STATUS = 'GRANTED' AND
LOCK_TYPE LIKE 'SHARED%' AND
PROCESSLIST_TIME <= 2
) AND
OBJECT_TYPE != 'COLUMN STATISTICS'
GROUP BY
THREAD_ID,
OBJECT_TYPE,
LOCK_TYPE,
LOCK_STATUS
This seems to really cut down on garbage and from my testing, looks good.
from dolphie.
This is now in v4.3.0
from dolphie.
I see Object Name : 2 objects. No added value really :-)
If I run the query
select * from performance_schema.metadata_locks where owner_thread_id in (select thread_id from performance_schema.threads where name like '%worker%');
I can see which tables are being written by replication (maybe a different panel ?)
from dolphie.
you can use group_concat and trim it, it is better than N objects.
from dolphie.
@aadant - yes, I do that because that field will only allow one table to be listed due to space constraint. If there's only one, Dolphie will show it, but if there's more than one, it shows the count of objects as you see.
If you absolutely need to see that, then logging into a mysql client is probably best for more in-depth troubleshooting.
from dolphie.
There are several issues in this UI design
the column name should match the performance schema. Rather than hiding information or tranform it you should display it. Maybe increase the column or just allow duplicates for the same thread (same color per thread id) with a filter to display replication threads only.
this is particularly useful to track metadata locks
from dolphie.
I mean filter by thread name, table name
from dolphie.
I've updated the datatable to now GROUP_CONCAT
the values for object_name
and list each of them on a new line for the row with a set height. This lets me be able to populate only 1 row, but with multiple lines for the object_name
so the datable isn't filled with the same text for each row except the object_name
. I also made the datatable zebra-striped so it's easier to read. I'll look to release this change in the next release which will probably be on Sunday night.
In the meantime, if you want to test this change @aadant, you can by cloning this repo, running poetry install
, then poetry run dolphie
from dolphie.
I've pushed the new version out @aadant so you won't need to run it via poetry to test my changes.
from dolphie.
Related Issues (20)
- Error after click on AHI Tab (Dolphie v3.1.2) HOT 3
- Command 'u' not working for Percona Server 5.6 (Unknown system variable 'default_password_lifetime') HOT 1
- Access denied; you need (at least one of) the PROCESS privilege(s) for this operation HOT 3
- Dolphie Issue with MySQL Aurora on 3.04.0 with Backup_Admin Privilege Needed HOT 3
- 3.1.4 regression test failure HOT 5
- Usage of youtube-dl/video extras HOT 1
- query body looks like 䕓䕌呃⨠䘠佒⁍瑠汢灟祡敭瑮江獩恴怠恴 HOT 5
- View "sys.innodb_lock_waits" references invalid table(s) or column(s) HOT 3
- is sys.innodb_lock_waits safe to run in production on a busy system ? HOT 16
- Query PyPI API to get the latest version - enable config bypass HOT 8
- feat request: PostgreSQL support HOT 1
- Default config location HOT 4
- TypeError: 'type' object is not subscriptable HOT 3
- IndexError: tuple index out of range HOT 2
- AttributeError: 'Dolphie' object has no attribute 'notify' HOT 5
- MariaDB issue HOT 7
- Display details of thread crashes HOT 12
- How i can did sparklines in textual like you? HOT 1
- Dolphie 5.0.2 with MariaDB 10.3 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dolphie.