Class: Norikra::Listener::MemoryPool

Inherits:
Base
  • Object
show all
Defined in:
lib/norikra/listener.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_ASYNC_INTERVAL

Instance Attribute Summary collapse

Attributes inherited from Base

#events_statistics

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#apply_type_convert_to_events, #background, #initialize, #push, #shutdown, #start, #type_convert, #update

Constructor Details

This class inherits a constructor from Norikra::Listener::Base

Instance Attribute Details

#output_pool=(value) ⇒ Object (writeonly)

Sets the attribute output_pool

Parameters:

  • value

    the value to set the attribute output_pool to.



189
190
191
# File 'lib/norikra/listener.rb', line 189

def output_pool=(value)
  @output_pool = value
end

Class Method Details

.labelObject



191
192
193
# File 'lib/norikra/listener.rb', line 191

def self.label
  nil # Memory pool listener is built-in and implicit listener
end

Instance Method Details

#process_sync(news, olds) ⇒ Object



195
196
197
198
199
200
201
# File 'lib/norikra/listener.rb', line 195

def process_sync(news, olds)
  t = Time.now.to_i
  if news.respond_to?(:map)
    events = news.map{|e| [t, e]}
    @output_pool.push(@query_name, @query_group, events)
  end
end