@@ -22,6 +22,7 @@ class WaitSampling(Plugin):
22
22
("other" , "all_lock[other]" ,
23
23
"Other Locks (e.g. IPC, Timeout, IO)" , "B8813E" )
24
24
]
25
+ AllLockItems = [(x [0 ], x [1 ], ": " + x [2 ], x [3 ]) for x in AllLockItems ]
25
26
26
27
AllLockQuery = {
27
28
"pg_wait_sampling" :
@@ -102,6 +103,7 @@ class WaitSampling(Plugin):
102
103
("advisory" , "hwlock[advisory]" ,
103
104
"Advisory User Locks" , "007700" )
104
105
]
106
+ HWLockItems = [(x [0 ], x [1 ], " HWLocks: " + x [2 ], x [3 ]) for x in HWLockItems ]
105
107
106
108
HWLockQuery = {
107
109
"pg_wait_sampling" :
@@ -151,6 +153,7 @@ class WaitSampling(Plugin):
151
153
("logical_replication" , "lwlock[logical_replication]" , "Logical Replication Locks" , "8B00C7" ),
152
154
("buffer" , "lwlock[buffer]" , "Buffer Bperations Locks" , "0000CC" ),
153
155
("other" , "lwlock[other]" , "Other Operations Lightweight Locks" , "007700" )]
156
+ LWLockItems = [(x [0 ], x [1 ], " LWLocks: " + x [2 ], x [3 ]) for x in LWLockItems ]
154
157
155
158
LWLockQuery = {
156
159
"pg_wait_sampling" :
@@ -283,7 +286,7 @@ def items(self, template, dashboard=False):
283
286
for item in (self .AllLockItems + self .LWLockItems + self .HWLockItems ):
284
287
result += template .item ({
285
288
"key" : "pgsql.{0}" .format (item [1 ]),
286
- "name" : "PostgreSQL waits: {0}" .format (item [2 ]),
289
+ "name" : "PostgreSQL waits{0}" .format (item [2 ]),
287
290
"delay" : self .plugin_config ("interval" ),
288
291
"value_type" : self .VALUE_TYPE .numeric_float })
289
292
if not dashboard :
@@ -294,9 +297,9 @@ def items(self, template, dashboard=False):
294
297
def graphs (self , template , dashboard = False ):
295
298
result = ""
296
299
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 )]:
300
303
items = []
301
304
for item in graph_items :
302
305
items .append ({
0 commit comments