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
244
244
else
245
245
@pg_version = Gem ::Version . new ( @pg_version . strip )
246
246
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 )
249
247
250
248
add_data! ( @result , :checkpoints , sql_query ( <<-EOS ) )
251
249
SELECT json_build_object(
@@ -314,16 +312,14 @@ ORDER BY
314
312
LIMIT 1;
315
313
EOS
316
314
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()'
319
315
add_data! ( @result , :replication_slots , sql_query ( <<-EOS ) )
320
316
SELECT json_object_agg(
321
317
slot_name,
322
318
json_build_object(
323
319
'active', active,
324
320
'xmin', xmin,
325
321
'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)
327
323
)
328
324
)
329
325
FROM
You can’t perform that action at this time.
0 commit comments