8000 refactoring: refactored Wait Sampling plugin · postgrespro/mamonsu@3172257 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3172257

Browse files
committed
refactoring: refactored Wait Sampling plugin
1 parent 1e5296d commit 3172257

File tree

1 file changed

+17
-33
lines changed

1 file changed

+17
-33
lines changed

mamonsu/plugins/pgsql/wait_sampling.py

Lines changed: 17 additions & 33 deletions
< 8000 td data-grid-cell-id="diff-16a63d58b4998c1d7c3e3f9ac9d5ca4da871b766b9ac932c56b7bff1496448e9-90-78-0" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-deletionNum-bgColor, var(--diffBlob-deletion-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">90
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@ class WaitSampling(Plugin):
99

1010
AllLockItems = [
1111
# (sql_key, zbx_key, name, color)
12-
("lwlock", "all_lock[lwlock]",
13-
"Lightweight Locks", "0000CC"),
14-
("hwlock", "all_lock[hwlock]",
15-
"Heavyweight Locks", "00CC00"),
16-
("buffer", "all_lock[buffer]",
17-
"Buffer Locks", "CC0000"),
18-
("extension", "all_lock[extension]",
19-
"Extension Locks", "8D00D9"),
20-
("client", "all_lock[client]",
21-
"Client Locks", "5CA8FF"),
22-
("other", "all_lock[other]",
23-
"Other Locks (e.g. IPC, Timeout, IO)", "B8813E")
12+
("lwlock", "all_lock[lwlock]", "Lightweight Locks", "0000CC"),
13+
("hwlock", "all_lock[hwlock]", "Heavyweight Locks", "00CC00"),
14+
("buffer", "all_lock[buffer]", "Buffer Locks", "CC0000"),
15+
("extension", "all_lock[extension]", "Extension Locks", "8D00D9"),
16+
("client", "all_lock[client]", "Client Locks", "5CA8FF"),
17+
("other", "all_lock[other]", "Other Locks (e.g. IPC, Timeout, IO)", "B8813E")
2418
]
2519
AllLockItems = [(x[0], x[1], ": " + x[2], x[3]) for x in AllLockItems]
2620

@@ -82,26 +76,16 @@ class WaitSampling(Plugin):
8276

8377
HWLockItems = [
8478
# (sql_key, zbx_key, name, color)
85-
("relation", "hwlock[relation]",
86-
"Locks on a Relation", "CC0000"),
87-
("extend", "hwlock[extend]",
88-
"Extend a Relation Locks", "00CC00"),
89-
("page", "hwlock[page]",
-
"Locks on a Page", "0000CC"),
91-
("tuple", "hwlock[tuple]",
92-
"Locks on a Tuple", "CC00CC"),
93-
("transactionid", "hwlock[transactionid]",
94-
"Transaction to Finish Locks", "000000"),
95-
("virtualxid", "hwlock[virtualxid]",
96-
"Virtual XID Locks", "CCCC00"),
97-
("speculative token", "hwlock[speculative_token]",
98-
"Speculative Insertion Locks", "777777"),
99-
("object", "hwlock[object]",
100-
"Locks on Database Object", "770000"),
101-
("userlock", "hwlock[userlock]",
102-
"Userlocks", "000077"),
103-
("advisory", "hwlock[advisory]",
104-
"Advisory User Locks", "007700")
79+
("relation", "hwlock[relation]", "Locks on a Relation", "CC0000"),
80+
("extend", "hwlock[extend]", "Extend a Relation Locks", "00CC00"),
81+
("page", "hwlock[page]", "Locks on a Page", "0000CC"),
82+
("tuple", "hwlock[tuple]", "Locks on a Tuple", "CC00CC"),
83+
("transactionid", "hwlock[transactionid]", "Transaction to Finish Locks", "000000"),
84+
("virtualxid", "hwlock[virtualxid]", "Virtual XID Locks", "CCCC00"),
85+
("speculative token", "hwlock[speculative_token]", "Speculative Insertion Locks", "777777"),
86+
("object", "hwlock[object]", "Locks on Database Object", "770000"),
87+
("userlock", "hwlock[userlock]", "Userlocks", "000077"),
88+
("advisory", "hwlock[advisory]", "Advisory User Locks", "007700")
10589
]
10690
HWLockItems = [(x[0], x[1], " HWLocks: " + x[2], x[3]) for x in HWLockItems]
10791

@@ -151,7 +135,7 @@ class WaitSampling(Plugin):
151135
("clog", "lwlock[clog]", "CLOG Access Locks", "00CC00"),
152136
("replication", "lwlock[replication]", "Replication Locks", "B8813E"),
153137
("logical_replication", "lwlock[logical_replication]", "Logical Replication Locks", "8B00C7"),
154-
("buffer", "lwlock[buffer]", "Buffer Bperations Locks", "0000CC"),
138+
("buffer", "lwlock[buffer]", "Buffer Operations Locks", "0000CC"),
155139
("other", "lwlock[other]", "Other Operations Lightweight Locks", "007700")]
156140
LWLockItems = [(x[0], x[1], " LWLocks: " + x[2], x[3]) for x in LWLockItems]
157141

0 commit comments

Comments
 (0)
0