-
Problem report
-
Resolution: Fixed
-
Major
-
6.0.23, 6.4.8, 7.0.0alpha8
-
0.4
In its current state this script will likely never produce a result for an idle query.
Currently it is considering only query_start:
age(now(), query_start)
I propose coalesce with transaction and query start times:
age(now(), coalesce( xact_start, query_start))
I have attached a fixed version, but can also do a PR if needed.
Steps to reproduce:
- run the sql script
/var/lib/zabbix/postgresql/pgsql.transactions.sql
Result:
{"idle":0,"active":0.903109,"waiting":-0.009843,"prepared":0,"xmin_age":25}Expected:
{"idle":<SOME NUMBER>,"active":0.903109,"waiting":-0.009843,"prepared":0,"xmin_age":25}