File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -244,8 +244,6 @@ module PuppetMetricsCollector
244244 else
245245 @pg_version = Gem ::Version . new ( @pg_version . strip )
246246 end
247- # Some functions and statistics views were re-named in Postgres 10.0.
248- @is_pg10 = Gem ::Requirement . new ( '>= 10.0' ) . satisfied_by? ( @pg_version )
249247
250248 add_data! ( @result , :checkpoints , sql_query ( <<-EOS ) )
251249SELECT json_build_object(
@@ -314,16 +312,14 @@ ORDER BY
314312LIMIT 1;
315313EOS
316314
317- lsn_diff = @is_pg10 ? 'pg_wal_lsn_diff' : 'pg_xlog_location_diff'
318- current_lsn = @is_pg10 ? 'pg_current_wal_lsn()' : 'pg_current_xlog_location()'
319315 add_data! ( @result , :replication_slots , sql_query ( <<-EOS ) )
320316SELECT json_object_agg(
321317 slot_name,
322318 json_build_object(
323319 'active', active,
324320 'xmin', xmin,
325321 'catalog_xmin', catalog_xmin,
326- 'lag_bytes', #{ lsn_diff } ( #{ current_lsn } , restart_lsn)
322+ 'lag_bytes', pg_wal_lsn_diff(pg_current_wal_lsn() , restart_lsn)
327323 )
328324)
329325FROM
You can’t perform that action at this time.
0 commit comments