Skip to content

Commit 1e5296d

Browse files
committed
fix: formatted Wait Sampling metrics and graphs names
1 parent 419b4f0 commit 1e5296d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mamonsu/plugins/pgsql/wait_sampling.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class WaitSampling(Plugin):
2222
("other", "all_lock[other]",
2323
"Other Locks (e.g. IPC, Timeout, IO)", "B8813E")
2424
]
25+
AllLockItems = [(x[0], x[1], ": " + x[2], x[3]) for x in AllLockItems]
2526

2627
AllLockQuery = {
2728
"pg_wait_sampling":
@@ -102,6 +103,7 @@ class WaitSampling(Plugin):
102103
("advisory", "hwlock[advisory]",
103104
"Advisory User Locks", "007700")
104105
]
106+
HWLockItems = [(x[0], x[1], " HWLocks: " + x[2], x[3]) for x in HWLockItems]
105107

106108
HWLockQuery = {
107109
"pg_wait_sampling":
@@ -151,6 +153,7 @@ class WaitSampling(Plugin):
151153
("logical_replication", "lwlock[logical_replication]", "Logical Replication Locks", "8B00C7"),
152154
("buffer", "lwlock[buffer]", "Buffer Bperations Locks", "0000CC"),
153155
("other", "lwlock[other]", "Other Operations Lightweight Locks", "007700")]
156+
LWLockItems = [(x[0], x[1], " LWLocks: " + x[2], x[3]) for x in LWLockItems]
154157

155158
LWLockQuery = {
156159
"pg_wait_sampling":
@@ -283,7 +286,7 @@ def items(self, template, dashboard=False):
283286
for item in (self.AllLockItems + self.LWLockItems + self.HWLockItems):
284287
result += template.item({
285288
"key": "pgsql.{0}".format(item[1]),
286-
"name": "PostgreSQL waits: {0}".format(item[2]),
289+
"name": "PostgreSQL waits{0}".format(item[2]),
287290
"delay": self.plugin_config("interval"),
288291
"value_type": self.VALUE_TYPE.numeric_float})
289292
if not dashboard:
@@ -294,9 +297,9 @@ def items(self, template, dashboard=False):
294297
def graphs(self, template, dashboard=False):
295298
result = ""
296299
for graph_name, graph_items in [
297-
("PostgreSQL waits: Locks by type", self.AllLockItems),
298-
("PostgreSQL waits: Heavyweight locks", self.HWLockItems),
299-
("PostgreSQL waits: Lightweight locks", self.LWLockItems)]:
300+
("PostgreSQL waits: Locks by Type", self.AllLockItems),
301+
("PostgreSQL waits: Heavyweight Locks", self.HWLockItems),
302+
("PostgreSQL waits: Lightweight Locks", self.LWLockItems)]:
300303
items = []
301304
for item in graph_items:
302305
items.append({

0 commit comments

Comments
 (0)