Skip to content

Commit 9866720

Browse files
committed
fix: fixed WAL metrics delta and value type (switched to speed float metrics)
1 parent d0f34be commit 9866720

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mamonsu/plugins/pgsql/wal.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ def run(self, zbx):
6464
result = Pooler.query("""
6565
SELECT wal_records FROM pg_stat_wal;
6666
""")
67-
zbx.send(self.key_wal_records.format("[]"), int(result[0][0]))
67+
zbx.send(self.key_wal_records.format("[]"), int(result[0][0]), self.DELTA_SPEED)
6868
result = Pooler.query("""
6969
SELECT wal_fpi FROM pg_stat_wal;
7070
""")
71-
zbx.send(self.key_wal_fpi.format("[]"), int(result[0][0]))
71+
zbx.send(self.key_wal_fpi.format("[]"), int(result[0][0]), self.DELTA_SPEED)
7272
result = Pooler.query("""
7373
SELECT wal_buffers_full FROM pg_stat_wal;
7474
""")
75-
zbx.send(self.key_wal_buffers_full.format("[]"), int(result[0][0]))
75+
zbx.send(self.key_wal_buffers_full.format("[]"), int(result[0][0]), self.DELTA_SPEED)
7676
result = Pooler.query("""
7777
SELECT wal_write_time FROM pg_stat_wal;
7878
""")
79-
zbx.send(self.key_wal_write_time.format("[]"), int(result[0][0]))
79+
zbx.send(self.key_wal_write_time.format("[]"), int(result[0][0]), self.DELTA_SPEED)
8080
result = Pooler.query("""
8181
SELECT wal_sync_time FROM pg_stat_wal;
8282
""")
83-
zbx.send(self.key_wal_sync_time.format("[]"), int(result[0][0]))
83+
zbx.send(self.key_wal_sync_time.format("[]"), int(result[0][0]), self.DELTA_SPEED)
8484

8585
def items(self, template, dashboard=False):
8686
result = ""
@@ -101,27 +101,27 @@ def items(self, template, dashboard=False):
101101
}) + template.item({
102102
"name": "PostgreSQL WAL: Records Generated",
103103
"key": self.right_type(self.key_wal_records),
104-
"value_type": self.VALUE_TYPE.numeric_unsigned,
104+
"value_type": self.VALUE_TYPE.numeric_float,
105105
"delta": delta,
106106
}) + template.item({
107107
"name": "PostgreSQL WAL: Full Page Images Generated",
108108
"key": self.right_type(self.key_wal_fpi),
109-
"value_type": self.VALUE_TYPE.numeric_unsigned,
109+
"value_type": self.VALUE_TYPE.numeric_float,
110110
"delta": delta,
111111
}) + template.item({
112112
"name": "PostgreSQL WAL: Buffers Full",
113113
"key": self.key_wal_buffers_full,
114-
"value_type": self.VALUE_TYPE.numeric_unsigned,
114+
"value_type": self.VALUE_TYPE.numeric_float,
115115
"delta": delta,
116116
}) + template.item({
117117
"name": "PostgreSQL WAL: Write Time (ms)",
118118
"key": self.key_wal_write_time,
119-
"value_type": self.VALUE_TYPE.numeric_unsigned,
119+
"value_type": self.VALUE_TYPE.numeric_float,
120120
"delta": delta,
121121
}) + template.item({
122122
"name": "PostgreSQL WAL: Sync Time (ms)",
123123
"key": self.key_wal_sync_time,
124-
"value_type": self.VALUE_TYPE.numeric_unsigned,
124+
"value_type": self.VALUE_TYPE.numeric_float,
125125
"delta": delta,
126126
}) + template.item({
127127
"name": "PostgreSQL WAL: Sync Duty (%)",

0 commit comments

Comments
 (0)