Skip to content

Instantly share code, notes, and snippets.

@goosemania
goosemania / gist:06c8d2c46e512ff9531ab32292ea1702
Created February 25, 2021 19:20
Age of running queries in PostgreSQL
SELECT pid, query_start, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc;
@goosemania
goosemania / gist:d2a3e5e75a6584f70a74f0feb75ac6a0
Created January 4, 2018 18:59
Check if all repodata has been compressed + check trackers
# count number of units with compressed repodata (5 is id of Binary data)
mongo pulp_database --eval 'db.units_rpm.find({"repodata.primary": {$type: 5}}).count()'
# count total number of units
mongo pulp_database --eval 'db.units_rpm.count()'
# migration trackers status
mongo pulp_database --eval 'db.migration_trackers.find().shellPrint()'