Skip to content

Commit bca2a28

Browse files
committed
fix: fixed Cache Hit Ratio and Sync Duty formula syntax
1 parent 4ee0064 commit bca2a28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mamonsu/plugins/pgsql/health.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def items(self, template, dashboard=False):
4141
}) + template.item({
4242
'name': 'PostgreSQL: cache hit ratio',
4343
'key': self.right_type(self.key_cache, "hit"),
44-
'value_type': value_type,
44+
'value_type': Plugin.VALUE_TYPE.numeric_float,
4545
'units': Plugin.UNITS.percent,
4646
'type': Plugin.TYPE.CALCULATED,
47-
'params': "last(//pgsql.blocks[hit])*100/(last(//pgsql.blocks[hit])+last(//pgsql.blocks[read]))"
47+
'params': "last(pgsql.blocks[hit])*100/(last(pgsql.blocks[hit])+last(pgsql.blocks[read]))"
4848
}) + template.item({
4949
'name': 'PostgreSQL: service uptime',
5050
'key': self.right_type(self.key_uptime),

mamonsu/plugins/pgsql/xlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def items(self, template, dashboard=False):
182182
'value_type': Plugin.VALUE_TYPE.numeric_float,
183183
'units': Plugin.UNITS.percent,
184184
'type': Plugin.TYPE.CALCULATED,
185-
'params': "last(//" + self.key_wal_sync_time + ")/10/" + self.plugin_config('interval')
185+
'params': "last(" + self.key_wal_sync_time + ")/10/" + self.plugin_config('interval')
186186
})
187187
if not dashboard:
188188
return result

0 commit comments

Comments
 (0)