Harbor Documentation

Harbor::Contrib::Stats::RequestQueue

Constants

  • BLOCK_SIZE

Attributes

  • unprocessed_count [RW] (Not documented)
  • offset [RW] (Not documented)

Public Class Methods

new()

      # File lib/harbor/contrib/stats/reconciliation/request_queue.rb, line 10
10:         def initialize
11:           self.unprocessed_count = Harbor::Contrib::Stats::ApacheRequest.unprocessed_count
12:           self.offset = 0
13:           fill_queue!(self.unprocessed_count, 0)
14:         end

Public Instance Methods

expanded_search(page_view)

      # File lib/harbor/contrib/stats/reconciliation/request_queue.rb, line 16
16:         def expanded_search(page_view)
17:           self.each_with_index do |request, i|
18:             if request == page_view
19:               return self.delete_at(i)
20:             end
21:           end
22:           nil
23:           # self.offset += BLOCK_SIZE
24:           # puts "Expanding queue by #{BLOCK_SIZE}, offset: #{self.offset}"
25:           # fill_queue!(BLOCK_SIZE, self.offset)
26:           # expanded_search(page_view)
27:         end

fill_queue!(limit, offset)

      # File lib/harbor/contrib/stats/reconciliation/request_queue.rb, line 29
29:         def fill_queue!(limit, offset)
30:           self << Harbor::Contrib::Stats::ApacheRequest.all_unprocessed(limit, offset).map { |v| ApacheRequest.new(v.id, nil, nil, v.uri, v.referrer, v.date) }
31:           self.flatten!
32:           return true
33:         end