Class: Perfm::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/perfm/agent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, storage) ⇒ Agent

Returns a new instance of Agent.



5
6
7
8
9
# File 'lib/perfm/agent.rb', line 5

def initialize(config, storage)
  @config = config
  @queue = Queue.new(storage)
  @sidekiq_queue = Queue.new(storage)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/perfm/agent.rb', line 3

def config
  @config
end

#queueObject (readonly)

Returns the value of attribute queue.



3
4
5
# File 'lib/perfm/agent.rb', line 3

def queue
  @queue
end

#sidekiq_queueObject (readonly)

Returns the value of attribute sidekiq_queue.



3
4
5
# File 'lib/perfm/agent.rb', line 3

def sidekiq_queue
  @sidekiq_queue
end

Instance Method Details

#push_metrics(data) ⇒ Object



11
12
13
# File 'lib/perfm/agent.rb', line 11

def push_metrics(data)
  queue.push_metrics(data)
end

#push_sidekiq_metrics(data) ⇒ Object



15
16
17
# File 'lib/perfm/agent.rb', line 15

def push_sidekiq_metrics(data)
  sidekiq_queue.push_metrics(data)
end