bin/metric-postgres-graphite.rb in sensu-plugins-postgres-0.0.3 vs bin/metric-postgres-graphite.rb in sensu-plugins-postgres-0.0.4
- old
+ new
@@ -50,10 +50,10 @@
conn_master = PGconn.connect(@dbmaster, @dbport, '', '', @dbname, @dbusername, @password)
res1 = conn_master.exec('SELECT pg_current_xlog_location()').getvalue(0, 0)
m_segbytes = conn_master.exec('SHOW wal_segment_size').getvalue(0, 0).sub(/\D+/, '').to_i << 20
conn_master.close
- def lag_compute(res1, res, m_segbytes)
+ def lag_compute(res1, res, m_segbytes) # rubocop:disable NestedMethodDefinition
m_segment, m_offset = res1.split(/\//)
s_segment, s_offset = res.split(/\//)
((m_segment.hex - s_segment.hex) * m_segbytes) + (m_offset.hex - s_offset.hex)
end