Skip to content

Commit e9ecb2a

Browse files
committed
fix: fixed Speed Per Second items units
1 parent adb874e commit e9ecb2a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

mamonsu/lib/const.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class _template(object):
2020
VALUE_TYPE = _value_type(0, 1, 2, 3, 4)
2121
# item unit
2222
_item_type = namedtuple(
23-
'item_type', ['none', 'bytes', 's', 'ms', 'uptime', 'unixtime', 'percent'])
24-
UNITS = _item_type(None, 'b', 's', 'ms', 'uptime', 'unixtime', '%')
23+
'item_type', ['none', 'bytes', 's', 'ms', 'uptime', 'unixtime', 'percent', 'bytes_per_second'])
24+
UNITS = _item_type(None, 'b', 's', 'ms', 'uptime', 'unixtime', '%', 'Bps')
2525
# type of information
2626
_type = namedtuple(
2727
'type', ['ZABBIX_PASSIVE', 'TRAP', 'SIMPLE', 'INTERNAL', 'ZABBIX_ACTIVE',

mamonsu/plugins/pgsql/cfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ def items(self, template, dashboard=False):
9999
return template.item({
100100
'name': 'PostgreSQL cfs compression: written byte/s',
101101
'key': 'pgsql.cfs.activity[written_bytes]',
102-
'units': self.UNITS.bytes,
102+
'units': self.UNITS.bytes_per_second,
103103
'delay': self.Interval
104104
}) + template.item({
105105
'name': 'PostgreSQL cfs compression: scanned byte/s',
106106
'key': 'pgsql.cfs.activity[scanned_bytes]',
107-
'units': self.UNITS.bytes,
107+
'units': self.UNITS.bytes_per_second,
108108
'delay': self.Interval
109109
}) + template.item({
110110
'name': 'PostgreSQL cfs compression: compressed files',

mamonsu/plugins/pgsql/pg_stat_statement.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ class PgStatStatement(Plugin):
1515

1616
('stat[read_bytes]',
1717
'sum(shared_blks_read+local_blks_read+temp_blks_read)*8*1024',
18-
'read bytes/s', Plugin.UNITS.bytes, Plugin.DELTA.speed_per_second,
18+
'read bytes/s', Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second,
1919
('PostgreSQL statements: bytes', 'BBBB00', 0)),
2020
('stat[write_bytes]',
2121
'sum(shared_blks_written+local_blks_written'
2222
'+temp_blks_written)*8*1024',
23-
'write bytes/s', Plugin.UNITS.bytes, Plugin.DELTA.speed_per_second,
23+
'write bytes/s', Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second,
2424
('PostgreSQL statements: bytes', '00CC00', 0)),
2525
('stat[dirty_bytes]',
2626
'sum(shared_blks_dirtied+local_blks_dirtied)*8*1024',
27-
'dirty bytes/s', Plugin.UNITS.bytes, Plugin.DELTA.speed_per_second,
27+
'dirty bytes/s', Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second,
2828
('PostgreSQL statements: bytes', '0000CC', 0)),
2929

3030
('stat[read_time]',
@@ -45,7 +45,7 @@ class PgStatStatement(Plugin):
4545
# PostgreSQL 13 specific metrics:
4646
('stat[wal_bytes]',
4747
'sum(wal_bytes)',
48-
'amount of wal files', Plugin.UNITS.bytes, Plugin.DELTA.speed_per_second,
48+
'amount of wal files', Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second,
4949
('PostgreSQL statements: wal statistics', 'BCC000', 0)),
5050
('stat[wal_records]',
5151
'sum(wal_records)',

mamonsu/plugins/pgsql/xlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def items(self, template, dashboard=False):
124124
result += template.item({
125125
'name': 'PostgreSQL: wal write speed',
126126
'key': self.right_type(self.key_wall),
127-
'units': Plugin.UNITS.bytes,
127+
'units': Plugin.UNITS.bytes_per_second,
128128
'delay': self.plugin_config('interval'),
129129
'delta': delta
130130
}) + template.item({

0 commit comments

Comments
 (0)