A PostgreSQL function to quickly identify Mirth channels where the Source Connector is taking a long time to process messages. It aggregates statistics and lists specific Message IDs for easy troubleshooting.
Run this once to create the function in your Mirth database.
CREATE OR REPLACE FUNCTION check_slow_channels(
threshold_seconds INT DEFAULT 15,