Postgresql background worker which samples status and performance metrics for analysis