module GreenHat::Production
Sidekiq
Log Helpers
Public Class Methods
errors()
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 24 def self.errors logs.select { |x| x.severity == 'ERROR' } end
fast_stats()
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 4 def self.fast_stats things.each do |thing| puts `fast-stats #{thing.file}` end :ok! end
logs()
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 12 def self.logs @logs ||= things.map(&:data).flatten.compact end
pages()
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 28 def self.pages show logs end
queue_duration(data = nil)
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 32 def self.queue_duration(data = nil) data ||= logs data.select { |x| x.key? :enqueued_at }.each do |row| next if row.key? :queue_duration row[:queue_duration] = row.enqueued_at - row.created_at end end
raw()
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 16 def self.raw @raw ||= things.map(&:raw).flatten.compact end
things()
click to toggle source
# File lib/greenhat/accessors/logs/production.rb, line 20 def self.things Thing.where(name: 'gitlab_rails_production_json_log') end