Sha256: fa33840d4dc8f62af5c4893a69f292cfb3ab17091532a7a37ef0b36599bfdda0

Contents?: true

Size: 464 Bytes

Versions: 24

Compression:

Stored size: 464 Bytes

Contents

module ForemanTasks
  class Task::Summarizer
    def summarize_by_status(since=nil)
      result = ::ForemanTasks::Task.select('count(state) AS count, state, result').group(:state, :result).order(:state)
      result = result.where('started_at > ?', since) if since
      result
    end

    def latest_tasks_in_errors_warning(limit=5)
      ::ForemanTasks::Task.where('result in (?)', ['error', 'warning']).order('started_at DESC').limit(limit)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
foreman-tasks-0.8.6 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.8.5 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.8.4 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.8.3 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.8.2 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.8.1 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.8.0 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.20 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.19 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.18 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.17 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.16 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.15 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.14 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.13 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.12 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.11 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.10 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.9 app/models/foreman_tasks/task/summarizer.rb
foreman-tasks-0.7.8 app/models/foreman_tasks/task/summarizer.rb