Sha256: 0bf02fa704cca6a892982862f55a9c35bd90ecaf92eac5e1928bb83f1aaf6138

Contents?: true

Size: 527 Bytes

Versions: 1

Compression:

Stored size: 527 Bytes

Contents

module Timescale
  class JobStat < ActiveRecord::Base
    self.table_name = "timescaledb_information.job_stats"

    belongs_to :job

    scope :success, -> { where(last_run_status: "Success") }
    scope :scheduled, -> { where(job_status: "Scheduled") }
    scope :resume, -> do
      select("sum(total_successes)::int as success,
             sum(total_runs)::int as runs,
             sum(total_failures)::int as failures")
        .to_a.map{|e|e.attributes.transform_keys(&:to_sym) }
    end
  end
  JobStats = JobStat
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
timescaledb-0.1.5 lib/timescale/job_stats.rb