Class: Resque::Integration::QueuesInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/resque/integration/queues_info.rb,
lib/resque/integration/queues_info/age.rb,
lib/resque/integration/queues_info/size.rb,
lib/resque/integration/queues_info/config.rb

Defined Under Namespace

Classes: Age, Config, Size

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ QueuesInfo

Returns a new instance of QueuesInfo.



8
9
10
11
12
# File 'lib/resque/integration/queues_info.rb', line 8

def initialize(options)
  @config = Config.new(options.fetch(:config))
  @size = Size.new(@config)
  @age = Age.new(@config)
end

Instance Method Details

#age_for_queue(queue) ⇒ Object



14
15
16
# File 'lib/resque/integration/queues_info.rb', line 14

def age_for_queue(queue)
  @age.time(queue)
end

#age_overallObject



18
19
20
# File 'lib/resque/integration/queues_info.rb', line 18

def age_overall
  @age.overall
end

#channel(queue) ⇒ Object



46
47
48
# File 'lib/resque/integration/queues_info.rb', line 46

def channel(queue)
  @config.channel(queue)
end

#dataObject



50
51
52
# File 'lib/resque/integration/queues_info.rb', line 50

def data
  @config.data
end

#failures_count_for_queue(queue) ⇒ Object



30
31
32
# File 'lib/resque/integration/queues_info.rb', line 30

def failures_count_for_queue(queue)
  Resque::Integration::FailureBackends::QueuesTotals.count(queue)
end

#size_for_queue(queue) ⇒ Object



22
23
24
# File 'lib/resque/integration/queues_info.rb', line 22

def size_for_queue(queue)
  @size.size(queue)
end

#size_overallObject



26
27
28
# File 'lib/resque/integration/queues_info.rb', line 26

def size_overall
  @size.overall
end

#threshold_age(queue) ⇒ Object



38
39
40
# File 'lib/resque/integration/queues_info.rb', line 38

def threshold_age(queue)
  @config.max_age(queue)
end

#threshold_failures_count(queue, period) ⇒ Object



42
43
44
# File 'lib/resque/integration/queues_info.rb', line 42

def threshold_failures_count(queue, period)
  @config.max_failures_count(queue, period)
end

#threshold_size(queue) ⇒ Object



34
35
36
# File 'lib/resque/integration/queues_info.rb', line 34

def threshold_size(queue)
  @config.max_size(queue)
end