python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

Fixed regex of WalSegmentStats #573

Closed sw0x2A closed 7 years ago

sw0x2A commented 7 years ago

Regex pattern '^[0-9A-Z]{{24}}\$' is causing the following warning and result of query is always 0 on at least Postgresql 9.4-9.6.

HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING:  nonstandard use of escape in a string literal at character 97

This change fixes the query. AFAICS this fix should not break with earlier versions of Postgresql but I could not test it.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 59.729% when pulling 52bc583888d92df966383867866297e5ac8f2043 on sw0x2A:patch-1 into f4a523fb92526659798e61cc334cc8e0ee8d635a on python-diamond:master.