Sha256: 0c4dbb40dc10012d0a42c7db276b2f8881764c5b85e948cd405aec5dccbbb010

Contents?: true

Size: 1.2 KB

Versions: 89

Compression:

Stored size: 1.2 KB

Contents

-- A pathology report to help identify any HL7/delayed_job issues
-- the name of the view (the filename here) is significant as we'll compile all reporting_daily_*
-- views into a daily digest email
select
  (select count(*) from delayed_jobs) as delayed_jobs_total,
  (select count(*) from delayed_jobs where attempts = 0) as delayed_jobs_unprocessed,
  (select count(*) from delayed_jobs where last_error is not null and failed_at is null ) as delayed_jobs_retrying,
  (select count(*) from delayed_jobs where last_error is not null and failed_at is not null ) as delayed_jobs_failed,
  (select max(created_at) from delayed_jobs) as delayed_jobs_latest_entry,
  (select count(*) from delayed_jobs where created_at >= now()::date) as delayed_jobs_added_today,
  (select json_object_agg(priority, count) from (select priority, count(*) from delayed_jobs group by priority ) query) as delayed_jobs_priority_counts,
  (select json_object_agg(coalesce(queue, 'unset'), count) from (select queue, count(*) from delayed_jobs group by queue ) query) as delayed_jobs_queue_counts,
  (select json_object_agg(attempts, count) from (select attempts, count(*) from delayed_jobs group by attempts ) query) as delayed_jobs_attempts_counts

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
renalware-core-2.0.147 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.146 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.145 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.144 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.143 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.142 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.141 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.140 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.139 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.138 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.137 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.136 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.135 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.134 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.133 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.132 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.131 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.130 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.129 db/views/reporting_daily_pathology_v03.sql
renalware-core-2.0.128 db/views/reporting_daily_pathology_v03.sql